diff --git a/docs/release-notes/dictionary-releases.md b/docs/release-notes/dictionary-releases.md index 14dd24bf..0c55256a 100644 --- a/docs/release-notes/dictionary-releases.md +++ b/docs/release-notes/dictionary-releases.md @@ -20,6 +20,15 @@ None to report. ------> +## Release 1.24 + +**Release Date: October 1, 2024** + +#### Updates + +- Expanded interval fields: `treatment_start_interval`, `interval_of_followup`, `relapse_interval`, `test_interval` to accept negative numbers to record any clinical events which happened prior to primary diagnosis. +- Added 3 new optional fields: `drug_database`, `drug_id` and `drug_term` to `Chemotherapy`, `Hormone Therapy` and `Immunotherapy` tables to support the submission of non-RxNorm drugs. + ## Release 1.23 **Release Date: August 19, 2024** diff --git a/scripts/data/schemas/1.24.json b/scripts/data/schemas/1.24.json new file mode 100644 index 00000000..02ceb11b --- /dev/null +++ b/scripts/data/schemas/1.24.json @@ -0,0 +1 @@ +{"schemas":[{"name":"sample_registration","description":"The collection of data elements required to register the required Donor-Specimen-Sample data to the ARGO Data Platform. Registration of samples is required before molecular and clinical data submission can proceed.","fields":[{"name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"examples":"TEST-CA","notes":"This is the unique id that is assigned to your program. If you have logged into the platform, this is the Program Id that you see in the Program Services area. For example, TEST-CA is a Program ID.","displayName":"Program ID"},"restrictions":{"required":true}},{"name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"examples":"90234,BLD_donor_89,AML-90","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"gender","valueType":"string","description":"Description of the donor self-reported gender. Gender is described as the assemblage of properties that distinguish people on the basis of their societal roles.","meta":{"validationDependency":true,"core":true,"displayName":"Gender"},"restrictions":{"required":true,"codeList":["Female","Male","Other"]}},{"name":"submitter_specimen_id","valueType":"string","description":"Unique identifier of the specimen, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"examples":"LAML_PO,00445,THY_099-tumour","displayName":"Submitter Specimen ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"specimen_tissue_source","valueType":"string","description":"Tissue source of the biospecimen.","meta":{"validationDependency":true,"core":true,"displayName":"Specimen Tissue Source"},"restrictions":{"required":true,"codeList":["Blood derived - bone marrow","Blood derived - peripheral blood","Blood derived","Bone marrow","Bone","Buccal cell","Buffy coat","Cerebellum","Cerebrospinal fluid","Endometrium","Esophagus","Intestine","Lymph node","Mononuclear cells from bone marrow","Other","Plasma","Pleural effusion","Saliva","Serum","Skin","Solid tissue","Spleen","Sputum","Stomach","Tonsil","Urine"]}},{"name":"tumour_normal_designation","valueType":"string","description":"Description of specimens tumour/normal status for data processing.","restrictions":{"required":true,"codeList":["Normal","Tumour"]},"meta":{"validationDependency":true,"core":true,"displayName":"Tumour Normal Designation"}},{"name":"specimen_type","valueType":"string","description":"Description of the kind of specimen that was collected with respect to tumour/normal tissue origin.","restrictions":{"required":true,"codeList":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"core":true,"displayName":"Specimen Type"}},{"name":"submitter_sample_id","valueType":"string","description":"Unique identifier of the sample, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"examples":"hnc_12,CCG_34_94583,BRCA47832-3239","displayName":"Submitter Sample ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"sample_type","valueType":"string","description":"Description of the type of molecular sample used for testing.","meta":{"validationDependency":true,"core":true,"displayName":"Sample Type"},"restrictions":{"required":true,"codeList":["Amplified DNA","ctDNA","Other DNA enrichments","Other RNA fractions","polyA+ RNA","Ribo-Zero RNA","Total DNA","Total RNA"]}}]},{"name":"donor","description":"The collection of data elements related to a specific donor in an ARGO program.","meta":{"parent":"specimen"},"fields":[{"name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},{"description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"description":"Donor's last known state of living or deceased.","name":"vital_status","restrictions":{"codeList":["Alive","Deceased"],"required":true},"valueType":"string","meta":{"validationDependency":true,"core":true,"displayName":"Vital Status"}},{"description":"Indicate the cause of a donor's death.","name":"cause_of_death","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]},"valueType":"string","meta":{"core":true,"dependsOn":"donor.vital_status","notes":"Cause of death is only required to be submitted if the donor's vital_status is Deceased.","displayName":"Cause of Death"}},{"description":"Interval of how long the donor has survived since primary diagnosis, in days.","name":"survival_time","valueType":"integer","meta":{"dependsOn":"donor.vital_status","notes":"Survival_time is only required to be submitted if the donor's vital_status is Deceased.","validationDependency":true,"units":"days","core":"true","displayName":"Survival Time"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"range":{"exclusiveMin":0}}},{"name":"primary_site","valueType":"string","isArray":true,"description":"The text term used to describe the primary site of disease, as categorized by the World Health Organization's (WHO) International Classification of Diseases for Oncology (ICD-O). This categorization groups cases into general categories.","meta":{"displayName":"Primary Site","core":true,"notes":"To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Breast|Ovary"},"restrictions":{"required":true,"codeList":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"]}},{"description":"Indicate the donor's height, in centimeters (cm).","name":"height","valueType":"number","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Height"}},{"description":"Indicate the donor's weight, in kilograms (kg).","name":"weight","valueType":"number","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Weight"}},{"description":"Indicate the donor's Body Mass Index (BMI) in kg/m².","name":"bmi","valueType":"number","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"BMI"}},{"description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},{"description":"Indicate the donor's menopause status at the time of primary diagnosis. (Reference: caDSR CDE ID 2434914)","name":"menopause_status","restrictions":{"codeList":["Not applicable","Perimenopausal","Postmenopausal","Premenopausal","Unknown"]},"valueType":"string","meta":{"displayName":"Menopause Status"}},{"description":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)","name":"age_at_menarche","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Age at Menarche"}},{"description":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)","name":"number_of_pregnancies","valueType":"integer","restrictions":{"range":{"min":0}},"meta":{"displayName":"Number of Pregnancies"}},{"description":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)","name":"number_of_children","valueType":"integer","restrictions":{"range":{"min":0}},"meta":{"displayName":"Number of Children"}},{"description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},{"description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},{"description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},{"description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},{"description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}]},{"name":"specimen","description":"The collection of data elements related to a donor's specimen. A specimen is any material sample taken for testing, diagnostic or research purposes.","meta":{"parent":"sample_registration"},"fields":[{"name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},{"name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate the primary diagnosis event in the clinical timeline that this specimen acquisition was related to.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"pathological_tumour_staging_system","description":"Specify the tumour staging system used to assess the cancer at the time the tumour specimen was resected. Pathological classification is based on the clinical stage information (acquired before treatment) and supplemented/modified by operative findings and pathological evaluation of the resected specimen.","valueType":"string","meta":{"validationDependency":true,"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Pathological Tumour Staging System"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"codeList":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"]}},{"name":"pathological_t_category","description":"The code to represent the stage of cancer defined by the size or contiguous extension of the primary tumour (T), according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","valueType":"string","meta":{"core":true,"dependsOn":"specimen.pathological_tumour_staging_system","notes":"This field is required only if the selected pathological_tumour_staging_system is any edition of the AJCC cancer staging system.","displayName":"Pathological T Category"},"restrictions":{"codeList":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"]}},{"name":"pathological_n_category","description":"The code to represent the stage of cancer defined by whether or not the cancer has reached nearby lymph nodes (N), according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","valueType":"string","meta":{"core":true,"dependsOn":"specimen.pathological_tumour_staging_system","notes":"This field is required only if the selected pathological_tumour_staging_system is any edition of the AJCC cancer staging system.","displayName":"Pathological N Category"},"restrictions":{"codeList":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"]}},{"name":"pathological_m_category","description":"The code to represent the stage of cancer defined by whether there are distant metastases (M), meaning spread of cancer to other parts of the body, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","valueType":"string","meta":{"core":true,"dependsOn":"specimen.pathological_tumour_staging_system","notes":"This field is required only if the selected pathological_tumour_staging_system is any edition of the AJCC cancer staging system.","displayName":"Pathological M Category"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"codeList":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"]}},{"name":"pathological_stage_group","description":"Specify the tumour stage, based on pathological_tumour_staging_system, used to assess the cancer at the time the tumour specimen was resected.","valueType":"string","meta":{"core":true,"dependsOn":"specimen.pathological_tumour_staging_system","notes":"This field depends on the selected pathological_tumour_staging_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","displayName":"Pathological Stage Group"},"restrictions":{"codeList":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}},{"name":"specimen_acquisition_interval","description":"Interval between primary diagnosis and specimen acquisition, in days.","valueType":"integer","meta":{"validationDependency":true,"units":"days","core":true,"notes":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","displayName":"Specimen Acquisition Interval"},"restrictions":{"required":true}},{"name":"tumour_histological_type","description":"The code to represent the histology (morphology) of neoplasms that is usually obtained from a pathology report, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","valueType":"string","meta":{"validationDependency":true,"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","examples":"8260/3,9691/36","displayName":"Tumour Histological Type"},"restrictions":{"regex":"^[8,9]{1}[0-9]{3}/[0,1,2,3,6,9]{1}[1-9]{0,1}$"}},{"name":"specimen_anatomic_location","description":"Indicate the ICD-O-3 topography code for the anatomic location of a specimen when it was collected. Refer to the guidelines provided in the ICD-O-3 manual at https://apps.who.int/iris/handle/10665/42344.","valueType":"string","meta":{"core":true,"displayName":"Specimen Anatomic Location","examples":"C50.1,C18"},"restrictions":{"required":true,"regex":"^[C][0-9]{2}(.[0-9]{1})?$"}},{"name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},{"name":"specimen_processing","description":"Indicate the technique used to process specimen.","valueType":"string","restrictions":{"codeList":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"]},"meta":{"displayName":"Specimen Processing"}},{"name":"specimen_storage","description":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured.","valueType":"string","meta":{"notes":"For specimens that were freshly extracted or immediately cultured, select Not Applicable.","displayName":"Specimen Storage"},"restrictions":{"codeList":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"]}},{"name":"reference_pathology_confirmed","description":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)","valueType":"string","meta":{"validationDependency":true,"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Reference Pathology Confirmed"},"restrictions":{"codeList":["Yes","No","Unknown"]}},{"name":"tumour_grading_system","description":"Specify the tumour staging system used to assess the description of a tumour based on how abnormal the tumour cells and the tumour tissue look under a microscope. Tumour grade is an indicator of how quickly a tumour is likely to grow.","valueType":"string","meta":{"validationDependency":true,"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Tumour Grading System"},"restrictions":{"codeList":["FNCLCC grading system","Four-tier grading system","Gleason grade group system","Grading system for GISTs","Grading system for GNETs","ISUP grading system","Nuclear grading system for DCIS","Scarff-Bloom-Richardson grading system","Three-tier grading system","Two-tier grading system","WHO grading system for CNS tumours"]}},{"name":"tumour_grade","description":"Grade of the tumour as assigned by the reporting tumour_grading_system.","valueType":"string","meta":{"core":true,"dependsOn":"specimen.tumour_grading_system","notes":"This field depends on the selected tumour_grading_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Grading Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-grading-classifications","displayName":"Tumour Grade"},"restrictions":{"codeList":["Low grade","High grade","GX","G1","G2","G3","G4","Low","High","Grade I","Grade II","Grade III","Grade IV","Grade Group 1","Grade Group 2","Grade Group 3","Grade Group 4","Grade Group 5"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]}},{"name":"percent_tumour_cells","description":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)","valueType":"number","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells"},"restrictions":{"range":{"min":0,"max":1},"script":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"]}},{"name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}},{"name":"percent_proliferating_cells","description":"Indicate a value, in decimals, that represents the count of proliferating cells determined during pathologic review of the specimen.","valueType":"number","meta":{"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field should only be submitted if the specimen is tumour.","displayName":"Percent Proliferating Cells"},"restrictions":{"range":{"min":0,"max":1}}},{"name":"percent_inflammatory_tissue","description":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)","valueType":"number","meta":{"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field should only be submitted if the specimen is tumour.","displayName":"Percent Inflammatory Tissue"},"restrictions":{"range":{"min":0,"max":1}}},{"name":"percent_stromal_cells","description":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)","valueType":"number","meta":{"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field should only be submitted if the specimen is tumour.","displayName":"Percent Stromal Cells"},"restrictions":{"range":{"min":0,"max":1}}},{"name":"percent_necrosis","description":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)","valueType":"number","meta":{"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field should only be submitted if the specimen is tumour.","displayName":"Percent Necrosis"},"restrictions":{"range":{"min":0,"max":1}}}]},{"name":"primary_diagnosis","description":"The collection of data elements related to a donor's primary diagnosis. The primary diagnosis is the first diagnosed case of cancer in a donor. To submit multiple primary diagnoses for a single donor, submit multiple rows in the primary diagnosis file for this donor.","meta":{"parent":"donor"},"fields":[{"name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},{"name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"submitter_primary_diagnosis_id","valueType":"string","description":"Unique identifier of the primary diagnosis event, assigned by the data provider.","meta":{"primaryId":true,"displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"age_at_diagnosis","valueType":"integer","description":"Age that the donor was first diagnosed with cancer, in years. This should be based on the earliest diagnosis of cancer.","restrictions":{"required":true,"range":{"exclusiveMin":0,"max":90}},"meta":{"units":"years","core":true,"displayName":"Age at Diagnosis"}},{"name":"cancer_type_code","valueType":"string","description":"The code to represent the cancer type using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"required":true,"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"core":true,"examples":"C41.1,C16.9,C00.5,D46.9","displayName":"Cancer Type Code"}},{"name":"cancer_type_additional_information","valueType":"string","description":"Additional details related to the cancer type that are not covered by the ICD-10 code provided in the cancer_type field.","meta":{"displayName":"Cancer Type Additional Information"}},{"name":"basis_of_diagnosis","description":"Indicate the most valid basis of how the primary diagnosis was identified. If more than one diagnosis technique was used, select the term that has the highest code number (see notes). (Reference: IACR Standard for Basis of Diagnosis http://www.iacr.com.fr/images/doc/basis.pdf)","restrictions":{"codeList":["Clinical investigation","Clinical","Cytology","Death certificate only","Histology of a metastasis","Histology of a primary tumour","Specific tumour markers","Unknown"]},"valueType":"string","meta":{"notes":"0: Death certificate only: Information provided is from a death certificate.\n1: Clinical: Diagnosis made before death.\n2: Clinical investigation: All diagnostic techniques, including X-ray, endoscopy, imaging, ultrasound, exploratory surgery (such as laparotomy), and autopsy, without a tissue diagnosis.\n4: Specific tumour markers: Including biochemical and/or immunologic markers that are specific for a tumour site.\n5: Cytology: Examination of cells from a primary or secondary site, including fluids aspirated by endoscopy or needle; also includes the microscopic examination of peripheral blood and bone marrow aspirates.\n6: Histology of a metastasis: Histologic examination of tissue from a metastasis, including autopsy specimens.\n7: Histology of a primary tumour: Histologic examination of tissue from primary tumour, however obtained, including all cutting techniques and bone marrow biopsies; also includes autopsy specimens of primary tumour.\n9: Unknown: No information on how the diagnosis has been made.","displayName":"Basis of Diagnosis"}},{"name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},{"name":"lymph_nodes_examined_status","description":"Indicate if lymph nodes were examined for metastases.","valueType":"string","restrictions":{"required":true,"codeList":["Cannot be determined","No","No lymph nodes found in resected specimen","Not applicable","Yes"]},"meta":{"core":true,"displayName":"Lymph Nodes Examined Status"}},{"name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}},{"name":"number_lymph_nodes_examined","description":"The total number of lymph nodes tested for the presence of cancer. (Reference: caDSR CDE ID 3)","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"range":{"min":0}},"meta":{"displayName":"Number Of Lymph Nodes Examined","dependsOn":"primary_diagnosis.lymph_nodes_examined_status","notes":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'."}},{"name":"number_lymph_nodes_positive","description":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: caDSR CDE ID 6113694)","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"range":{"min":0}},"meta":{"core":true,"displayName":"Number Of Lymph Nodes Positive","dependsOn":"primary_diagnosis.lymph_nodes_examined_status","notes":"This field is only required if 'lymph_nodes_examined_status' is 'Yes'."}},{"name":"clinical_tumour_staging_system","valueType":"string","description":"Indicate the tumour staging system used to stage the cancer at the time of primary diagnosis (prior to treatment).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"codeList":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"]},"meta":{"validationDependency":true,"core":true,"displayName":"Clinical Tumour Staging System"}},{"name":"clinical_t_category","description":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","valueType":"string","meta":{"core":true,"dependsOn":"primary_diagnosis.clinical_tumour_staging_system","notes":"This field is required only if the selected clinical_tumour_staging_system is any edition of the AJCC cancer staging system.","displayName":"Clinical T Category"},"restrictions":{"codeList":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"]}},{"name":"clinical_n_category","description":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","valueType":"string","meta":{"core":true,"dependsOn":"primary_diagnosis.clinical_tumour_staging_system","notes":"This field is required only if the selected clinical_tumour_staging_system is any edition of the AJCC cancer staging system.","displayName":"Clinical N Category"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"],"codeList":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"]}},{"name":"clinical_m_category","description":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned.","valueType":"string","meta":{"core":true,"dependsOn":"primary_diagnosis.clinical_tumour_staging_system","notes":"This field is required only if the selected clinical_tumour_staging_system is any edition of the AJCC cancer staging system.","displayName":"Clinical M Category"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"codeList":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"]}},{"name":"clinical_stage_group","description":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage.","valueType":"string","restrictions":{"codeList":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.clinical_tumour_staging_system","notes":"This field is dependent on the selected clinical_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","displayName":"Clinical Stage Group","examples":"Stage I, Stage IIB"}},{"name":"presenting_symptoms","description":"Indicate presenting symptoms at time of primary diagnosis.","valueType":"string","isArray":true,"restrictions":{"codeList":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Loss of Appetite","Nausea","None","Not Reported","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Swelling in the Neck","Unknown","Vomiting","Weight Loss"]},"meta":{"displayName":"Presenting Symptoms","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Anemia|Bloating|Diabetes"}},{"name":"performance_status","description":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status).","valueType":"string","restrictions":{"codeList":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"]},"meta":{"notes":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction.\nGrade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work).\nGrade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours.\nGrade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours.\nGrade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair","displayName":"Performance Status"}}]},{"name":"treatment","description":"The collection of data elements related to a donor's treatment at a specific point in the clinical record. To submit multiple treatments for a single donor, please submit treatment rows in the treatment file for this donor.","meta":{"parent":"donor"},"fields":[{"name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},{"name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate the primary diagnosis event in the clinical timeline that this treatment was related to.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"treatment_type","description":"Indicate the type of treatment regimen that the donor completed.","valueType":"string","isArray":true,"restrictions":{"required":true,"codeList":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"]},"meta":{"validationDependency":true,"core":true,"notes":"Depending on the treatment_type(s) selected, additional treatment details may be required to be submitted. For example, if treatment_type includes 'Chemotherapy', the supplemental Chemotherapy treatment type file is required.\nTo include multiple values, separate values with a pipe delimiter '|' within your file.","displayName":"Treatment Type","examples":"Chemotherapy|Hormonal therapy"}},{"name":"is_primary_treatment","description":"Indicate if the treatment was the primary treatment following the initial diagnosis.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Yes","No"]},"meta":{"core":true,"displayName":"Is Primary Treatment","dependsOn":"treatment.treatment_type"}},{"name":"line_of_treatment","description":"Indicate the line of treatment if it is not the primary treatment.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Line Of treatment","dependsOn":"treatment.is_primary_treatment","examples":"2,3,4"}},{"name":"treatment_start_interval","description":"The interval between the primary diagnosis and initiation of treatment, in days.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"core":true,"units":"days","notes":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","displayName":"Treatment Start Interval","dependsOn":"treatment.treatment_type"}},{"name":"treatment_duration","description":"The duration of treatment regimen, in days.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"units":"days","displayName":"Treatment Duration","dependsOn":"treatment.treatment_type"}},{"name":"days_per_cycle","description":"Indicate the number of days in a treatment cycle.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Days Per Cycle","dependsOn":"treatment.treatment_type"}},{"name":"number_of_cycles","description":"Indicate the number of treatment cycles.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Number Of Cycles","dependsOn":"treatment.treatment_type"}},{"name":"treatment_intent","description":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"]},"meta":{"core":true,"displayName":"Treatment Intent","dependsOn":"treatment.treatment_type"}},{"name":"treatment_setting","description":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: NCIt C124308)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"]},"meta":{"core":true,"displayName":"Treatment Setting","dependsOn":"treatment.treatment_type"}},{"name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},{"name":"response_to_treatment","description":"The donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"codeList":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"]},"meta":{"core":true,"displayName":"Response To Treatment","dependsOn":"treatment.response_to_treatment_criteria_method","notes":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},{"name":"outcome_of_treatment","description":"Indicate the donor's outcome of the prescribed treatment.","valueType":"string","restrictions":{"codeList":["Treatment completed as prescribed","Treatment incomplete due to technical or organizational problems","Treatment incomplete because patient died","Patient choice (stopped or interrupted treatment)","Physician decision (stopped or interrupted treatment)","Treatment stopped due to lack of efficacy (disease progression)","Treatment stopped due to acute toxicity","Other","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Outcome Of Treatment","dependsOn":"treatment.treatment_type"}},{"name":"toxicity_type","description":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity.","valueType":"string","restrictions":{"codeList":["Hematological","Non-hematological","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Toxicity Type","dependsOn":"treatment.outcome_of_treatment"}},{"name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},{"name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},{"name":"adverse_events","description":"Report any treatment related adverse events. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Adverse Events","dependsOn":"treatment.treatment_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},{"name":"clinical_trials_database","description":"If the donor is a participant in a clinical trial, indicate the clinical trial database where the clinical trial is registered.","valueType":"string","meta":{"display name":"Clinical Trials Database","notes":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added."},"restrictions":{"codeList":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"]}},{"name":"clinical_trial_number","description":"Based on the clinical_trial_database, indicate the unique NCT or EudraCT clinical trial identifier of which the donor is a participant.","valueType":"string","meta":{"display name":"Clinical Trial Number","dependsOn":"treatment.clinical_trials_database","examples":"2016-002120-83,NCT02465060"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"]}}]},{"name":"chemotherapy","description":"The collection of data elements describing the details of a chemotherapy treatment regimen completed by a donor. To submit multiple treatment drugs for a single regimen, submit multiple rows in the chemotherapy file.","meta":{"parent":"treatment"},"fields":[{"name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},{"name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, as assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},{"name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},{"name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},{"name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},{"name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},{"name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},{"name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},{"name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},{"name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},{"name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},{"name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}]},{"name":"hormone_therapy","description":"The collection of data elements describing the details of a hormone treatment therapy completed by a donor. To submit multiple treatment drugs for a single regimen, submit multiple rows in the hormone_therapy file.","meta":{"parent":"treatment"},"fields":[{"name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},{"name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},{"name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Hormone Therapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},{"name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},{"name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},{"name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},{"name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},{"name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},{"name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}]},{"name":"radiation","description":"The collection of data elements describing the details of a radiation treatment completed by a donor.","meta":{"parent":"treatment"},"fields":[{"name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},{"name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"radiation_therapy_modality","description":"Indicate the method of radiation treatment or modality.","valueType":"string","restrictions":{"required":true,"codeList":["Electron","Heavy Ions","Photon","Proton"]},"meta":{"validationDependency":true,"core":true,"displayName":"Radiation Therapy Modality"}},{"name":"radiation_therapy_type","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal"]},"meta":{"core":true,"displayName":"Type of Radiation Therapy","notes":"Internal application includes Brachytherapy."}},{"name":"radiation_therapy_fractions","description":"Indicate the total number of fractions delivered as part of treatment.","valueType":"integer","restrictions":{"required":true,"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Radiation Therapy Fractions"}},{"name":"radiation_therapy_dosage","description":"Indicate the total dose given in units of Gray (Gy).","valueType":"number","restrictions":{"required":true,"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Radiation Therapy Dosage"}},{"name":"anatomical_site_irradiated","description":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)","valueType":"string","isArray":true,"restrictions":{"required":true,"codeList":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"]},"meta":{"core":true,"displayName":"Anatomical Site Irradiated"}},{"name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},{"name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}]},{"name":"immunotherapy","description":"The collection of data elements describing the details of an immunotherapy treatment completed by a donor.","meta":{"parent":"treatment"},"fields":[{"name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},{"name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"immunotherapy_type","valueType":"string","description":"Indicate the type of immunotherapy administered to donor.","meta":{"displayName":"Immunotherapy Type","core":true},"restrictions":{"required":true,"codeList":["Cell-based","Immune checkpoint inhibitors","Monoclonal antibodies other than immune checkpoint inhibitors","Other immunomodulatory substances"]}},{"name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},{"name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},{"name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},{"name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},{"name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},{"name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},{"name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},{"name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}]},{"name":"surgery","description":"The collection of data elements related to a donor's surgical treatment at a specific point in the clinical record. To submit multiple surgeries, submit multiple rows in the Surgery file. If a specimen was resected during surgery, indicate the unique identifier of the specimen in the 'submitter_specimen_id' field. If multiple specimens were resected during a single surgical procedure, submit each 'submitter_specimen_id' as a new row with the same 'submitter_treatment_id' and 'surgery_type' values.","meta":{"parent":"donor"},"fields":[{"name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},{"name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},{"name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},{"name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},{"name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},{"name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},{"name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},{"name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},{"name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},{"name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},{"name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},{"name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},{"name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},{"name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},{"name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}]},{"name":"follow_up","description":"The collection of data elements related to a specific follow-up visit to a donor. A follow-up is defined as any point of contact with a patient after primary diagnosis. To submit multiple follow-ups for a single donor, please submit multiple rows in the follow-up file for this donor.","meta":{"parent":"donor"},"fields":[{"name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},{"description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"description":"Unique identifier for a follow-up event in a donor's clinical record, assigned by the data provider.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"displayName":"Submitter Follow-Up ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"description":"Interval from the primary diagnosis date to the follow-up date, in days.","name":"interval_of_followup","valueType":"integer","restrictions":{"required":true},"meta":{"core":true,"units":"days","displayName":"Interval Of Follow-Up","notes":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},{"description":"Indicate the donor's disease status at time of follow-up. (Reference: RECIST)","name":"disease_status_at_followup","valueType":"string","restrictions":{"required":true,"codeList":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Progression NOS","Relapse or recurrence","Stable"]},"meta":{"core":true,"displayName":"Disease Status at Follow-Up"}},{"name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate if the follow-up is related to a specific primary diagnosis event in the clinical timeline.","meta":{"validationDependency":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID","primaryId":true},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"submitter_treatment_id","valueType":"string","description":"Indicate if the follow-up is related to a specific treatment event in the clinical timeline.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"description":"Indicate the donor's weight, in kilograms (kg), at the time of follow-up.","name":"weight_at_followup","valueType":"number","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Weight at Follow-Up"}},{"description":"Indicate the donor's relapse type.","name":"relapse_type","valueType":"string","restrictions":{"codeList":["Distant recurrence/metastasis","Local recurrence","Local recurrence and distant metastasis","Progression (liquid tumours)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.","displayName":"Relapse Type"}},{"description":"If the donor was clinically disease free following primary treatment and then relapse or recurrence or progression (for liquid tumours) occurred afterwards, then this field will indicate the length of disease free interval, in days.","name":"relapse_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"]},"meta":{"core":true,"units":"days","dependsOn":"follow_up.disease_status_at_followup","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.","displayName":"Relapse Interval"}},{"description":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Reference: caDSR CDE ID 6161031)","name":"method_of_progression_status","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"codeList":["Biomarker in liquid biopsy (e.g. tumour marker in blood or urine)","Biopsy","Blood draw","Bone marrow aspirate","Core biopsy","Cystoscopy","Cytology","Debulking","Diagnostic imaging","Dilation and curettage procedure","Enucleation","Excisional biopsy","Fine needle aspiration","Imaging","Incisional biopsy","Laparoscopy","Laparotomy","Other","Pap Smear","Pathologic review","Physical exam","Surgical resection","Thoracentesis","Ultrasound guided biopsy"]},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file.","displayName":"Method Of Progression Status"}},{"description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}},{"description":"Specify the tumour staging system used to stage the cancer at time of retreatment for recurrence or disease progression. This may be represented as rTNM in the medical report.","name":"recurrence_tumour_staging_system","valueType":"string","restrictions":{"codeList":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"follow_up.disease_status_at_followup","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.","displayName":"Recurrance Tumour Staging System"}},{"name":"recurrence_t_category","description":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","valueType":"string","meta":{"dependsOn":"follow_up.recurrence_tumour_staging_system","notes":"This field is required only if the selected recurrence_tumour_staging_system is any edition of the AJCC cancer staging system.","displayName":"Recurrence T Category"},"restrictions":{"codeList":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"]}},{"name":"recurrence_n_category","description":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","valueType":"string","meta":{"dependsOn":"follow_up.recurrence_tumour_staging_system","notes":"This field is required only if the selected recurrence_tumour_staging_system is any edition of the AJCC cancer staging system.","displayName":"Recurrence N Category"},"restrictions":{"codeList":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"]}},{"name":"recurrence_m_category","description":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","valueType":"string","meta":{"dependsOn":"follow_up.recurrence_tumour_staging_system","notes":"This field is required only if the selected recurrence_tumour_staging_system is any edition of the AJCC cancer staging system.","displayName":"Recurrence M Category"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"codeList":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"]}},{"name":"recurrence_stage_group","description":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) at the time of retreatment for a recurrence or disease progression.","valueType":"string","meta":{"dependsOn":"follow_up.recurrence_tumour_staging_system","notes":"This field is dependent on the selected recurrence_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","displayName":"Recurrence Stage Group"},"restrictions":{"codeList":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}},{"description":"Specify the tumour staging system used to stage the cancer after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery. This may be represented as ypTNM or ycTNM in the medical report.","name":"posttherapy_tumour_staging_system","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"codeList":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"]},"meta":{"displayName":"Post-therapy Tumour Staging System"}},{"name":"posttherapy_t_category","description":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","valueType":"string","meta":{"dependsOn":"follow_up.posttherapy_tumour_staging_system","notes":"This field is required only if the selected posttherapy_tumour_staging_system is any edition of the AJCC cancer staging system.","displayName":"Post-therapy T Category"},"restrictions":{"codeList":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"]}},{"name":"posttherapy_n_category","description":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","valueType":"string","meta":{"dependsOn":"follow_up.posttherapy_tumour_staging_system","notes":"This field is required only if the selected posttherapy_tumour_staging_system is any edition of the AJCC cancer staging system.","displayName":"Post-therapy N Category"},"restrictions":{"codeList":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"]}},{"name":"posttherapy_m_category","description":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","valueType":"string","meta":{"dependsOn":"follow_up.posttherapy_tumour_staging_system","notes":"This field is required only if the selected posttherapy_tumour_staging_system is any edition of the AJCC cancer staging system.","displayName":"Post-therapy M Category"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"codeList":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"]}},{"name":"posttherapy_stage_group","description":"The code to represent the stage group of the tumour, as assigned by the reporting posttherapy_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery.","valueType":"string","meta":{"dependsOn":"follow_up.posttherapy_tumour_staging_system","notes":"This field is dependent on the selected posttherapy_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","displayName":"Post-therapy Stage Group"},"restrictions":{"codeList":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}]},{"name":"exposure","description":"The collection of data elements related to a donor's clinically relevant information not immediately resulting from genetic predispositions.","meta":{"parent":"donor"},"fields":[{"name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},{"description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},{"description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},{"description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},{"description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},{"description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},{"description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},{"description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},{"description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},{"description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},{"description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},{"description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},{"description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},{"description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}]},{"name":"family_history","description":"The collection of data elements describing a donor's familial relationships and familial cancer history.","meta":{"parent":"donor"},"fields":[{"name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},{"description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"description":"Unique identifier of the relative, assigned by the data provider.","name":"family_relative_id","valueType":"string","meta":{"displayName":"Family Relative ID","primaryId":true,"notes":"This field is required to ensure that family members are identified in unique records. Ids can be as simple as an incremented numeral to ensure uniqueness."},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"description":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","name":"relative_with_cancer_history","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Relative with Cancer History"}},{"description":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","name":"relationship_type","restrictions":{"codeList":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"]},"valueType":"string","meta":{"displayName":"Relationship Type"}},{"description":"The self-reported gender of related individual.","name":"gender_of_relative","restrictions":{"codeList":["Female","Male","Other","Unknown"]},"valueType":"string","meta":{"displayName":"Gender of Relative"}},{"description":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","name":"age_of_relative_at_diagnosis","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","displayName":"Age Of Relative At Diagnosis"}},{"name":"cancer_type_code_of_relative","valueType":"string","description":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"examples":"C41.1,C16.9,C00.5,D46.9","dependsOn":"family_history.relative_with_cancer_history","displayName":"Cancer Type Code (ICD-10) of Relative"}},{"description":"Relative's last known state of living or deceased.","name":"relative_vital_status","restrictions":{"codeList":["Alive","Deceased","Unknown"]},"valueType":"string","meta":{"displayName":"Vital Status of Relative"}},{"description":"Indicate the cause of the death of the relative.","name":"cause_of_death_of_relative","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]},"valueType":"string","meta":{"dependsOn":"family_history.relative_vital_status","displayName":"Cause of Death of Relative"}},{"description":"Indicate how long, in days, the relative survived from the time they were diagnosed with cancer.","name":"relative_survival_time","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","units":"days","displayName":"Survival Time Of Relative"}}]},{"name":"biomarker","description":"The collection of data elements describing a donor's biomarker tests. A biomarker is a biological molecule found in blood, other body fluids, or tissues that is indicative of the presence of cancer in the body. Each row should include one or more biomarker test(s) associated with a particular clinical event (submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id field). If the biomarker test is not associated with a particular clinical event, then indicate the time interval at which the biomarker test was performed (test_interval field).","meta":{"parent":"donor"},"fields":[{"name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},{"description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},{"name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},{"name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},{"description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},{"description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},{"description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},{"description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},{"description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},{"description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},{"description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},{"description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},{"description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},{"description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},{"name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},{"description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},{"description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},{"description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},{"description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},{"name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},{"description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},{"description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},{"description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},{"description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},{"description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},{"description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},{"description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},{"description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},{"description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}]},{"name":"comorbidity","description":"The collection of data elements related to a donor's comorbidities. A donor's comorbidities are any medical conditions (e.g diabetes, prior cancer malignancies) that have existed or may occur during the clinical course of the donor who has the index disease under study. To submit multiple comorbidities for a single donor, submit multiple rows in the comorbidity file for this donor.","meta":{"parent":"donor"},"fields":[{"name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},{"name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},{"name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},{"name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},{"name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},{"name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},{"name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}]}],"_id":"66fbc19f8d738c00323e8c30","name":"ICGC-ARGO Data Dictionary","version":"1.24","createdAt":"2024-10-01T09:32:15.397Z","updatedAt":"2024-10-01T09:32:15.397Z","__v":0} diff --git a/scripts/data/schemas/diffs/0.10/0.10-diff-1.24.json b/scripts/data/schemas/diffs/0.10/0.10-diff-1.24.json new file mode 100644 index 00000000..17a0f2a2 --- /dev/null +++ b/scripts/data/schemas/diffs/0.10/0.10-diff-1.24.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"program_id":{"meta":{"examples":{"left":"PACA-AU,BR-CA","right":"TEST-CA"},"notes":{"left":"This is the unique id that is assigned to your program. If you have logged into the platform, this is the Program Id that you see in the Submiission area.","right":"This is the unique id that is assigned to your program. If you have logged into the platform, this is the Program Id that you see in the Program Services area. For example, TEST-CA is a Program ID."}}},"gender":{},"specimen_tissue_source":{},"specimen_type":{"restrictions":{"codeList":{"left":["Normal","Normal - tissue adjacent to primary tumour","Primary tumour","Primary tumour - adjacent to normal","Primary tumour - additional new primary","Recurrent tumour","Metastatic tumour","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour - additional metastatic","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line","Cell line - derived from xenograft tumour","Cell line - derived from tumour","Cell line - derived from normal"],"right":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"],"deleted":[]}},"script":{"left":["(function validate() {\n\n const row = $row;\n let result = {valid: true, message: \"Ok\"};\n \n const designation = row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\"){\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when tumour_normal_designation is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when tumour_normal_designation is set to Tumour.\"};\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"]}}},"sample_type":{}},"created":{},"deleted":{}},"donor":{"updated":{"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased","Unknown"],"right":["Alive","Deceased"],"data":{"added":[],"deleted":["Unknown"]}}}},"cause_of_death":{"restrictions":{"codeList":{"left":["Died of cancer","Died of other reasons"],"right":["Died of cancer","Died of other reasons","Unknown"],"data":{"added":["Unknown"],"deleted":[]}},"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]}}},"survival_time":{"restrictions":{"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"height":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"weight":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"bmi":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"menopause_status":{"description":{"left":"Indicate the donor's menopause status at the time of primary diagnosis. (Codelist reference: NCI CDE ID: 2434914)","right":"Indicate the donor's menopause status at the time of primary diagnosis. (Reference: caDSR CDE ID 2434914)"},"restrictions":{"codeList":{"left":["Premenopausal","Perimenopausal","Postmenopausal","Indeterminate or unknown","Not applicable"],"right":["Not applicable","Perimenopausal","Postmenopausal","Premenopausal","Unknown"],"data":{"added":["Unknown"],"deleted":["Indeterminate or unknown"]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age of menarche, the first occurrence of menstruation.","right":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)"},"restrictions":{}},"number_of_pregnancies":{"description":{"left":"Indicate the number of pregnancies a donor has had.","right":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)"},"restrictions":{}},"number_of_children":{"description":{"left":"Indicate the number of children the donor has birthed.","right":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)"},"restrictions":{}}},"created":{"primary_site":{"changeType":"created","name":"primary_site","valueType":"string","isArray":true,"description":"The text term used to describe the primary site of disease, as categorized by the World Health Organization's (WHO) International Classification of Diseases for Oncology (ICD-O). This categorization groups cases into general categories.","meta":{"displayName":"Primary Site","core":true,"notes":"To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Breast|Ovary"},"restrictions":{"required":true,"codeList":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"]}},"genetic_disorders":{"changeType":"created","description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},"hrt_type":{"changeType":"created","description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},"hrt_duration":{"changeType":"created","description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},"contraception_type":{"changeType":"created","description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},"contraception_duration":{"changeType":"created","description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},"lost_to_followup_after_clinical_event_id":{"changeType":"created","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}},"deleted":{"prior_malignancy":{"changeType":"deleted","description":"Prior malignancy affecting donor.","name":"prior_malignancy","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"cancer_type_prior_malignancy":{"changeType":"deleted","description":"ICD-10 diagnostic code for type of cancer in a prior malignancy.","name":"cancer_type_prior_malignancy","restrictions":{"regex":"[A-Z]{1}[0-9]{2}.[0-9]{0,3}[A-Z]{0,1}$"},"valueType":"string","meta":{"displayName":"Cancer Type Prior Malignancy"}},"age_at_prior_malignancy":{"changeType":"deleted","description":"If donor has history of prior malignancy, indicate age at previous diagnosis, in years.","name":"age_at_prior_malignancy","valueType":"integer"},"laterality_of_prior_malignancy":{"changeType":"deleted","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis.","name":"laterality_of_prior_malignancy","valueType":"string","meta":{"displayName":"Age at Prior Malignancy"}}}},"specimen":{"updated":{"pathological_tumour_staging_system":{"meta":{"validationDependency":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(\n field =>\n Object.keys(convertedRow).includes(field) &&\n (!convertedRow[field] || checkforEmpty(convertedRow[field])),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"deleted":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"]}}}},"pathological_t_category":{"restrictions":{}},"pathological_n_category":{"restrictions":{}},"pathological_m_category":{"restrictions":{}},"pathological_stage_group":{"description":{"left":"Specify the tumour stage, based on tumour_staging_system, used to assess the cancer at the time the tumour specimen was resected.","right":"Specify the tumour stage, based on pathological_tumour_staging_system, used to assess the cancer at the time the tumour specimen was resected."},"meta":{"notes":{"left":"This field depends on the selected pathological staging system, and is only required if the specimen is a tumour.","right":"This field depends on the selected pathological_tumour_staging_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications"}},"restrictions":{}},"specimen_acquisition_interval":{"meta":{"displayName":{"left":"Specimen Aquisition Interval","right":"Specimen Acquisition Interval"},"notes":{"left":null,"right":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"restrictions":{"notes":{"left":"The associated Primary Diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":null}}},"tumour_histological_type":{"description":{"left":"The code to represent the histology (morphology) of neoplasms that is usually obtained from a pathology report, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Please refer to the guidelines provided in the ICD-O-3 manual at https://apps.who.int/iris/handle/10665/42344.","right":"The code to represent the histology (morphology) of neoplasms that is usually obtained from a pathology report, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344."},"meta":{"validationDependency":{"left":null,"right":true}}},"specimen_anatomic_location":{"description":{"left":"Anatomic location of a specimen when it was collected.","right":"Indicate the ICD-O-3 topography code for the anatomic location of a specimen when it was collected. Refer to the guidelines provided in the ICD-O-3 manual at https://apps.who.int/iris/handle/10665/42344."},"meta":{"examples":{"left":null,"right":"C50.1,C18"}},"restrictions":{"codeList":{"left":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear, pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal; distal","Esophageal; mid","Esophageal; proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck, NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es), maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"],"data":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear, pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal; distal","Esophageal; mid","Esophageal; proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck, NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es), maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"]},"regex":{"left":null,"right":"^[C][0-9]{2}(.[0-9]{1})?$"}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation, other","Formalin fixed & paraffin embedded","Formalin fixed, buffered","Formalin fixed, unbuffered","Fresh","Other"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"data":{"added":["Cryopreservation - other","Formalin fixed - buffered","Formalin fixed - unbuffered","Unknown"],"deleted":["Cryopreservation, other","Formalin fixed, buffered","Formalin fixed, unbuffered"]}}}},"specimen_storage":{"description":{"left":"Indicate the method of specimen storage for specimens that were not extracted freshly or immediately cultured.","right":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured."},"restrictions":{"codeList":{"left":["Cut slide","Frozen, -70 freezer","Frozen, liquid nitrogen","Frozen, vapor phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"data":{"added":["Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Unknown"],"deleted":["Frozen, -70 freezer","Frozen, liquid nitrogen","Frozen, vapor phase"]}}}},"tumour_grading_system":{"meta":{"validationDependency":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["Default","Gleason","Nottingham","Brain cancer","ISUP","Lymphoid neoplasms"],"right":["FNCLCC grading system","Four-tier grading system","Gleason grade group system","Grading system for GISTs","Grading system for GNETs","ISUP grading system","Nuclear grading system for DCIS","Scarff-Bloom-Richardson grading system","Three-tier grading system","Two-tier grading system","WHO grading system for CNS tumours"],"data":{"added":["FNCLCC grading system","Four-tier grading system","Gleason grade group system","Grading system for GISTs","Grading system for GNETs","ISUP grading system","Nuclear grading system for DCIS","Scarff-Bloom-Richardson grading system","Three-tier grading system","Two-tier grading system","WHO grading system for CNS tumours"],"deleted":["Default","Gleason","Nottingham","Brain cancer","ISUP","Lymphoid neoplasms"]}}}},"tumour_grade":{"meta":{"notes":{"left":"This field depends on the selected tumour grading system, and is only required if the specimen is a tumour.","right":"This field depends on the selected tumour_grading_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Grading Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-grading-classifications"}},"restrictions":{"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'default':\n codeList = [\n 'gx - cannot be assessed',\n 'g1 well differentiated/low grade',\n 'g2 moderately differentiated/intermediated grade',\n 'g3 poorly differentiated/high grade',\n 'g4 undifferentiated/high grade',\n ];\n break;\n case 'gleason':\n codeList = [\n 'gleason x: gleason score cannot be determined',\n 'gleason 2–6: the tumor tissue is well differentiated',\n 'gleason 7: the tumor tissue is moderately differentiated',\n 'gleason 8–10: the tumor tissue is poorly differentiated or undifferentiated',\n ];\n break;\n case 'nottingham':\n codeList = [\n 'g1 (low grade or well differentiated)',\n 'g2 (intermediate grade or moderately differentiated)',\n 'g3 (high grade or poorly differentiated)',\n ];\n break;\n case 'brain cancer':\n codeList = ['grade i', 'grade ii', 'grade iii', 'grade iv'];\n break;\n case 'isup for renal cell carcinoma':\n codeList = [\n 'grade 1: tumor cell nucleoli invisible or small and basophilic at 400 x magnification',\n 'grade 2: tumor cell nucleoli conspicuous at 400 x magnification but inconspicuous at 100 x magnification',\n 'grade 3: tumor cell nucleoli eosinophilic and clearly visible at 100 x magnification',\n 'grade 4: tumors showing extreme nuclear pleomorphism and/or containing tumor giant cells and/or the presence of any proportion of tumor showing sarcomatoid and/or rhabdoid dedifferentiation',\n ];\n break;\n case 'lymphoid neoplasms':\n codeList = ['low grade or indolent nhl', 'high grade or aggressive nhl'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]},"codeList":{"right":["Low grade","High grade","GX","G1","G2","G3","G4","Low","High","Grade I","Grade II","Grade III","Grade IV","Grade Group 1","Grade Group 2","Grade Group 3","Grade Group 4","Grade Group 5"],"data":["Low grade","High grade","GX","G1","G2","G3","G4","Low","High","Grade I","Grade II","Grade III","Grade IV","Grade Group 1","Grade Group 2","Grade Group 3","Grade Group 4","Grade Group 5"]}}},"percent_tumour_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of infiltration by tumour cells in a specimen.","right":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)"},"restrictions":{}},"percent_proliferating_cells":{"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_inflammatory_tissue":{"description":{"left":"Indicate a value, in decimals, that represents local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue.","right":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_stromal_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a malignant tumour specimen but are not malignant such as fibroblasts, vascular structures, etc.","right":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_necrosis":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of cell death in a malignant tumour specimen.","right":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}}},"created":{"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate the primary diagnosis event in the clinical timeline that this specimen acquisition was related to.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"specimen_laterality":{"changeType":"created","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"reference_pathology_confirmed":{"changeType":"created","name":"reference_pathology_confirmed","description":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)","valueType":"string","meta":{"validationDependency":true,"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Reference Pathology Confirmed"},"restrictions":{"codeList":["Yes","No","Unknown"]}},"percent_tumour_cells_measurement_method":{"changeType":"created","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}},"deleted":{"central_pathology_confirmed":{"changeType":"deleted","name":"central_pathology_confirmed","description":"Indicate whether the histologic description of tissue or cells was confirmed by a pathology review of frozen or formalin fixed slide(s) completed after the diagnostic pathology review of the tumour sample used to extract analyte(s).","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Central Pathology Confirmed"},"restrictions":{"codeList":["Yes","No","Unknown"]}}}},"primary_diagnosis":{"updated":{"age_at_diagnosis":{"description":{"left":"Age that the donor was first diagnosed with cancer, in years.","right":"Age that the donor was first diagnosed with cancer, in years. This should be based on the earliest diagnosis of cancer."},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0,"max":90}}}},"cancer_type_code":{"meta":{"examples":{"left":"C41.1,C16.9,C00.543A","right":"C41.1,C16.9,C00.5,D46.9"}},"restrictions":{"regex":{"left":"^[C][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","right":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"}}},"basis_of_diagnosis":{},"number_lymph_nodes_positive":{"description":{"left":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: NCI CDE ID: 6113694)","right":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: caDSR CDE ID 6113694)"},"meta":{"dependsOn":{"left":null,"right":"primary_diagnosis.lymph_nodes_examined_status"},"notes":{"left":null,"right":"This field is only required if 'lymph_nodes_examined_status' is 'Yes'."}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"]},"range":{"left":null,"right":{"min":0}}}},"number_lymph_nodes_examined":{"description":{"left":"The total number of lymph nodes tested for the presence of cancer. (Reference: NCI CDE ID: 3)","right":"The total number of lymph nodes tested for the presence of cancer. (Reference: caDSR CDE ID 3)"},"meta":{"dependsOn":{"left":null,"right":"primary_diagnosis.lymph_nodes_examined_status"},"notes":{"left":null,"right":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'."}},"restrictions":{}},"clinical_tumour_staging_system":{"meta":{"validationDependency":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(\n field =>\n Object.keys(convertedRow).includes(field) &&\n (!convertedRow[field] || checkforEmpty(convertedRow[field])),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"required":{"left":true,"right":null},"codeList":{"left":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"deleted":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"]}}}},"clinical_stage_group":{"description":{"left":"Stage group of the tumour, as assigned by the reporting tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.).","right":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage."},"meta":{"notes":{"left":null,"right":"This field is dependent on the selected clinical_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications"},"examples":{"left":null,"right":"Stage I, Stage IIB"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"clinical_t_category":{"restrictions":{}},"clinical_n_category":{"description":{"left":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"restrictions":{}},"clinical_m_category":{"description":{"left":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned.","right":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned."},"restrictions":{}},"presenting_symptoms":{"meta":{"notes":{"left":null,"right":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"examples":{"left":null,"right":"Anemia|Bloating|Diabetes"}},"restrictions":{"codeList":{"left":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Nausea","None","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Unknown","Vomiting","Weight Loss"],"right":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Loss of Appetite","Nausea","None","Not Reported","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Swelling in the Neck","Unknown","Vomiting","Weight Loss"],"data":{"added":["Loss of Appetite","Not Reported","Swelling in the Neck"],"deleted":[]}}}},"performance_status":{"description":{"left":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference source: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status).","right":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status)."},"meta":{"notes":{"left":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction \n Grade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work) \n Grade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours \n Grade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours \n Grade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair","right":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction.\nGrade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work).\nGrade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours.\nGrade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours.\nGrade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair"}},"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}}},"created":{"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Unique identifier of the primary diagnosis event, assigned by the data provider.","meta":{"primaryId":true,"displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"cancer_type_additional_information":{"changeType":"created","name":"cancer_type_additional_information","valueType":"string","description":"Additional details related to the cancer type that are not covered by the ICD-10 code provided in the cancer_type field.","meta":{"displayName":"Cancer Type Additional Information"}},"laterality":{"changeType":"created","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_status":{"changeType":"created","name":"lymph_nodes_examined_status","description":"Indicate if lymph nodes were examined for metastases.","valueType":"string","restrictions":{"required":true,"codeList":["Cannot be determined","No","No lymph nodes found in resected specimen","Not applicable","Yes"]},"meta":{"core":true,"displayName":"Lymph Nodes Examined Status"}},"lymph_nodes_examined_method":{"changeType":"created","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}},"deleted":{"stage_suffix":{"changeType":"deleted","name":"stage_suffix","description":"If necessary, use this field to add any applicable stage suffixes. Stage suffixes may apply to certain staging systems such as Ann Arbour staging system where the four stages are divided into 4 categories (A, B, X and E).","valueType":"string","meta":{"core":true,"dependsOn":"primary_diagnosis.clinical_tumour_staging_system","displayName":"Stage Suffix"}}}},"treatment":{"updated":{"treatment_type":{"meta":{"notes":{"left":"Depending on the treatment_type selected, additional treament details may be required to be submitted.","right":"Depending on the treatment_type(s) selected, additional treatment details may be required to be submitted. For example, if treatment_type includes 'Chemotherapy', the supplemental Chemotherapy treatment type file is required.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."},"examples":{"left":null,"right":"Chemotherapy|Hormonal therapy"}},"restrictions":{"codeList":{"left":["Chemotherapy","Ablation","Bone marrow transplant","Combined chemo+immunotherapy","Combined chemo+radiation therapy","Combined chemo-radiotherapy and surgery","Endoscopic therapy","Hormonal therapy","Immunotherapy","Monoclonal antibodies (for liquid tumours)","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgical resection"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":["End of life care","Surgery"],"deleted":["Combined chemo+immunotherapy","Combined chemo+radiation therapy","Combined chemo-radiotherapy and surgery","Monoclonal antibodies (for liquid tumours)","Surgical resection"]}}}},"is_primary_treatment":{"description":{"left":"Indicate if the treamtment was the primary treatment following the initial diagnosis.","right":"Indicate if the treatment was the primary treatment following the initial diagnosis."},"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Yes","No","Unknown"],"right":["Yes","No"],"data":{"added":[],"deleted":["Unknown"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_start_interval":{"description":{"left":"The interval between primary diagnosis and initiation of treatment, in days.","right":"The interval between the primary diagnosis and initiation of treatment, in days."},"meta":{"notes":{"left":"The associated Primary Diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis","right":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."},"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_duration":{"description":{"left":"The duration of treatment regimen, in days","right":"The duration of treatment regimen, in days."},"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}}},"created":{"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate the primary diagnosis event in the clinical timeline that this treatment was related to.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"line_of_treatment":{"changeType":"created","name":"line_of_treatment","description":"Indicate the line of treatment if it is not the primary treatment.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Line Of treatment","dependsOn":"treatment.is_primary_treatment","examples":"2,3,4"}},"days_per_cycle":{"changeType":"created","name":"days_per_cycle","description":"Indicate the number of days in a treatment cycle.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Days Per Cycle","dependsOn":"treatment.treatment_type"}},"number_of_cycles":{"changeType":"created","name":"number_of_cycles","description":"Indicate the number of treatment cycles.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Number Of Cycles","dependsOn":"treatment.treatment_type"}},"treatment_intent":{"changeType":"created","name":"treatment_intent","description":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"]},"meta":{"core":true,"displayName":"Treatment Intent","dependsOn":"treatment.treatment_type"}},"treatment_setting":{"changeType":"created","name":"treatment_setting","description":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: NCIt C124308)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"]},"meta":{"core":true,"displayName":"Treatment Setting","dependsOn":"treatment.treatment_type"}},"response_to_treatment_criteria_method":{"changeType":"created","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},"response_to_treatment":{"changeType":"created","name":"response_to_treatment","description":"The donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"codeList":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"]},"meta":{"core":true,"displayName":"Response To Treatment","dependsOn":"treatment.response_to_treatment_criteria_method","notes":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"outcome_of_treatment":{"changeType":"created","name":"outcome_of_treatment","description":"Indicate the donor's outcome of the prescribed treatment.","valueType":"string","restrictions":{"codeList":["Treatment completed as prescribed","Treatment incomplete due to technical or organizational problems","Treatment incomplete because patient died","Patient choice (stopped or interrupted treatment)","Physician decision (stopped or interrupted treatment)","Treatment stopped due to lack of efficacy (disease progression)","Treatment stopped due to acute toxicity","Other","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Outcome Of Treatment","dependsOn":"treatment.treatment_type"}},"toxicity_type":{"changeType":"created","name":"toxicity_type","description":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity.","valueType":"string","restrictions":{"codeList":["Hematological","Non-hematological","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Toxicity Type","dependsOn":"treatment.outcome_of_treatment"}},"hematological_toxicity":{"changeType":"created","name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"non-hematological_toxicity":{"changeType":"created","name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"adverse_events":{"changeType":"created","name":"adverse_events","description":"Report any treatment related adverse events. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Adverse Events","dependsOn":"treatment.treatment_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"clinical_trials_database":{"changeType":"created","name":"clinical_trials_database","description":"If the donor is a participant in a clinical trial, indicate the clinical trial database where the clinical trial is registered.","valueType":"string","meta":{"display name":"Clinical Trials Database","notes":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added."},"restrictions":{"codeList":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"]}},"clinical_trial_number":{"changeType":"created","name":"clinical_trial_number","description":"Based on the clinical_trial_database, indicate the unique NCT or EudraCT clinical trial identifier of which the donor is a participant.","valueType":"string","meta":{"display name":"Clinical Trial Number","dependsOn":"treatment.clinical_trials_database","examples":"2016-002120-83,NCT02465060"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"]}}},"deleted":{"age_at_consent_for_treatment":{"changeType":"deleted","name":"age_at_consent_for_treatment","description":"Indicate the age of donor when consent was given for treatment.","valueType":"integer","meta":{"displayName":"Age At Consent For Treatment"}},"therapeutic_intent":{"changeType":"deleted","name":"therapeutic_intent","description":"The therapeutic intent, the reason behind the choice of a therapy, of the treatment.","valueType":"string","restrictions":{"required":true,"codeList":["Adjuvant","Concurrent","Curative","Neoadjuvant","Not applicable","Palliative","Unknown"]},"meta":{"core":true,"displayName":"Therapeutic Intent"}},"response_to_therapy":{"changeType":"deleted","name":"response_to_therapy","description":"The donors's response to the applied treatment regimen. (Source: RECIST)","valueType":"string","restrictions":{"required":true,"codeList":["Complete response","Disease progression","NED","Partial response","Stable disease"]},"meta":{"core":true,"displayName":"Response to Therapy"}}}},"chemotherapy":{"updated":{},"created":{"drug_rxnormcui":{"changeType":"created","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"created","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"created","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"created","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"created","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"created","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}},"deleted":{"chemotherapy_drug_name":{"changeType":"deleted","name":"chemotherapy_drug_name","description":"Name of agent or drug administered to patient as part of the chemotherapy treatment regimen.","valueType":"string","restrictions":{"required":true,"codeList":["Placeholder list 1","Need list","Still need it"]},"meta":{"validationDependency":true,"core":true,"notes":"This field uses a controlled vocabulary gathered from the DrugBank database of drug names.","examples":"Allopurinol, Dronabinol, Sucralfate, Lapatinib","displayName":"Chemotherapy Drug Name"}},"chemotherapy_dosage_units":{"changeType":"deleted","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","µg/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate the total drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"integer","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"hormone_therapy":{"updated":{},"created":{"drug_rxnormcui":{"changeType":"created","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"created","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Hormone Therapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"created","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{"hormone_therapy_drug_name":{"changeType":"deleted","name":"hormone_therapy_drug_name","description":"Name of agent or drug administered to patient as part of the hormone therapy treatment regimen.","valueType":"string","restrictions":{"required":true,"codeList":["Placeholder list 1","Need list","Still need it"]},"meta":{"validationDependency":true,"core":true,"notes":"This field uses a controlled vocabulary gathered from the DrugBank database of drug names.","displayName":"Hormone Therapy Drug Name"}},"hormone_drug_dosage_units":{"changeType":"deleted","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","µg/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"integer","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dose"}}}},"radiation":{"updated":{"radiation_therapy_fractions":{"description":{"left":"Indicate the number of total fractions delivered as part of treatment.","right":"Indicate the total number of fractions delivered as part of treatment."},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"radiation_therapy_dosage":{"valueType":{"left":"integer","right":"number"},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"anatomical_site_irradiated":{"description":{"left":"Indicate localization site where radiation therapy was administered.","right":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)"},"restrictions":{"codeList":{"left":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"right":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"data":{"added":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"],"deleted":["Bone","Extremities","Head-Neck","Peritoneum"]}}}}},"created":{"radiation_therapy_type":{"changeType":"created","name":"radiation_therapy_type","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal"]},"meta":{"core":true,"displayName":"Type of Radiation Therapy","notes":"Internal application includes Brachytherapy."}},"radiation_boost":{"changeType":"created","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"created","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}},"deleted":{"application_form":{"changeType":"deleted","name":"application_form","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal (including Brachytherapy)"]},"meta":{"core":true,"displayName":"Application Form"}}}},"follow_up":{"updated":{"submitter_follow_up_id":{"description":{"left":"Unique identifier for a follow-up event in a donors clincal record, assigned by the data provider.","right":"Unique identifier for a follow-up event in a donor's clinical record, assigned by the data provider."}},"interval_of_followup":{"meta":{"notes":{"left":"The associated Primary Diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}}},"disease_status_at_followup":{"description":{"left":"Indicate the donor's disease status at time of follow-up.","right":"Indicate the donor's disease status at time of follow-up. (Reference: RECIST)"},"restrictions":{"codeList":{"left":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Relapse","Stable"],"right":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Progression NOS","Relapse or recurrence","Stable"],"data":{"added":["Progression NOS","Relapse or recurrence"],"deleted":["Relapse"]}}}},"weight_at_followup":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"relapse_type":{"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}},"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"relapse_interval":{"description":{"left":"If the donor was clinically disease free following primary treatment and then relapse or progression (for liquid tumours) occurred afterwards, then this field will indicate the length of disease free interval, in days.","right":"If the donor was clinically disease free following primary treatment and then relapse or recurrence or progression (for liquid tumours) occurred afterwards, then this field will indicate the length of disease free interval, in days."},"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a progression or relapse value.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}},"restrictions":{"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"]}}},"method_of_progression_status":{"description":{"left":"Indicate the method(s) used to confirm the donor's progression disease status. (Codelist reference: NCI CDE ID: 6161031)","right":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Reference: caDSR CDE ID 6161031)"},"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}},"restrictions":{"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]},"codeList":{"left":["Autopsy","Biomarker in liquid biopsy (e.g. tumour marker in blood or urine)","Biopsy","Blood draw","Bone marrow aspirate","Core biopsy","Cystoscopy","Cytology","Debulking","Diagnostic imaging","Dilation and curettage procedure","Enucleation","Excisional biopsy","Fine needle aspiration","Imaging","Incisional biopsy","Laparoscopy","Laparotomy","Other","Pap Smear","Pathologic review","Physical exam","Surgical resection","Thoracentesis","Ultrasound guided biopsy"],"right":["Biomarker in liquid biopsy (e.g. tumour marker in blood or urine)","Biopsy","Blood draw","Bone marrow aspirate","Core biopsy","Cystoscopy","Cytology","Debulking","Diagnostic imaging","Dilation and curettage procedure","Enucleation","Excisional biopsy","Fine needle aspiration","Imaging","Incisional biopsy","Laparoscopy","Laparotomy","Other","Pap Smear","Pathologic review","Physical exam","Surgical resection","Thoracentesis","Ultrasound guided biopsy"],"data":{"added":[],"deleted":["Autopsy"]}}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}},"restrictions":{"codeList":{"left":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"deleted":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"]}},"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(\n field =>\n Object.keys(convertedRow).includes(field) &&\n (!convertedRow[field] || checkforEmpty(convertedRow[field])),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_t_category":{"description":{"left":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":true,"right":null}},"restrictions":{}},"recurrence_n_category":{"description":{"left":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":true,"right":null}},"restrictions":{}},"recurrence_m_category":{"description":{"left":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":true,"right":null}},"restrictions":{}},"recurrence_stage_group":{"description":{"left":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery.","right":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) at the time of retreatment for a recurrence or disease progression."},"meta":{"core":{"left":true,"right":null},"notes":{"left":null,"right":"This field is dependent on the selected recurrence_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications"}},"restrictions":{}},"posttherapy_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(\n field =>\n Object.keys(convertedRow).includes(field) &&\n (!convertedRow[field] || checkforEmpty(convertedRow[field])),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"deleted":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"]}}}},"posttherapy_t_category":{"meta":{"dependsOn":{"left":"follow_up.post_therapy_tumour_staging_system","right":"follow_up.posttherapy_tumour_staging_system"}},"restrictions":{}},"posttherapy_n_category":{"description":{"left":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"dependsOn":{"left":"follow_up.post_therapy_tumour_staging_system","right":"follow_up.posttherapy_tumour_staging_system"}},"restrictions":{}},"posttherapy_m_category":{"description":{"left":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"dependsOn":{"left":"follow_up.post_therapy_tumour_staging_system","right":"follow_up.posttherapy_tumour_staging_system"}},"restrictions":{}},"posttherapy_stage_group":{"meta":{"dependsOn":{"left":"follow_up.post_therapy_tumour_staging_system","right":"follow_up.posttherapy_tumour_staging_system"},"notes":{"left":"This field value is dependent on the selected posttherapy_tumour_staging_system.","right":"This field is dependent on the selected posttherapy_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications"}},"restrictions":{}}},"created":{"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate if the follow-up is related to a specific primary diagnosis event in the clinical timeline.","meta":{"validationDependency":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID","primaryId":true},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"Indicate if the follow-up is related to a specific treatment event in the clinical timeline.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"anatomic_site_progression_or_recurrence":{"changeType":"created","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"anatomic_site_progression_or_recurrences":{"changeType":"deleted","description":"Indicate the anatomic site where disease progression or recurrence occurred. (Codelist reference: NCI CDE ID: 4742851)","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"],"codeList":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear, pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal; distal","Esophageal; mid","Esophageal; proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck, NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es), maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"]},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","notes":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse.","displayName":"Anatomic Site Progression or Recurrences"}}}},"immunotherapy":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"immunotherapy_type":{"changeType":"created","name":"immunotherapy_type","valueType":"string","description":"Indicate the type of immunotherapy administered to donor.","meta":{"displayName":"Immunotherapy Type","core":true},"restrictions":{"required":true,"codeList":["Cell-based","Immune checkpoint inhibitors","Monoclonal antibodies other than immune checkpoint inhibitors","Other immunomodulatory substances"]}},"drug_rxnormcui":{"changeType":"created","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"created","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"created","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{}},"surgery":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"created","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"created","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"created","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"created","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"created","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"created","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"created","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"created","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"created","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"created","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"created","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"created","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"created","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"created","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}},"deleted":{}},"exposure":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"created","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"created","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"created","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"created","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"created","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"created","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"created","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"created","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"created","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"created","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"created","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"created","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"created","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}},"deleted":{}},"family_history":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"family_relative_id":{"changeType":"created","description":"Unique identifier of the relative, assigned by the data provider.","name":"family_relative_id","valueType":"string","meta":{"displayName":"Family Relative ID","primaryId":true,"notes":"This field is required to ensure that family members are identified in unique records. Ids can be as simple as an incremented numeral to ensure uniqueness."},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"relative_with_cancer_history":{"changeType":"created","description":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","name":"relative_with_cancer_history","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Relative with Cancer History"}},"relationship_type":{"changeType":"created","description":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","name":"relationship_type","restrictions":{"codeList":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"]},"valueType":"string","meta":{"displayName":"Relationship Type"}},"gender_of_relative":{"changeType":"created","description":"The self-reported gender of related individual.","name":"gender_of_relative","restrictions":{"codeList":["Female","Male","Other","Unknown"]},"valueType":"string","meta":{"displayName":"Gender of Relative"}},"age_of_relative_at_diagnosis":{"changeType":"created","description":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","name":"age_of_relative_at_diagnosis","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","displayName":"Age Of Relative At Diagnosis"}},"cancer_type_code_of_relative":{"changeType":"created","name":"cancer_type_code_of_relative","valueType":"string","description":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"examples":"C41.1,C16.9,C00.5,D46.9","dependsOn":"family_history.relative_with_cancer_history","displayName":"Cancer Type Code (ICD-10) of Relative"}},"relative_vital_status":{"changeType":"created","description":"Relative's last known state of living or deceased.","name":"relative_vital_status","restrictions":{"codeList":["Alive","Deceased","Unknown"]},"valueType":"string","meta":{"displayName":"Vital Status of Relative"}},"cause_of_death_of_relative":{"changeType":"created","description":"Indicate the cause of the death of the relative.","name":"cause_of_death_of_relative","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]},"valueType":"string","meta":{"dependsOn":"family_history.relative_vital_status","displayName":"Cause of Death of Relative"}},"relative_survival_time":{"changeType":"created","description":"Indicate how long, in days, the relative survived from the time they were diagnosed with cancer.","name":"relative_survival_time","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","units":"days","displayName":"Survival Time Of Relative"}}},"deleted":{}},"biomarker":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"created","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"created","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"created","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"created","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"created","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"created","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"created","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"created","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"created","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"created","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"created","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"created","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"created","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"created","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"created","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"created","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"created","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"created","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"created","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}},"deleted":{}},"comorbidity":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"created","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"created","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"created","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"created","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"created","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"created","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}},"deleted":{}}}} diff --git a/scripts/data/schemas/diffs/0.11/0.11-diff-1.24.json b/scripts/data/schemas/diffs/0.11/0.11-diff-1.24.json new file mode 100644 index 00000000..ac327ea2 --- /dev/null +++ b/scripts/data/schemas/diffs/0.11/0.11-diff-1.24.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"program_id":{"meta":{"examples":{"left":"PACA-AU,BR-CA","right":"TEST-CA"},"notes":{"left":"This is the unique id that is assigned to your program. If you have logged into the platform, this is the Program Id that you see in the Submiission area.","right":"This is the unique id that is assigned to your program. If you have logged into the platform, this is the Program Id that you see in the Program Services area. For example, TEST-CA is a Program ID."}}},"gender":{},"specimen_tissue_source":{},"specimen_type":{"restrictions":{"codeList":{"left":["Normal","Normal - tissue adjacent to primary tumour","Primary tumour","Primary tumour - adjacent to normal","Primary tumour - additional new primary","Recurrent tumour","Metastatic tumour","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour - additional metastatic","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line","Cell line - derived from xenograft tumour","Cell line - derived from tumour","Cell line - derived from normal"],"right":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"],"deleted":[]}},"script":{"left":["(function validate() {\n\n const row = $row;\n let result = {valid: true, message: \"Ok\"};\n \n const designation = row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\"){\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when tumour_normal_designation is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when tumour_normal_designation is set to Tumour.\"};\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"]}}},"sample_type":{}},"created":{},"deleted":{}},"donor":{"updated":{"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased","Unknown"],"right":["Alive","Deceased"],"data":{"added":[],"deleted":["Unknown"]}}}},"cause_of_death":{"restrictions":{"codeList":{"left":["Died of cancer","Died of other reasons"],"right":["Died of cancer","Died of other reasons","Unknown"],"data":{"added":["Unknown"],"deleted":[]}},"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]}}},"survival_time":{"restrictions":{"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"primary_site":{"meta":{"notes":{"left":null,"right":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"examples":{"left":null,"right":"Breast|Ovary"}},"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva","Unknown","Not Reported"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"data":{"added":["Unknown primary site"],"deleted":["Unknown","Not Reported"]}}}},"height":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"weight":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"bmi":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"menopause_status":{"description":{"left":"Indicate the donor's menopause status at the time of primary diagnosis. (Codelist reference: NCI CDE ID: 2434914)","right":"Indicate the donor's menopause status at the time of primary diagnosis. (Reference: caDSR CDE ID 2434914)"},"restrictions":{"codeList":{"left":["Indeterminate or unknown","Not applicable","Perimenopausal","Postmenopausal","Premenopausal"],"right":["Not applicable","Perimenopausal","Postmenopausal","Premenopausal","Unknown"],"data":{"added":["Unknown"],"deleted":["Indeterminate or unknown"]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age of menarche, the first occurrence of menstruation.","right":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)"},"restrictions":{}},"number_of_pregnancies":{"description":{"left":"Indicate the number of pregnancies a donor has had.","right":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)"},"restrictions":{}},"number_of_children":{"description":{"left":"Indicate the number of children the donor has birthed.","right":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)"},"restrictions":{}}},"created":{"genetic_disorders":{"changeType":"created","description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},"hrt_type":{"changeType":"created","description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},"hrt_duration":{"changeType":"created","description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},"contraception_type":{"changeType":"created","description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},"contraception_duration":{"changeType":"created","description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},"lost_to_followup_after_clinical_event_id":{"changeType":"created","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}},"deleted":{"prior_malignancy":{"changeType":"deleted","description":"Prior malignancy affecting donor.","name":"prior_malignancy","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"cancer_type_prior_malignancy":{"changeType":"deleted","description":"The ICD-10 diagnostic code (https://icd.who.int/browse10/2019/en) for the type of cancer in a prior malignancy.","name":"cancer_type_prior_malignancy","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"valueType":"string","meta":{"displayName":"Cancer Type Prior Malignancy"}},"age_at_prior_malignancy":{"changeType":"deleted","description":"If donor has history of prior malignancy, indicate age at previous diagnosis, in years.","name":"age_at_prior_malignancy","valueType":"integer","meta":{"displayName":"Age at Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"deleted","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis.","name":"laterality_of_prior_malignancy","valueType":"string","meta":{"displayName":"Laterality at Prior Malignancy"}}}},"specimen":{"updated":{"pathological_tumour_staging_system":{"meta":{"validationDependency":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(\n field =>\n Object.keys(convertedRow).includes(field) &&\n (!convertedRow[field] || checkforEmpty(convertedRow[field])),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"deleted":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"]}}}},"pathological_t_category":{"restrictions":{}},"pathological_n_category":{"restrictions":{}},"pathological_m_category":{"restrictions":{}},"pathological_stage_group":{"description":{"left":"Specify the tumour stage, based on tumour_staging_system, used to assess the cancer at the time the tumour specimen was resected.","right":"Specify the tumour stage, based on pathological_tumour_staging_system, used to assess the cancer at the time the tumour specimen was resected."},"meta":{"notes":{"left":"This field depends on the selected pathological staging system, and is only required if the specimen is a tumour.","right":"This field depends on the selected pathological_tumour_staging_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications"}},"restrictions":{}},"specimen_acquisition_interval":{"meta":{"notes":{"left":"The associated Primary Diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."},"displayName":{"left":"Specimen Aquisition Interval","right":"Specimen Acquisition Interval"}}},"tumour_histological_type":{"description":{"left":"The code to represent the histology (morphology) of neoplasms that is usually obtained from a pathology report, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Please refer to the guidelines provided in the ICD-O-3 manual at https://apps.who.int/iris/handle/10665/42344.","right":"The code to represent the histology (morphology) of neoplasms that is usually obtained from a pathology report, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344."},"meta":{"validationDependency":{"left":null,"right":true}}},"specimen_anatomic_location":{"description":{"left":"Anatomic location of a specimen when it was collected.","right":"Indicate the ICD-O-3 topography code for the anatomic location of a specimen when it was collected. Refer to the guidelines provided in the ICD-O-3 manual at https://apps.who.int/iris/handle/10665/42344."},"meta":{"examples":{"left":null,"right":"C50.1,C18"}},"restrictions":{"codeList":{"left":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear - pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal - distal","Esophageal - mid","Esophageal - proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es) - maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"],"data":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear - pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal - distal","Esophageal - mid","Esophageal - proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es) - maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"]},"regex":{"left":null,"right":"^[C][0-9]{2}(.[0-9]{1})?$"}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"specimen_storage":{"description":{"left":"Indicate the method of specimen storage for specimens that were not extracted freshly or immediately cultured.","right":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured."},"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"tumour_grading_system":{"meta":{"validationDependency":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["Default","Gleason","Nottingham","Brain cancer","ISUP","Lymphoid neoplasms"],"right":["FNCLCC grading system","Four-tier grading system","Gleason grade group system","Grading system for GISTs","Grading system for GNETs","ISUP grading system","Nuclear grading system for DCIS","Scarff-Bloom-Richardson grading system","Three-tier grading system","Two-tier grading system","WHO grading system for CNS tumours"],"data":{"added":["FNCLCC grading system","Four-tier grading system","Gleason grade group system","Grading system for GISTs","Grading system for GNETs","ISUP grading system","Nuclear grading system for DCIS","Scarff-Bloom-Richardson grading system","Three-tier grading system","Two-tier grading system","WHO grading system for CNS tumours"],"deleted":["Default","Gleason","Nottingham","Brain cancer","ISUP","Lymphoid neoplasms"]}}}},"tumour_grade":{"meta":{"notes":{"left":"This field depends on the selected tumour grading system, and is only required if the specimen is a tumour.","right":"This field depends on the selected tumour_grading_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Grading Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-grading-classifications"}},"restrictions":{"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'default':\n codeList = [\n 'gx - cannot be assessed',\n 'g1 well differentiated/low grade',\n 'g2 moderately differentiated/intermediated grade',\n 'g3 poorly differentiated/high grade',\n 'g4 undifferentiated/high grade',\n ];\n break;\n case 'gleason':\n codeList = [\n 'gleason x: gleason score cannot be determined',\n 'gleason 2–6: the tumor tissue is well differentiated',\n 'gleason 7: the tumor tissue is moderately differentiated',\n 'gleason 8–10: the tumor tissue is poorly differentiated or undifferentiated',\n ];\n break;\n case 'nottingham':\n codeList = [\n 'g1 (low grade or well differentiated)',\n 'g2 (intermediate grade or moderately differentiated)',\n 'g3 (high grade or poorly differentiated)',\n ];\n break;\n case 'brain cancer':\n codeList = ['grade i', 'grade ii', 'grade iii', 'grade iv'];\n break;\n case 'isup for renal cell carcinoma':\n codeList = [\n 'grade 1: tumor cell nucleoli invisible or small and basophilic at 400 x magnification',\n 'grade 2: tumor cell nucleoli conspicuous at 400 x magnification but inconspicuous at 100 x magnification',\n 'grade 3: tumor cell nucleoli eosinophilic and clearly visible at 100 x magnification',\n 'grade 4: tumors showing extreme nuclear pleomorphism and/or containing tumor giant cells and/or the presence of any proportion of tumor showing sarcomatoid and/or rhabdoid dedifferentiation',\n ];\n break;\n case 'lymphoid neoplasms':\n codeList = ['low grade or indolent nhl', 'high grade or aggressive nhl'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]},"codeList":{"right":["Low grade","High grade","GX","G1","G2","G3","G4","Low","High","Grade I","Grade II","Grade III","Grade IV","Grade Group 1","Grade Group 2","Grade Group 3","Grade Group 4","Grade Group 5"],"data":["Low grade","High grade","GX","G1","G2","G3","G4","Low","High","Grade I","Grade II","Grade III","Grade IV","Grade Group 1","Grade Group 2","Grade Group 3","Grade Group 4","Grade Group 5"]}}},"percent_tumour_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of infiltration by tumour cells in a specimen.","right":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)"},"restrictions":{}},"percent_proliferating_cells":{"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_inflammatory_tissue":{"description":{"left":"Indicate a value, in decimals, that represents local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue.","right":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_stromal_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a malignant tumour specimen but are not malignant such as fibroblasts, vascular structures, etc.","right":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_necrosis":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of cell death in a malignant tumour specimen.","right":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}}},"created":{"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate the primary diagnosis event in the clinical timeline that this specimen acquisition was related to.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"specimen_laterality":{"changeType":"created","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"reference_pathology_confirmed":{"changeType":"created","name":"reference_pathology_confirmed","description":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)","valueType":"string","meta":{"validationDependency":true,"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Reference Pathology Confirmed"},"restrictions":{"codeList":["Yes","No","Unknown"]}},"percent_tumour_cells_measurement_method":{"changeType":"created","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}},"deleted":{"central_pathology_confirmed":{"changeType":"deleted","name":"central_pathology_confirmed","description":"Indicate whether the histologic description of tissue or cells was confirmed by a pathology review of frozen or formalin fixed slide(s) completed after the diagnostic pathology review of the tumour sample used to extract analyte(s).","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Central Pathology Confirmed"},"restrictions":{"codeList":["Yes","No","Unknown"]}}}},"primary_diagnosis":{"updated":{"age_at_diagnosis":{"description":{"left":"Age that the donor was first diagnosed with cancer, in years.","right":"Age that the donor was first diagnosed with cancer, in years. This should be based on the earliest diagnosis of cancer."},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0,"max":90}}}},"basis_of_diagnosis":{},"number_lymph_nodes_positive":{"description":{"left":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: NCI CDE ID: 6113694)","right":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: caDSR CDE ID 6113694)"},"meta":{"dependsOn":{"left":null,"right":"primary_diagnosis.lymph_nodes_examined_status"},"notes":{"left":null,"right":"This field is only required if 'lymph_nodes_examined_status' is 'Yes'."}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"]},"range":{"left":null,"right":{"min":0}}}},"number_lymph_nodes_examined":{"description":{"left":"The total number of lymph nodes tested for the presence of cancer. (Reference: NCI CDE ID: 3)","right":"The total number of lymph nodes tested for the presence of cancer. (Reference: caDSR CDE ID 3)"},"meta":{"dependsOn":{"left":null,"right":"primary_diagnosis.lymph_nodes_examined_status"},"notes":{"left":null,"right":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'."}},"restrictions":{}},"clinical_tumour_staging_system":{"meta":{"validationDependency":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(\n field =>\n Object.keys(convertedRow).includes(field) &&\n (!convertedRow[field] || checkforEmpty(convertedRow[field])),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"required":{"left":true,"right":null},"codeList":{"left":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"deleted":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"]}}}},"clinical_stage_group":{"description":{"left":"Stage group of the tumour, as assigned by the reporting tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.).","right":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage."},"meta":{"notes":{"left":null,"right":"This field is dependent on the selected clinical_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications"},"examples":{"left":null,"right":"Stage I, Stage IIB"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"clinical_t_category":{"restrictions":{}},"clinical_n_category":{"description":{"left":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"restrictions":{}},"clinical_m_category":{"description":{"left":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned.","right":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned."},"restrictions":{}},"presenting_symptoms":{"meta":{"notes":{"left":null,"right":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"examples":{"left":null,"right":"Anemia|Bloating|Diabetes"}},"restrictions":{"codeList":{"left":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Nausea","None","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Unknown","Vomiting","Weight Loss"],"right":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Loss of Appetite","Nausea","None","Not Reported","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Swelling in the Neck","Unknown","Vomiting","Weight Loss"],"data":{"added":["Loss of Appetite","Not Reported","Swelling in the Neck"],"deleted":[]}}}},"performance_status":{"description":{"left":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference source: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status).","right":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status)."},"meta":{"notes":{"left":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction \n Grade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work) \n Grade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours \n Grade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours \n Grade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair","right":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction.\nGrade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work).\nGrade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours.\nGrade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours.\nGrade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair"}},"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}}},"created":{"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Unique identifier of the primary diagnosis event, assigned by the data provider.","meta":{"primaryId":true,"displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"cancer_type_additional_information":{"changeType":"created","name":"cancer_type_additional_information","valueType":"string","description":"Additional details related to the cancer type that are not covered by the ICD-10 code provided in the cancer_type field.","meta":{"displayName":"Cancer Type Additional Information"}},"laterality":{"changeType":"created","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_status":{"changeType":"created","name":"lymph_nodes_examined_status","description":"Indicate if lymph nodes were examined for metastases.","valueType":"string","restrictions":{"required":true,"codeList":["Cannot be determined","No","No lymph nodes found in resected specimen","Not applicable","Yes"]},"meta":{"core":true,"displayName":"Lymph Nodes Examined Status"}},"lymph_nodes_examined_method":{"changeType":"created","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}},"deleted":{"stage_suffix":{"changeType":"deleted","name":"stage_suffix","description":"If necessary, use this field to add any applicable stage suffixes. Stage suffixes may apply to certain staging systems such as Ann Arbour staging system where the four stages are divided into 4 categories (A, B, X and E).","valueType":"string","meta":{"core":true,"dependsOn":"primary_diagnosis.clinical_tumour_staging_system","displayName":"Stage Suffix"}}}},"treatment":{"updated":{"treatment_type":{"meta":{"notes":{"left":"Depending on the treatment_type selected, additional treament details may be required to be submitted.","right":"Depending on the treatment_type(s) selected, additional treatment details may be required to be submitted. For example, if treatment_type includes 'Chemotherapy', the supplemental Chemotherapy treatment type file is required.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."},"examples":{"left":null,"right":"Chemotherapy|Hormonal therapy"}},"restrictions":{"codeList":{"left":["Chemotherapy","Ablation","Bone marrow transplant","Combined chemo+immunotherapy","Combined chemo+radiation therapy","Combined chemo-radiotherapy and surgery","Endoscopic therapy","Hormonal therapy","Immunotherapy","Monoclonal antibodies (for liquid tumours)","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgical resection"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":["End of life care","Surgery"],"deleted":["Combined chemo+immunotherapy","Combined chemo+radiation therapy","Combined chemo-radiotherapy and surgery","Monoclonal antibodies (for liquid tumours)","Surgical resection"]}}}},"is_primary_treatment":{"description":{"left":"Indicate if the treamtment was the primary treatment following the initial diagnosis.","right":"Indicate if the treatment was the primary treatment following the initial diagnosis."},"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Yes","No","Unknown"],"right":["Yes","No"],"data":{"added":[],"deleted":["Unknown"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_start_interval":{"description":{"left":"The interval between primary diagnosis and initiation of treatment, in days.","right":"The interval between the primary diagnosis and initiation of treatment, in days."},"meta":{"notes":{"left":"The associated Primary Diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis","right":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."},"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_duration":{"description":{"left":"The duration of treatment regimen, in days","right":"The duration of treatment regimen, in days."},"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}}},"created":{"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate the primary diagnosis event in the clinical timeline that this treatment was related to.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"line_of_treatment":{"changeType":"created","name":"line_of_treatment","description":"Indicate the line of treatment if it is not the primary treatment.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Line Of treatment","dependsOn":"treatment.is_primary_treatment","examples":"2,3,4"}},"days_per_cycle":{"changeType":"created","name":"days_per_cycle","description":"Indicate the number of days in a treatment cycle.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Days Per Cycle","dependsOn":"treatment.treatment_type"}},"number_of_cycles":{"changeType":"created","name":"number_of_cycles","description":"Indicate the number of treatment cycles.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Number Of Cycles","dependsOn":"treatment.treatment_type"}},"treatment_intent":{"changeType":"created","name":"treatment_intent","description":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"]},"meta":{"core":true,"displayName":"Treatment Intent","dependsOn":"treatment.treatment_type"}},"treatment_setting":{"changeType":"created","name":"treatment_setting","description":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: NCIt C124308)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"]},"meta":{"core":true,"displayName":"Treatment Setting","dependsOn":"treatment.treatment_type"}},"response_to_treatment_criteria_method":{"changeType":"created","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},"response_to_treatment":{"changeType":"created","name":"response_to_treatment","description":"The donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"codeList":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"]},"meta":{"core":true,"displayName":"Response To Treatment","dependsOn":"treatment.response_to_treatment_criteria_method","notes":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"outcome_of_treatment":{"changeType":"created","name":"outcome_of_treatment","description":"Indicate the donor's outcome of the prescribed treatment.","valueType":"string","restrictions":{"codeList":["Treatment completed as prescribed","Treatment incomplete due to technical or organizational problems","Treatment incomplete because patient died","Patient choice (stopped or interrupted treatment)","Physician decision (stopped or interrupted treatment)","Treatment stopped due to lack of efficacy (disease progression)","Treatment stopped due to acute toxicity","Other","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Outcome Of Treatment","dependsOn":"treatment.treatment_type"}},"toxicity_type":{"changeType":"created","name":"toxicity_type","description":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity.","valueType":"string","restrictions":{"codeList":["Hematological","Non-hematological","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Toxicity Type","dependsOn":"treatment.outcome_of_treatment"}},"hematological_toxicity":{"changeType":"created","name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"non-hematological_toxicity":{"changeType":"created","name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"adverse_events":{"changeType":"created","name":"adverse_events","description":"Report any treatment related adverse events. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Adverse Events","dependsOn":"treatment.treatment_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"clinical_trials_database":{"changeType":"created","name":"clinical_trials_database","description":"If the donor is a participant in a clinical trial, indicate the clinical trial database where the clinical trial is registered.","valueType":"string","meta":{"display name":"Clinical Trials Database","notes":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added."},"restrictions":{"codeList":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"]}},"clinical_trial_number":{"changeType":"created","name":"clinical_trial_number","description":"Based on the clinical_trial_database, indicate the unique NCT or EudraCT clinical trial identifier of which the donor is a participant.","valueType":"string","meta":{"display name":"Clinical Trial Number","dependsOn":"treatment.clinical_trials_database","examples":"2016-002120-83,NCT02465060"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"]}}},"deleted":{"age_at_consent_for_treatment":{"changeType":"deleted","name":"age_at_consent_for_treatment","description":"Indicate the age of donor when consent was given for treatment.","valueType":"integer","meta":{"displayName":"Age At Consent For Treatment"}},"therapeutic_intent":{"changeType":"deleted","name":"therapeutic_intent","description":"The therapeutic intent, the reason behind the choice of a therapy, of the treatment.","valueType":"string","restrictions":{"required":true,"codeList":["Adjuvant","Concurrent","Curative","Neoadjuvant","Not applicable","Palliative","Unknown"]},"meta":{"core":true,"displayName":"Therapeutic Intent"}},"response_to_therapy":{"changeType":"deleted","name":"response_to_therapy","description":"The donors's response to the applied treatment regimen. (Source: RECIST)","valueType":"string","restrictions":{"required":true,"codeList":["Complete response","Disease progression","NED","Partial response","Stable disease"]},"meta":{"core":true,"displayName":"Response to Therapy"}}}},"chemotherapy":{"updated":{"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses a controlled vocabulary gathered from the RxNorm database of drug names provided by the NIH (https://www.nlm.nih.gov/research/umls/rxnorm).","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"description":{"left":"Name of agent or drug administered to patient as part of the treatment regimen.","right":"Name of agent or drug administered to donor as part of the treatment regimen."},"meta":{"notes":{"left":"This field uses a controlled vocabulary gathered from the RxNorm database of drug names provided by the NIH (https://www.nlm.nih.gov/research/umls/rxnorm).","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"created","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"created","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"created","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"created","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}},"deleted":{"chemotherapy_dosage_units":{"changeType":"deleted","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","µg/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate the total drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"integer","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"hormone_therapy":{"updated":{"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses a controlled vocabulary gathered from the RxNorm database of drug names provided by the NIH (https://www.nlm.nih.gov/research/umls/rxnorm).","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"description":{"left":"Name of agent or drug administered to patient as part of the treatment regimen.","right":"Name of agent or drug administered to donor as part of the treatment regimen."},"meta":{"notes":{"left":"This field uses a controlled vocabulary gathered from the RxNorm database of drug names provided by the NIH (https://www.nlm.nih.gov/research/umls/rxnorm).","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"created","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{"hormone_drug_dosage_units":{"changeType":"deleted","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","µg/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"integer","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dose"}}}},"radiation":{"updated":{"radiation_therapy_fractions":{"description":{"left":"Indicate the number of total fractions delivered as part of treatment.","right":"Indicate the total number of fractions delivered as part of treatment."},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"radiation_therapy_dosage":{"valueType":{"left":"integer","right":"number"},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"anatomical_site_irradiated":{"description":{"left":"Indicate localization site where radiation therapy was administered.","right":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)"},"restrictions":{"codeList":{"left":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"right":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"data":{"added":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"],"deleted":["Bone","Extremities","Head-Neck","Peritoneum"]}}}}},"created":{"radiation_therapy_type":{"changeType":"created","name":"radiation_therapy_type","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal"]},"meta":{"core":true,"displayName":"Type of Radiation Therapy","notes":"Internal application includes Brachytherapy."}},"radiation_boost":{"changeType":"created","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"created","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}},"deleted":{"application_form":{"changeType":"deleted","name":"application_form","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal (including Brachytherapy)"]},"meta":{"core":true,"displayName":"Application Form"}}}},"follow_up":{"updated":{"submitter_follow_up_id":{"description":{"left":"Unique identifier for a follow-up event in a donors clincal record, assigned by the data provider.","right":"Unique identifier for a follow-up event in a donor's clinical record, assigned by the data provider."}},"interval_of_followup":{"meta":{"notes":{"left":"The associated Primary Diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}}},"disease_status_at_followup":{"description":{"left":"Indicate the donor's disease status at time of follow-up.","right":"Indicate the donor's disease status at time of follow-up. (Reference: RECIST)"},"restrictions":{"codeList":{"left":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Relapse","Stable"],"right":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Progression NOS","Relapse or recurrence","Stable"],"data":{"added":["Progression NOS","Relapse or recurrence"],"deleted":["Relapse"]}}}},"weight_at_followup":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"relapse_type":{"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}},"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"relapse_interval":{"description":{"left":"If the donor was clinically disease free following primary treatment and then relapse or progression (for liquid tumours) occurred afterwards, then this field will indicate the length of disease free interval, in days.","right":"If the donor was clinically disease free following primary treatment and then relapse or recurrence or progression (for liquid tumours) occurred afterwards, then this field will indicate the length of disease free interval, in days."},"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a progression or relapse value.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}},"restrictions":{"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"]}}},"method_of_progression_status":{"description":{"left":"Indicate the method(s) used to confirm the donor's progression disease status. (Codelist reference: NCI CDE ID: 6161031)","right":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Reference: caDSR CDE ID 6161031)"},"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}},"restrictions":{"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]},"codeList":{"left":["Autopsy","Biomarker in liquid biopsy (e.g. tumour marker in blood or urine)","Biopsy","Blood draw","Bone marrow aspirate","Core biopsy","Cystoscopy","Cytology","Debulking","Diagnostic imaging","Dilation and curettage procedure","Enucleation","Excisional biopsy","Fine needle aspiration","Imaging","Incisional biopsy","Laparoscopy","Laparotomy","Other","Pap Smear","Pathologic review","Physical exam","Surgical resection","Thoracentesis","Ultrasound guided biopsy"],"right":["Biomarker in liquid biopsy (e.g. tumour marker in blood or urine)","Biopsy","Blood draw","Bone marrow aspirate","Core biopsy","Cystoscopy","Cytology","Debulking","Diagnostic imaging","Dilation and curettage procedure","Enucleation","Excisional biopsy","Fine needle aspiration","Imaging","Incisional biopsy","Laparoscopy","Laparotomy","Other","Pap Smear","Pathologic review","Physical exam","Surgical resection","Thoracentesis","Ultrasound guided biopsy"],"data":{"added":[],"deleted":["Autopsy"]}}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}},"restrictions":{"codeList":{"left":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"deleted":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"]}},"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(\n field =>\n Object.keys(convertedRow).includes(field) &&\n (!convertedRow[field] || checkforEmpty(convertedRow[field])),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_t_category":{"description":{"left":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":true,"right":null}},"restrictions":{}},"recurrence_n_category":{"description":{"left":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":true,"right":null}},"restrictions":{}},"recurrence_m_category":{"description":{"left":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":true,"right":null}},"restrictions":{}},"recurrence_stage_group":{"description":{"left":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery.","right":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) at the time of retreatment for a recurrence or disease progression."},"meta":{"core":{"left":true,"right":null},"notes":{"left":null,"right":"This field is dependent on the selected recurrence_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications"}},"restrictions":{}},"posttherapy_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(\n field =>\n Object.keys(convertedRow).includes(field) &&\n (!convertedRow[field] || checkforEmpty(convertedRow[field])),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"deleted":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"]}}}},"posttherapy_t_category":{"meta":{"dependsOn":{"left":"follow_up.post_therapy_tumour_staging_system","right":"follow_up.posttherapy_tumour_staging_system"}},"restrictions":{}},"posttherapy_n_category":{"description":{"left":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"dependsOn":{"left":"follow_up.post_therapy_tumour_staging_system","right":"follow_up.posttherapy_tumour_staging_system"}},"restrictions":{}},"posttherapy_m_category":{"description":{"left":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"dependsOn":{"left":"follow_up.post_therapy_tumour_staging_system","right":"follow_up.posttherapy_tumour_staging_system"}},"restrictions":{}},"posttherapy_stage_group":{"meta":{"dependsOn":{"left":"follow_up.post_therapy_tumour_staging_system","right":"follow_up.posttherapy_tumour_staging_system"},"notes":{"left":"This field value is dependent on the selected posttherapy_tumour_staging_system.","right":"This field is dependent on the selected posttherapy_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications"}},"restrictions":{}}},"created":{"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate if the follow-up is related to a specific primary diagnosis event in the clinical timeline.","meta":{"validationDependency":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID","primaryId":true},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"Indicate if the follow-up is related to a specific treatment event in the clinical timeline.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"anatomic_site_progression_or_recurrence":{"changeType":"created","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"anatomic_site_progression_or_recurrences":{"changeType":"deleted","description":"Indicate the anatomic site where disease progression or recurrence occurred. (Codelist reference: NCI CDE ID: 4742851)","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"],"codeList":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear - pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal - distal","Esophageal - mid","Esophageal - proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es) - maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"]},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","notes":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse.","displayName":"Anatomic Site Progression or Recurrences"}}}},"immunotherapy":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"immunotherapy_type":{"changeType":"created","name":"immunotherapy_type","valueType":"string","description":"Indicate the type of immunotherapy administered to donor.","meta":{"displayName":"Immunotherapy Type","core":true},"restrictions":{"required":true,"codeList":["Cell-based","Immune checkpoint inhibitors","Monoclonal antibodies other than immune checkpoint inhibitors","Other immunomodulatory substances"]}},"drug_rxnormcui":{"changeType":"created","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"created","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"created","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{}},"surgery":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"created","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"created","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"created","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"created","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"created","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"created","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"created","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"created","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"created","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"created","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"created","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"created","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"created","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"created","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}},"deleted":{}},"exposure":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"created","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"created","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"created","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"created","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"created","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"created","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"created","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"created","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"created","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"created","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"created","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"created","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"created","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}},"deleted":{}},"family_history":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"family_relative_id":{"changeType":"created","description":"Unique identifier of the relative, assigned by the data provider.","name":"family_relative_id","valueType":"string","meta":{"displayName":"Family Relative ID","primaryId":true,"notes":"This field is required to ensure that family members are identified in unique records. Ids can be as simple as an incremented numeral to ensure uniqueness."},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"relative_with_cancer_history":{"changeType":"created","description":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","name":"relative_with_cancer_history","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Relative with Cancer History"}},"relationship_type":{"changeType":"created","description":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","name":"relationship_type","restrictions":{"codeList":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"]},"valueType":"string","meta":{"displayName":"Relationship Type"}},"gender_of_relative":{"changeType":"created","description":"The self-reported gender of related individual.","name":"gender_of_relative","restrictions":{"codeList":["Female","Male","Other","Unknown"]},"valueType":"string","meta":{"displayName":"Gender of Relative"}},"age_of_relative_at_diagnosis":{"changeType":"created","description":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","name":"age_of_relative_at_diagnosis","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","displayName":"Age Of Relative At Diagnosis"}},"cancer_type_code_of_relative":{"changeType":"created","name":"cancer_type_code_of_relative","valueType":"string","description":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"examples":"C41.1,C16.9,C00.5,D46.9","dependsOn":"family_history.relative_with_cancer_history","displayName":"Cancer Type Code (ICD-10) of Relative"}},"relative_vital_status":{"changeType":"created","description":"Relative's last known state of living or deceased.","name":"relative_vital_status","restrictions":{"codeList":["Alive","Deceased","Unknown"]},"valueType":"string","meta":{"displayName":"Vital Status of Relative"}},"cause_of_death_of_relative":{"changeType":"created","description":"Indicate the cause of the death of the relative.","name":"cause_of_death_of_relative","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]},"valueType":"string","meta":{"dependsOn":"family_history.relative_vital_status","displayName":"Cause of Death of Relative"}},"relative_survival_time":{"changeType":"created","description":"Indicate how long, in days, the relative survived from the time they were diagnosed with cancer.","name":"relative_survival_time","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","units":"days","displayName":"Survival Time Of Relative"}}},"deleted":{}},"biomarker":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"created","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"created","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"created","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"created","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"created","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"created","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"created","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"created","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"created","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"created","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"created","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"created","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"created","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"created","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"created","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"created","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"created","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"created","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"created","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}},"deleted":{}},"comorbidity":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"created","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"created","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"created","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"created","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"created","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"created","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}},"deleted":{}}}} diff --git a/scripts/data/schemas/diffs/0.12/0.12-diff-1.24.json b/scripts/data/schemas/diffs/0.12/0.12-diff-1.24.json new file mode 100644 index 00000000..f7286d76 --- /dev/null +++ b/scripts/data/schemas/diffs/0.12/0.12-diff-1.24.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"program_id":{"meta":{"examples":{"left":"PACA-AU,BR-CA","right":"TEST-CA"},"notes":{"left":"This is the unique id that is assigned to your program. If you have logged into the platform, this is the Program Id that you see in the Submission area. For example, PACA-CA is a Program ID.","right":"This is the unique id that is assigned to your program. If you have logged into the platform, this is the Program Id that you see in the Program Services area. For example, TEST-CA is a Program ID."}}},"submitter_donor_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"gender":{},"submitter_specimen_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"specimen_tissue_source":{},"specimen_type":{"restrictions":{"codeList":{"left":["Normal","Normal - tissue adjacent to primary tumour","Primary tumour","Primary tumour - adjacent to normal","Primary tumour - additional new primary","Recurrent tumour","Metastatic tumour","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour - additional metastatic","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line","Cell line - derived from xenograft tumour","Cell line - derived from tumour","Cell line - derived from normal"],"right":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"],"deleted":[]}},"script":{"left":["(function validate() {\n\n const row = $row;\n let result = {valid: true, message: \"Ok\"};\n \n const designation = row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\"){\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when tumour_normal_designation is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when tumour_normal_designation is set to Tumour.\"};\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"]}}},"submitter_sample_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"sample_type":{}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased","Unknown"],"right":["Alive","Deceased"],"data":{"added":[],"deleted":["Unknown"]}}}},"cause_of_death":{"restrictions":{"codeList":{"left":["Died of cancer","Died of other reasons"],"right":["Died of cancer","Died of other reasons","Unknown"],"data":{"added":["Unknown"],"deleted":[]}},"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]}}},"survival_time":{"restrictions":{"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"primary_site":{"meta":{"notes":{"left":null,"right":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"examples":{"left":null,"right":"Breast|Ovary"}},"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva","Unknown","Not Reported"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"data":{"added":["Unknown primary site"],"deleted":["Unknown","Not Reported"]}}}},"height":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"weight":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"bmi":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"menopause_status":{"description":{"left":"Indicate the donor's menopause status at the time of primary diagnosis. (Codelist reference: NCI CDE ID: 2434914)","right":"Indicate the donor's menopause status at the time of primary diagnosis. (Reference: caDSR CDE ID 2434914)"},"restrictions":{"codeList":{"left":["Indeterminate or unknown","Not applicable","Perimenopausal","Postmenopausal","Premenopausal"],"right":["Not applicable","Perimenopausal","Postmenopausal","Premenopausal","Unknown"],"data":{"added":["Unknown"],"deleted":["Indeterminate or unknown"]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age of menarche, the first occurrence of menstruation.","right":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)"},"restrictions":{}},"number_of_pregnancies":{"description":{"left":"Indicate the number of pregnancies a donor has had.","right":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)"},"restrictions":{}},"number_of_children":{"description":{"left":"Indicate the number of children the donor has birthed.","right":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)"},"restrictions":{}}},"created":{"genetic_disorders":{"changeType":"created","description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},"hrt_type":{"changeType":"created","description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},"hrt_duration":{"changeType":"created","description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},"contraception_type":{"changeType":"created","description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},"contraception_duration":{"changeType":"created","description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},"lost_to_followup_after_clinical_event_id":{"changeType":"created","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}},"deleted":{"prior_malignancy":{"changeType":"deleted","description":"Prior malignancy affecting donor.","name":"prior_malignancy","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy","examples":"C41.1, C16.9, C00.5, D46.9"}},"cancer_type_prior_malignancy":{"changeType":"deleted","description":"The code to represent the cancer type of a prior malignancy using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","name":"cancer_type_prior_malignancy","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"valueType":"string","meta":{"displayName":"Cancer Type Prior Malignancy"}},"age_at_prior_malignancy":{"changeType":"deleted","description":"If donor has history of prior malignancy, indicate age at previous diagnosis, in years.","name":"age_at_prior_malignancy","valueType":"integer","meta":{"displayName":"Age at Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"deleted","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis.","name":"laterality_of_prior_malignancy","valueType":"string","meta":{"displayName":"Laterality at Prior Malignancy"}}}},"specimen":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"description":{"left":"Indicate the primary diagnosis event in the clinical timeline that this specimen aquisition was related to.","right":"Indicate the primary diagnosis event in the clinical timeline that this specimen acquisition was related to."},"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"pathological_tumour_staging_system":{"meta":{"validationDependency":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"deleted":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"]}}}},"pathological_t_category":{"restrictions":{}},"pathological_n_category":{"restrictions":{}},"pathological_m_category":{"restrictions":{}},"pathological_stage_group":{"description":{"left":"Specify the tumour stage, based on tumour_staging_system, used to assess the cancer at the time the tumour specimen was resected.","right":"Specify the tumour stage, based on pathological_tumour_staging_system, used to assess the cancer at the time the tumour specimen was resected."},"meta":{"notes":{"left":"This field depends on the selected pathological staging system, and is only required if the specimen is a tumour.","right":"This field depends on the selected pathological_tumour_staging_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications"}},"restrictions":{}},"specimen_acquisition_interval":{"meta":{"notes":{"left":"The associated Primary Diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."},"displayName":{"left":"Specimen Aquisition Interval","right":"Specimen Acquisition Interval"}}},"tumour_histological_type":{"description":{"left":"The code to represent the histology (morphology) of neoplasms that is usually obtained from a pathology report, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Please refer to the guidelines provided in the ICD-O-3 manual at https://apps.who.int/iris/handle/10665/42344.","right":"The code to represent the histology (morphology) of neoplasms that is usually obtained from a pathology report, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344."},"meta":{"validationDependency":{"left":null,"right":true}}},"specimen_anatomic_location":{"description":{"left":"Anatomic location of a specimen when it was collected.","right":"Indicate the ICD-O-3 topography code for the anatomic location of a specimen when it was collected. Refer to the guidelines provided in the ICD-O-3 manual at https://apps.who.int/iris/handle/10665/42344."},"meta":{"examples":{"left":null,"right":"C50.1,C18"}},"restrictions":{"codeList":{"left":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear - pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal - distal","Esophageal - mid","Esophageal - proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es) - maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"],"data":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear - pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal - distal","Esophageal - mid","Esophageal - proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es) - maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"]},"regex":{"left":null,"right":"^[C][0-9]{2}(.[0-9]{1})?$"}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"specimen_storage":{"description":{"left":"Indicate the method of specimen storage for specimens that were not extracted freshly or immediately cultured.","right":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured."},"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"tumour_grading_system":{"meta":{"validationDependency":{"left":null,"right":true}}},"tumour_grade":{"meta":{"notes":{"left":"This field depends on the selected tumour grading system, and is only required if the specimen is a tumour.","right":"This field depends on the selected tumour_grading_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Grading Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-grading-classifications"}},"restrictions":{"codeList":{"left":["Low grade","High grade","GX","G1","G2","G3","G4","Low","High","I","II","III","IV","1","2","3","4","5"],"right":["Low grade","High grade","GX","G1","G2","G3","G4","Low","High","Grade I","Grade II","Grade III","Grade IV","Grade Group 1","Grade Group 2","Grade Group 3","Grade Group 4","Grade Group 5"],"data":{"added":["Grade I","Grade II","Grade III","Grade IV","Grade Group 1","Grade Group 2","Grade Group 3","Grade Group 4","Grade Group 5"],"deleted":["I","II","III","IV","1","2","3","4","5"]}},"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'i',\n 'ii',\n 'iii',\n 'iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n '1',\n '2',\n '3',\n '4',\n '5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"percent_tumour_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of infiltration by tumour cells in a specimen.","right":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)"},"restrictions":{}},"percent_proliferating_cells":{"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_inflammatory_tissue":{"description":{"left":"Indicate a value, in decimals, that represents local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue.","right":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_stromal_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a malignant tumour specimen but are not malignant such as fibroblasts, vascular structures, etc.","right":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_necrosis":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of cell death in a malignant tumour specimen.","right":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}}},"created":{"specimen_laterality":{"changeType":"created","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"reference_pathology_confirmed":{"changeType":"created","name":"reference_pathology_confirmed","description":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)","valueType":"string","meta":{"validationDependency":true,"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Reference Pathology Confirmed"},"restrictions":{"codeList":["Yes","No","Unknown"]}},"percent_tumour_cells_measurement_method":{"changeType":"created","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}},"deleted":{"central_pathology_confirmed":{"changeType":"deleted","name":"central_pathology_confirmed","description":"Indicate whether the histologic description of tissue or cells was confirmed by a pathology review of frozen or formalin fixed slide(s) completed after the diagnostic pathology review of the tumour sample used to extract analyte(s).","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Central Pathology Confirmed"},"restrictions":{"codeList":["Yes","No","Unknown"]}}}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"age_at_diagnosis":{"description":{"left":"Age that the donor was first diagnosed with cancer, in years.","right":"Age that the donor was first diagnosed with cancer, in years. This should be based on the earliest diagnosis of cancer."},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0,"max":90}}}},"basis_of_diagnosis":{},"number_lymph_nodes_positive":{"description":{"left":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: NCI CDE ID: 6113694)","right":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: caDSR CDE ID 6113694)"},"meta":{"dependsOn":{"left":null,"right":"primary_diagnosis.lymph_nodes_examined_status"},"notes":{"left":null,"right":"This field is only required if 'lymph_nodes_examined_status' is 'Yes'."}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"]},"range":{"left":null,"right":{"min":0}}}},"number_lymph_nodes_examined":{"description":{"left":"The total number of lymph nodes tested for the presence of cancer. (Reference: NCI CDE ID: 3)","right":"The total number of lymph nodes tested for the presence of cancer. (Reference: caDSR CDE ID 3)"},"meta":{"dependsOn":{"left":null,"right":"primary_diagnosis.lymph_nodes_examined_status"},"notes":{"left":null,"right":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'."}},"restrictions":{}},"clinical_tumour_staging_system":{"meta":{"validationDependency":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"required":{"left":true,"right":null},"codeList":{"left":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"deleted":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"]}}}},"clinical_stage_group":{"description":{"left":"Stage group of the tumour, as assigned by the reporting tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.).","right":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage."},"meta":{"notes":{"left":null,"right":"This field is dependent on the selected clinical_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications"},"examples":{"left":null,"right":"Stage I, Stage IIB"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"clinical_t_category":{"restrictions":{}},"clinical_n_category":{"description":{"left":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"restrictions":{}},"clinical_m_category":{"description":{"left":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned.","right":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned."},"restrictions":{}},"presenting_symptoms":{"meta":{"notes":{"left":"To include multiple values, separate values with a comma ',' within your file.","right":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"examples":{"left":"Anemia,Bloating,Diabetes","right":"Anemia|Bloating|Diabetes"}},"restrictions":{"codeList":{"left":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Nausea","None","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Unknown","Vomiting","Weight Loss"],"right":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Loss of Appetite","Nausea","None","Not Reported","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Swelling in the Neck","Unknown","Vomiting","Weight Loss"],"data":{"added":["Loss of Appetite","Not Reported","Swelling in the Neck"],"deleted":[]}}}},"performance_status":{"description":{"left":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference source: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status).","right":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status)."},"meta":{"notes":{"left":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction \n Grade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work) \n Grade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours \n Grade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours \n Grade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair","right":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction.\nGrade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work).\nGrade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours.\nGrade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours.\nGrade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair"}},"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}}},"created":{"cancer_type_additional_information":{"changeType":"created","name":"cancer_type_additional_information","valueType":"string","description":"Additional details related to the cancer type that are not covered by the ICD-10 code provided in the cancer_type field.","meta":{"displayName":"Cancer Type Additional Information"}},"laterality":{"changeType":"created","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_status":{"changeType":"created","name":"lymph_nodes_examined_status","description":"Indicate if lymph nodes were examined for metastases.","valueType":"string","restrictions":{"required":true,"codeList":["Cannot be determined","No","No lymph nodes found in resected specimen","Not applicable","Yes"]},"meta":{"core":true,"displayName":"Lymph Nodes Examined Status"}},"lymph_nodes_examined_method":{"changeType":"created","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}},"deleted":{"stage_suffix":{"changeType":"deleted","name":"stage_suffix","description":"If necessary, use this field to add any applicable stage suffixes. Stage suffixes may apply to certain staging systems such as Ann Arbour staging system where the four stages are divided into 4 categories (A, B, X and E).","valueType":"string","meta":{"core":true,"dependsOn":"primary_diagnosis.clinical_tumour_staging_system","displayName":"Stage Suffix"}}}},"treatment":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"treatment_type":{"meta":{"notes":{"left":"Depending on the treatment_type selected, additional treament details may be required to be submitted. Depending on the treatment_type selected, additional treatment details may be required to be submitted. For example, if treatment_type includes 'Chemotherapy', the supplemental Chemotherapy treatment type file is required.","right":"Depending on the treatment_type(s) selected, additional treatment details may be required to be submitted. For example, if treatment_type includes 'Chemotherapy', the supplemental Chemotherapy treatment type file is required.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."},"examples":{"left":null,"right":"Chemotherapy|Hormonal therapy"}},"restrictions":{"codeList":{"left":["Chemotherapy","Ablation","Bone marrow transplant","Combined chemo+immunotherapy","Combined chemo+radiation therapy","Combined chemo-radiotherapy and surgery","Endoscopic therapy","Hormonal therapy","Immunotherapy","Monoclonal antibodies (for liquid tumours)","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgical resection"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":["End of life care","Surgery"],"deleted":["Combined chemo+immunotherapy","Combined chemo+radiation therapy","Combined chemo-radiotherapy and surgery","Monoclonal antibodies (for liquid tumours)","Surgical resection"]}}}},"is_primary_treatment":{"description":{"left":"Indicate if the treamtment was the primary treatment following the initial diagnosis.","right":"Indicate if the treatment was the primary treatment following the initial diagnosis."},"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Yes","No","Unknown"],"right":["Yes","No"],"data":{"added":[],"deleted":["Unknown"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_start_interval":{"description":{"left":"The interval between primary diagnosis and initiation of treatment, in days.","right":"The interval between the primary diagnosis and initiation of treatment, in days."},"meta":{"notes":{"left":"The associated Primary Diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."},"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_duration":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}}},"created":{"line_of_treatment":{"changeType":"created","name":"line_of_treatment","description":"Indicate the line of treatment if it is not the primary treatment.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Line Of treatment","dependsOn":"treatment.is_primary_treatment","examples":"2,3,4"}},"days_per_cycle":{"changeType":"created","name":"days_per_cycle","description":"Indicate the number of days in a treatment cycle.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Days Per Cycle","dependsOn":"treatment.treatment_type"}},"number_of_cycles":{"changeType":"created","name":"number_of_cycles","description":"Indicate the number of treatment cycles.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Number Of Cycles","dependsOn":"treatment.treatment_type"}},"treatment_intent":{"changeType":"created","name":"treatment_intent","description":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"]},"meta":{"core":true,"displayName":"Treatment Intent","dependsOn":"treatment.treatment_type"}},"treatment_setting":{"changeType":"created","name":"treatment_setting","description":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: NCIt C124308)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"]},"meta":{"core":true,"displayName":"Treatment Setting","dependsOn":"treatment.treatment_type"}},"response_to_treatment_criteria_method":{"changeType":"created","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},"response_to_treatment":{"changeType":"created","name":"response_to_treatment","description":"The donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"codeList":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"]},"meta":{"core":true,"displayName":"Response To Treatment","dependsOn":"treatment.response_to_treatment_criteria_method","notes":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"outcome_of_treatment":{"changeType":"created","name":"outcome_of_treatment","description":"Indicate the donor's outcome of the prescribed treatment.","valueType":"string","restrictions":{"codeList":["Treatment completed as prescribed","Treatment incomplete due to technical or organizational problems","Treatment incomplete because patient died","Patient choice (stopped or interrupted treatment)","Physician decision (stopped or interrupted treatment)","Treatment stopped due to lack of efficacy (disease progression)","Treatment stopped due to acute toxicity","Other","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Outcome Of Treatment","dependsOn":"treatment.treatment_type"}},"toxicity_type":{"changeType":"created","name":"toxicity_type","description":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity.","valueType":"string","restrictions":{"codeList":["Hematological","Non-hematological","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Toxicity Type","dependsOn":"treatment.outcome_of_treatment"}},"hematological_toxicity":{"changeType":"created","name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"non-hematological_toxicity":{"changeType":"created","name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"adverse_events":{"changeType":"created","name":"adverse_events","description":"Report any treatment related adverse events. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Adverse Events","dependsOn":"treatment.treatment_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"clinical_trials_database":{"changeType":"created","name":"clinical_trials_database","description":"If the donor is a participant in a clinical trial, indicate the clinical trial database where the clinical trial is registered.","valueType":"string","meta":{"display name":"Clinical Trials Database","notes":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added."},"restrictions":{"codeList":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"]}},"clinical_trial_number":{"changeType":"created","name":"clinical_trial_number","description":"Based on the clinical_trial_database, indicate the unique NCT or EudraCT clinical trial identifier of which the donor is a participant.","valueType":"string","meta":{"display name":"Clinical Trial Number","dependsOn":"treatment.clinical_trials_database","examples":"2016-002120-83,NCT02465060"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"]}}},"deleted":{"age_at_consent_for_treatment":{"changeType":"deleted","name":"age_at_consent_for_treatment","description":"Indicate the age of donor when consent was given for treatment.","valueType":"integer","meta":{"displayName":"Age At Consent For Treatment"}},"therapeutic_intent":{"changeType":"deleted","name":"therapeutic_intent","description":"The therapeutic intent, the reason behind the choice of a therapy, of the treatment.","valueType":"string","restrictions":{"required":true,"codeList":["Adjuvant","Concurrent","Curative","Neoadjuvant","Not applicable","Palliative","Unknown"]},"meta":{"core":true,"displayName":"Therapeutic Intent"}},"response_to_therapy":{"changeType":"deleted","name":"response_to_therapy","description":"The donors's response to the applied treatment regimen. (Source: RECIST)","valueType":"string","restrictions":{"required":true,"codeList":["Complete response","Disease progression","NED","Partial response","Stable disease"]},"meta":{"core":true,"displayName":"Response to Therapy"}}}},"chemotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses a controlled vocabulary gathered from the RxNorm database of drug names provided by the NIH (https://www.nlm.nih.gov/research/umls/rxnorm).","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"description":{"left":"Name of agent or drug administered to patient as part of the treatment regimen.","right":"Name of agent or drug administered to donor as part of the treatment regimen."},"meta":{"notes":{"left":"This field uses a controlled vocabulary gathered from the RxNorm database of drug names provided by the NIH (https://www.nlm.nih.gov/research/umls/rxnorm).","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"created","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"created","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"created","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"created","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}},"deleted":{"chemotherapy_dosage_units":{"changeType":"deleted","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate the total drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses a controlled vocabulary gathered from the RxNorm database of drug names provided by the NIH (https://www.nlm.nih.gov/research/umls/rxnorm).","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"description":{"left":"Name of agent or drug administered to patient as part of the treatment regimen.","right":"Name of agent or drug administered to donor as part of the treatment regimen."},"meta":{"notes":{"left":"This field uses a controlled vocabulary gathered from the RxNorm database of drug names provided by the NIH (https://www.nlm.nih.gov/research/umls/rxnorm).","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"created","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{"hormone_drug_dosage_units":{"changeType":"deleted","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"radiation":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"radiation_therapy_fractions":{"description":{"left":"Indicate the number of total fractions delivered as part of treatment.","right":"Indicate the total number of fractions delivered as part of treatment."},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"radiation_therapy_dosage":{"valueType":{"left":"integer","right":"number"},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"anatomical_site_irradiated":{"description":{"left":"Indicate localization site where radiation therapy was administered.","right":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)"},"restrictions":{"codeList":{"left":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"right":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"data":{"added":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"],"deleted":["Bone","Extremities","Head-Neck","Peritoneum"]}}}}},"created":{"radiation_therapy_type":{"changeType":"created","name":"radiation_therapy_type","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal"]},"meta":{"core":true,"displayName":"Type of Radiation Therapy","notes":"Internal application includes Brachytherapy."}},"radiation_boost":{"changeType":"created","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"created","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}},"deleted":{"application_form":{"changeType":"deleted","name":"application_form","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal"]},"meta":{"core":true,"displayName":"Application Form","notes":"Internal application includes Brachytherapy."}}}},"follow_up":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_follow_up_id":{"description":{"left":"Unique identifier for a follow-up event in a donors clincal record, assigned by the data provider.","right":"Unique identifier for a follow-up event in a donor's clinical record, assigned by the data provider."},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"interval_of_followup":{"meta":{"notes":{"left":"The associated Primary Diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}}},"disease_status_at_followup":{"description":{"left":"Indicate the donor's disease status at time of follow-up.","right":"Indicate the donor's disease status at time of follow-up. (Reference: RECIST)"},"restrictions":{"codeList":{"left":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Relapse","Stable"],"right":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Progression NOS","Relapse or recurrence","Stable"],"data":{"added":["Progression NOS","Relapse or recurrence"],"deleted":["Relapse"]}}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"treatment.submitter_treatment_id"}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"weight_at_followup":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"relapse_type":{"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}},"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"relapse_interval":{"description":{"left":"If the donor was clinically disease free following primary treatment and then relapse or progression (for liquid tumours) occurred afterwards, then this field will indicate the length of disease free interval, in days.","right":"If the donor was clinically disease free following primary treatment and then relapse or recurrence or progression (for liquid tumours) occurred afterwards, then this field will indicate the length of disease free interval, in days."},"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a progression or relapse value.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}},"restrictions":{"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"]}}},"method_of_progression_status":{"description":{"left":"Indicate the method(s) used to confirm the donor's progression disease status. (Codelist reference: NCI CDE ID: 6161031)","right":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Reference: caDSR CDE ID 6161031)"},"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}},"restrictions":{"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}},"restrictions":{"codeList":{"left":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"deleted":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"]}},"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_t_category":{"description":{"left":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":true,"right":null}},"restrictions":{}},"recurrence_n_category":{"description":{"left":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":true,"right":null}},"restrictions":{}},"recurrence_m_category":{"description":{"left":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":true,"right":null}},"restrictions":{}},"recurrence_stage_group":{"description":{"left":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery.","right":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) at the time of retreatment for a recurrence or disease progression."},"meta":{"core":{"left":true,"right":null},"notes":{"left":null,"right":"This field is dependent on the selected recurrence_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications"}},"restrictions":{}},"posttherapy_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"deleted":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"]}}}},"posttherapy_t_category":{"meta":{"dependsOn":{"left":"follow_up.post_therapy_tumour_staging_system","right":"follow_up.posttherapy_tumour_staging_system"}},"restrictions":{}},"posttherapy_n_category":{"description":{"left":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"dependsOn":{"left":"follow_up.post_therapy_tumour_staging_system","right":"follow_up.posttherapy_tumour_staging_system"}},"restrictions":{}},"posttherapy_m_category":{"description":{"left":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"dependsOn":{"left":"follow_up.post_therapy_tumour_staging_system","right":"follow_up.posttherapy_tumour_staging_system"}},"restrictions":{}},"posttherapy_stage_group":{"meta":{"dependsOn":{"left":"follow_up.post_therapy_tumour_staging_system","right":"follow_up.posttherapy_tumour_staging_system"},"notes":{"left":"This field is required only if the selected posttherapy_tumour_staging_system is any edition of the AJCC cancer staging system.","right":"This field is dependent on the selected posttherapy_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications"}},"restrictions":{}}},"created":{"anatomic_site_progression_or_recurrence":{"changeType":"created","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"anatomic_site_progression_or_recurrences":{"changeType":"deleted","description":"Indicate the anatomic site where disease progression or recurrence occurred. (Codelist reference: NCI CDE ID: 4742851)","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"],"codeList":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear - pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal - distal","Esophageal - mid","Esophageal - proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es) - maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"]},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","notes":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse.","displayName":"Anatomic Site Progression or Recurrences"}}}},"immunotherapy":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"immunotherapy_type":{"changeType":"created","name":"immunotherapy_type","valueType":"string","description":"Indicate the type of immunotherapy administered to donor.","meta":{"displayName":"Immunotherapy Type","core":true},"restrictions":{"required":true,"codeList":["Cell-based","Immune checkpoint inhibitors","Monoclonal antibodies other than immune checkpoint inhibitors","Other immunomodulatory substances"]}},"drug_rxnormcui":{"changeType":"created","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"created","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"created","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{}},"surgery":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"created","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"created","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"created","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"created","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"created","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"created","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"created","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"created","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"created","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"created","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"created","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"created","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"created","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"created","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}},"deleted":{}},"exposure":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"created","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"created","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"created","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"created","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"created","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"created","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"created","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"created","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"created","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"created","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"created","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"created","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"created","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}},"deleted":{}},"family_history":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"family_relative_id":{"changeType":"created","description":"Unique identifier of the relative, assigned by the data provider.","name":"family_relative_id","valueType":"string","meta":{"displayName":"Family Relative ID","primaryId":true,"notes":"This field is required to ensure that family members are identified in unique records. Ids can be as simple as an incremented numeral to ensure uniqueness."},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"relative_with_cancer_history":{"changeType":"created","description":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","name":"relative_with_cancer_history","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Relative with Cancer History"}},"relationship_type":{"changeType":"created","description":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","name":"relationship_type","restrictions":{"codeList":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"]},"valueType":"string","meta":{"displayName":"Relationship Type"}},"gender_of_relative":{"changeType":"created","description":"The self-reported gender of related individual.","name":"gender_of_relative","restrictions":{"codeList":["Female","Male","Other","Unknown"]},"valueType":"string","meta":{"displayName":"Gender of Relative"}},"age_of_relative_at_diagnosis":{"changeType":"created","description":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","name":"age_of_relative_at_diagnosis","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","displayName":"Age Of Relative At Diagnosis"}},"cancer_type_code_of_relative":{"changeType":"created","name":"cancer_type_code_of_relative","valueType":"string","description":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"examples":"C41.1,C16.9,C00.5,D46.9","dependsOn":"family_history.relative_with_cancer_history","displayName":"Cancer Type Code (ICD-10) of Relative"}},"relative_vital_status":{"changeType":"created","description":"Relative's last known state of living or deceased.","name":"relative_vital_status","restrictions":{"codeList":["Alive","Deceased","Unknown"]},"valueType":"string","meta":{"displayName":"Vital Status of Relative"}},"cause_of_death_of_relative":{"changeType":"created","description":"Indicate the cause of the death of the relative.","name":"cause_of_death_of_relative","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]},"valueType":"string","meta":{"dependsOn":"family_history.relative_vital_status","displayName":"Cause of Death of Relative"}},"relative_survival_time":{"changeType":"created","description":"Indicate how long, in days, the relative survived from the time they were diagnosed with cancer.","name":"relative_survival_time","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","units":"days","displayName":"Survival Time Of Relative"}}},"deleted":{}},"biomarker":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"created","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"created","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"created","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"created","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"created","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"created","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"created","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"created","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"created","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"created","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"created","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"created","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"created","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"created","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"created","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"created","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"created","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"created","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"created","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}},"deleted":{}},"comorbidity":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"created","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"created","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"created","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"created","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"created","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"created","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}},"deleted":{}}}} diff --git a/scripts/data/schemas/diffs/0.14/0.14-diff-1.24.json b/scripts/data/schemas/diffs/0.14/0.14-diff-1.24.json new file mode 100644 index 00000000..77e70f20 --- /dev/null +++ b/scripts/data/schemas/diffs/0.14/0.14-diff-1.24.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"program_id":{"meta":{"examples":{"left":"PACA-AU,BR-CA","right":"TEST-CA"},"notes":{"left":"This is the unique id that is assigned to your program. If you have logged into the platform, this is the Program Id that you see in the Submission area. For example, PACA-CA is a Program ID.","right":"This is the unique id that is assigned to your program. If you have logged into the platform, this is the Program Id that you see in the Program Services area. For example, TEST-CA is a Program ID."}}},"submitter_donor_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"],"deleted":[]}},"script":{"left":["(function validate() {\r\n\r\n const row = $row;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n const designation = row.tumour_normal_designation.trim().toLowerCase();\r\n const specimen_type = $field.trim().toLowerCase();\r\n \r\n if (designation === \"normal\"){\r\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\r\n if (!validTypes.includes(specimen_type)){\r\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when tumour_normal_designation is set to Normal.\"};\r\n }\r\n }\r\n else if (designation === \"tumour\") {\r\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\r\n if (invalidTypes.includes(specimen_type)){\r\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when tumour_normal_designation is set to Tumour.\"};\r\n }\r\n }\r\n return result;\r\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"]}}},"submitter_sample_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased","Unknown"],"right":["Alive","Deceased"],"data":{"added":[],"deleted":["Unknown"]}}}},"cause_of_death":{"restrictions":{"script":{"left":["(function validate() {\r\n let result = {valid: true, message: \"Ok\"};\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n const vitalStatus = $row.vital_status.trim().toLowerCase();\r\n \r\n if (!currField && vitalStatus === \"deceased\"){\r\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\r\n }\r\n else if (currField && vitalStatus != \"deceased\"){\r\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\r\n }\r\n return result;\r\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]}}},"survival_time":{"restrictions":{"script":{"left":["(function validate() {\r\n let result = {valid: true, message: \"Ok\"};\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n const vitalStatus = $row.vital_status.trim().toLowerCase();\r\n \r\n if (!currField && vitalStatus === \"deceased\"){\r\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\r\n }\r\n else if (currField && vitalStatus != \"deceased\"){\r\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\r\n }\r\n return result;\r\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"primary_site":{"meta":{"notes":{"left":null,"right":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"examples":{"left":null,"right":"Breast|Ovary"}},"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Not Reported","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva","Unknown"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"data":{"added":["Unknown primary site"],"deleted":["Not Reported","Unknown"]}}}},"height":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"weight":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"bmi":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"menopause_status":{"description":{"left":"Indicate the donor's menopause status at the time of primary diagnosis. (Codelist reference: NCI CDE ID: 2434914)","right":"Indicate the donor's menopause status at the time of primary diagnosis. (Reference: caDSR CDE ID 2434914)"},"restrictions":{"codeList":{"left":["Indeterminate or unknown","Not applicable","Perimenopausal","Postmenopausal","Premenopausal"],"right":["Not applicable","Perimenopausal","Postmenopausal","Premenopausal","Unknown"],"data":{"added":["Unknown"],"deleted":["Indeterminate or unknown"]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age of menarche, the first occurrence of menstruation.","right":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)"},"restrictions":{}},"number_of_pregnancies":{"description":{"left":"Indicate the number of pregnancies a donor has had.","right":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)"},"restrictions":{}},"number_of_children":{"description":{"left":"Indicate the number of children the donor has birthed.","right":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)"},"restrictions":{}}},"created":{"genetic_disorders":{"changeType":"created","description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},"hrt_type":{"changeType":"created","description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},"hrt_duration":{"changeType":"created","description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},"contraception_type":{"changeType":"created","description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},"contraception_duration":{"changeType":"created","description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},"lost_to_followup_after_clinical_event_id":{"changeType":"created","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}},"deleted":{"prior_malignancy":{"changeType":"deleted","description":"Prior malignancy affecting donor.","name":"prior_malignancy","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy","examples":"C41.1, C16.9, C00.5, D46.9"}},"cancer_type_prior_malignancy":{"changeType":"deleted","description":"The code to represent the cancer type of a prior malignancy using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","name":"cancer_type_prior_malignancy","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"valueType":"string","meta":{"displayName":"Cancer Type Prior Malignancy"}},"age_at_prior_malignancy":{"changeType":"deleted","description":"If donor has history of prior malignancy, indicate age at previous diagnosis, in years.","name":"age_at_prior_malignancy","valueType":"integer","meta":{"displayName":"Age at Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"deleted","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Codelist reference: NCI CDE: 4122391)","name":"laterality_of_prior_malignancy","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality at Prior Malignancy"}}}},"specimen":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"description":{"left":"Indicate the primary diagnosis event in the clinical timeline that this specimen aquisition was related to.","right":"Indicate the primary diagnosis event in the clinical timeline that this specimen acquisition was related to."},"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"pathological_tumour_staging_system":{"meta":{"validationDependency":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n /* This is not a required field, so first ensure that it exists */\r\n if ($field) {\r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"pathological_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"pathological_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"pathological_stage_group":{"description":{"left":"Specify the tumour stage, based on tumour_staging_system, used to assess the cancer at the time the tumour specimen was resected.","right":"Specify the tumour stage, based on pathological_tumour_staging_system, used to assess the cancer at the time the tumour specimen was resected."},"meta":{"notes":{"left":"This field depends on the selected pathological staging system, and is only required if the specimen is a tumour.","right":"This field depends on the selected pathological_tumour_staging_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications"}},"restrictions":{"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.pathological_tumour_staging_system && $field) {\r\n let codeList = [];\r\n switch ($row.pathological_tumour_staging_system && $row.pathological_tumour_staging_system.trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb',\r\n 'stage ive',\r\n 'stage ivs'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When 'pathological_tumour_staging_system' is set to '${\r\n $row.pathological_tumour_staging_system\r\n }', 'pathological_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"specimen_acquisition_interval":{"meta":{"notes":{"left":"The associated Primary Diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."},"displayName":{"left":"Specimen Aquisition Interval","right":"Specimen Acquisition Interval"}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"specimen_storage":{"description":{"left":"Indicate the method of specimen storage for specimens that were not extracted freshly or immediately cultured.","right":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured."},"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"reference_pathology_confirmed":{"description":{"left":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. This only applies to clinical studies.","right":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)"}},"tumour_grading_system":{"meta":{"validationDependency":{"left":null,"right":true}}},"tumour_grade":{"meta":{"notes":{"left":"This field depends on the selected tumour grading system, and is only required if the specimen is a tumour.","right":"This field depends on the selected tumour_grading_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Grading Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-grading-classifications"}},"restrictions":{"script":{"left":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.tumour_grading_system && $field) {\r\n let codeList = [];\r\n const tieredGradingList = ['gx','g1','g2','g3'];\r\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\r\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\r\n case 'two-tier grading system':\r\n codeList = [\r\n 'low grade',\r\n 'high grade',\r\n ];\r\n break;\r\n case 'three-tier grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'four-tier grading system':\r\n codeList = [\r\n 'gx',\r\n 'g1',\r\n 'g2',\r\n 'g3',\r\n 'g4',\r\n ];\r\n break;\r\n case 'grading system for gists':\r\n codeList = [\r\n 'low',\r\n 'high',\r\n ];\r\n break;\r\n case 'grading system for gnets':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'isup grading system':\r\n codeList = [\r\n 'gx',\r\n 'g1',\r\n 'g2',\r\n 'g3',\r\n 'g4',\r\n ];\r\n break;\r\n case 'who grading system for cns tumours':\r\n codeList = [\r\n 'grade i',\r\n 'grade ii',\r\n 'grade iii',\r\n 'grade iv',\r\n ];\r\n break;\r\n case 'fnclcc grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'gleason grade group system':\r\n codeList = [\r\n 'grade group 1',\r\n 'grade group 2',\r\n 'grade group 3',\r\n 'grade group 4',\r\n 'grade group 5',\r\n ];\r\n break;\r\n case 'scarff-bloom-richardson grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'nuclear grading system for dcis':\r\n codeList = tieredGradingList;\r\n break;\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase())) {\r\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\r\n $row.tumour_grading_system\r\n }', 'tumour_grade' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\r\n result.valid = false;\r\n const msg = \"'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.\";\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"percent_tumour_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of infiltration by tumour cells in a specimen.","right":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)"},"restrictions":{}},"percent_proliferating_cells":{"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_inflammatory_tissue":{"description":{"left":"Indicate a value, in decimals, that represents local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue.","right":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_stromal_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a malignant tumour specimen but are not malignant such as fibroblasts, vascular structures, etc.","right":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_necrosis":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of cell death in a malignant tumour specimen.","right":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}}},"created":{"specimen_laterality":{"changeType":"created","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"percent_tumour_cells_measurement_method":{"changeType":"created","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}},"deleted":{}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"age_at_diagnosis":{"description":{"left":"Age that the donor was first diagnosed with cancer, in years.","right":"Age that the donor was first diagnosed with cancer, in years. This should be based on the earliest diagnosis of cancer."},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0,"max":90}}}},"number_lymph_nodes_positive":{"description":{"left":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: NCI CDE ID: 6113694)","right":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: caDSR CDE ID 6113694)"},"meta":{"dependsOn":{"left":null,"right":"primary_diagnosis.lymph_nodes_examined_status"},"notes":{"left":null,"right":"This field is only required if 'lymph_nodes_examined_status' is 'Yes'."}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"]},"range":{"left":null,"right":{"min":0}}}},"number_lymph_nodes_examined":{"description":{"left":"The total number of lymph nodes tested for the presence of cancer. (Reference: NCI CDE ID: 3)","right":"The total number of lymph nodes tested for the presence of cancer. (Reference: caDSR CDE ID 3)"},"meta":{"dependsOn":{"left":null,"right":"primary_diagnosis.lymph_nodes_examined_status"},"notes":{"left":null,"right":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'."}},"restrictions":{}},"clinical_tumour_staging_system":{"meta":{"validationDependency":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n /* This is not a required field, so first ensure that it exists */\r\n if ($field) {\r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"required":{"left":true,"right":null},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"clinical_stage_group":{"description":{"left":"Stage group of the tumour, as assigned by the reporting tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.).","right":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage."},"meta":{"notes":{"left":"This field is dependent on the selected clinical_tumour_staging_system","right":"This field is dependent on the selected clinical_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications"},"examples":{"left":null,"right":"Stage I, Stage IIB"}},"restrictions":{"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.clinical_tumour_staging_system && $field) {\r\n let codeList = [];\r\n switch ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system.trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb',\r\n 'stage ive',\r\n 'stage ivs'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When 'clinical_tumour_staging_system' is set to '${\r\n $row.clinical_tumour_staging_system\r\n }', 'clinical_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"clinical_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"clinical_n_category":{"description":{"left":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"clinical_m_category":{"description":{"left":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned.","right":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned."},"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"presenting_symptoms":{"restrictions":{"codeList":{"left":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Nausea","None","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Unknown","Vomiting","Weight Loss"],"right":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Loss of Appetite","Nausea","None","Not Reported","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Swelling in the Neck","Unknown","Vomiting","Weight Loss"],"data":{"added":["Loss of Appetite","Not Reported","Swelling in the Neck"],"deleted":[]}}}},"performance_status":{"description":{"left":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference source: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status).","right":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status)."},"meta":{"notes":{"left":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction \n Grade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work) \n Grade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours \n Grade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours \n Grade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair","right":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction.\nGrade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work).\nGrade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours.\nGrade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours.\nGrade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair"}},"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}}},"created":{"cancer_type_additional_information":{"changeType":"created","name":"cancer_type_additional_information","valueType":"string","description":"Additional details related to the cancer type that are not covered by the ICD-10 code provided in the cancer_type field.","meta":{"displayName":"Cancer Type Additional Information"}},"laterality":{"changeType":"created","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_status":{"changeType":"created","name":"lymph_nodes_examined_status","description":"Indicate if lymph nodes were examined for metastases.","valueType":"string","restrictions":{"required":true,"codeList":["Cannot be determined","No","No lymph nodes found in resected specimen","Not applicable","Yes"]},"meta":{"core":true,"displayName":"Lymph Nodes Examined Status"}},"lymph_nodes_examined_method":{"changeType":"created","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}},"deleted":{}},"treatment":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"treatment_type":{"meta":{"notes":{"left":"Depending on the treatment_type selected, additional treatment details may be required to be submitted. For example, if treatment_type includes 'Chemotherapy', the supplemental Chemotherapy treatment type file is required.","right":"Depending on the treatment_type(s) selected, additional treatment details may be required to be submitted. For example, if treatment_type includes 'Chemotherapy', the supplemental Chemotherapy treatment type file is required.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."},"examples":{"left":null,"right":"Chemotherapy|Hormonal therapy"}},"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Combined chemotherapy and immunotherapy","Combined chemotherapy and radiation therapy","Combined chemotherapy, radiation therapy and surgery","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":["End of life care"],"deleted":["Combined chemotherapy and immunotherapy","Combined chemotherapy and radiation therapy","Combined chemotherapy, radiation therapy and surgery"]}}}},"is_primary_treatment":{"description":{"left":"Indicate if the treamtment was the primary treatment following the initial diagnosis.","right":"Indicate if the treatment was the primary treatment following the initial diagnosis."},"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Yes","No","Unknown"],"right":["Yes","No"],"data":{"added":[],"deleted":["Unknown"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"line_of_treatment":{"meta":{"dependsOn":{"left":null,"right":"treatment.is_primary_treatment"}},"restrictions":{}},"treatment_start_interval":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_duration":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"days_per_cycle":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{}},"number_of_cycles":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{}},"toxicity_type":{"description":{"left":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hemotological toxicity or non-hemotological toxicity.","right":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity."},"meta":{"dependsOn":{"left":null,"right":"treatment.outcome_of_treatment"}},"restrictions":{"codeList":{"left":["Hemotological","Non-hemotological"],"right":["Hematological","Non-hematological","Not applicable","Unknown"],"data":{"added":["Hematological","Non-hematological","Not applicable","Unknown"],"deleted":["Hemotological","Non-hemotological"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"]}}},"adverse_events":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"},"notes":{"left":null,"right":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"restrictions":{"codeList":{"left":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"right":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"data":{"added":["None","Unknown"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"clinical_trials_database":{"meta":{"notes":{"left":null,"right":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added."}},"restrictions":{"codeList":{"left":["NCI Clinical Trials","EU Clinical Trials Register"],"right":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"],"data":{"added":["Not applicable","Unknown"],"deleted":[]}}}},"clinical_trial_number":{"restrictions":{"script":{"left":["(function validate() {\r\n let result = {valid: true, message: \"Ok\"};\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n //regex check for clinical trial number\r\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\r\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\r\n\r\n // list of valid clinical trial databases\r\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\r\n \r\n if ($row.clinical_trials_database && $field) {\r\n const trialNumber = $field.trim();\r\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\r\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\r\n result = {valid: false, message: 'The submitted NCI clinical trial number is in incorrect format.'};\r\n }\r\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\r\n result = {valid: false, message: \"The submitted EudraCT clinical trial number is in incorrect format.\"};\r\n }\r\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\r\n result = {valid: false, message: \"The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database.\"};\r\n }\r\n }\r\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\r\n result = {valid: true, message: \"Ok\"};\r\n }\r\n else if ($row.clinical_trials_database && !$field) {\r\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\r\n result = {valid: false, message: \"'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.\"};\r\n } \r\n }\r\n return result;\r\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"]}}}},"created":{"treatment_intent":{"changeType":"created","name":"treatment_intent","description":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"]},"meta":{"core":true,"displayName":"Treatment Intent","dependsOn":"treatment.treatment_type"}},"treatment_setting":{"changeType":"created","name":"treatment_setting","description":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: NCIt C124308)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"]},"meta":{"core":true,"displayName":"Treatment Setting","dependsOn":"treatment.treatment_type"}},"response_to_treatment_criteria_method":{"changeType":"created","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},"response_to_treatment":{"changeType":"created","name":"response_to_treatment","description":"The donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"codeList":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"]},"meta":{"core":true,"displayName":"Response To Treatment","dependsOn":"treatment.response_to_treatment_criteria_method","notes":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"outcome_of_treatment":{"changeType":"created","name":"outcome_of_treatment","description":"Indicate the donor's outcome of the prescribed treatment.","valueType":"string","restrictions":{"codeList":["Treatment completed as prescribed","Treatment incomplete due to technical or organizational problems","Treatment incomplete because patient died","Patient choice (stopped or interrupted treatment)","Physician decision (stopped or interrupted treatment)","Treatment stopped due to lack of efficacy (disease progression)","Treatment stopped due to acute toxicity","Other","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Outcome Of Treatment","dependsOn":"treatment.treatment_type"}},"hematological_toxicity":{"changeType":"created","name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"non-hematological_toxicity":{"changeType":"created","name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"age_at_consent_for_treatment":{"changeType":"deleted","name":"age_at_consent_for_treatment","description":"Indicate the age of donor when consent was given for treatment.","valueType":"integer","meta":{"displayName":"Age At Consent For Treatment"}},"therapeutic_intent":{"changeType":"deleted","name":"therapeutic_intent","description":"The therapeutic intent, the reason behind the choice of a therapy, of the treatment.","valueType":"string","restrictions":{"required":true,"codeList":["Adjuvant","Concurrent","Curative","Neoadjuvant","Not applicable","Palliative","Unknown"]},"meta":{"core":true,"displayName":"Therapeutic Intent"}},"response_to_therapy":{"changeType":"deleted","name":"response_to_therapy","description":"The donors's response to the applied treatment regimen. (Source: RECIST)","valueType":"string","restrictions":{"required":true,"codeList":["Complete response","Disease progression","NED","Partial response","Stable disease"]},"meta":{"core":true,"displayName":"Response To Therapy"}},"outcome_of_therapy":{"changeType":"deleted","name":"outcome_of_therapy","description":"Indicate the donor's outcome of the prescribed treatment.","valueType":"string","restrictions":{"codeList":["Treatment completed as prescribed","Treatment incomplete due to technical or organizational problems","Treatment incomplete because patient died","Patient choice (stopped or interrupted treatment)","Physician decision (stopped or interrupted treatment)","Treatment stopped due to lack of efficacy (disease progression)","Treatment stopped due to acute toxicity","Other","Not applicable","Unknown"]},"meta":{"displayName":"Outcome Of Therapy"}},"hemotological_toxicity":{"changeType":"deleted","name":"hemotological_toxicity","description":"Indicate the hemotological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5"]},"meta":{"displayName":"Hemotological Toxicity"}}}},"chemotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"description":{"left":"Name of agent or drug administered to patient as part of the treatment regimen.","right":"Name of agent or drug administered to donor as part of the treatment regimen."},"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"created","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"created","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"created","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"created","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}},"deleted":{"chemotherapy_dosage_units":{"changeType":"deleted","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate the total drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"description":{"left":"Name of agent or drug administered to patient as part of the treatment regimen.","right":"Name of agent or drug administered to donor as part of the treatment regimen."},"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"created","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{"hormone_drug_dosage_units":{"changeType":"deleted","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"radiation":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"radiation_therapy_fractions":{"description":{"left":"Indicate the number of total fractions delivered as part of treatment.","right":"Indicate the total number of fractions delivered as part of treatment."},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"radiation_therapy_dosage":{"valueType":{"left":"integer","right":"number"},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"anatomical_site_irradiated":{"description":{"left":"Indicate localization site where radiation therapy was administered.","right":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)"},"restrictions":{"codeList":{"left":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"right":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"data":{"added":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"],"deleted":["Bone","Extremities","Head-Neck","Peritoneum"]}}}}},"created":{"radiation_therapy_type":{"changeType":"created","name":"radiation_therapy_type","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal"]},"meta":{"core":true,"displayName":"Type of Radiation Therapy","notes":"Internal application includes Brachytherapy."}},"radiation_boost":{"changeType":"created","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"created","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}},"deleted":{"radiation_treatment_type":{"changeType":"deleted","name":"radiation_treatment_type","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal"]},"meta":{"core":true,"displayName":"Application Form","notes":"Internal application includes Brachytherapy."}}}},"follow_up":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_follow_up_id":{"description":{"left":"Unique identifier for a follow-up event in a donors clincal record, assigned by the data provider.","right":"Unique identifier for a follow-up event in a donor's clinical record, assigned by the data provider."},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"interval_of_followup":{"meta":{"notes":{"left":"The associated Primary Diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}}},"disease_status_at_followup":{"description":{"left":"Indicate the donor's disease status at time of follow-up.","right":"Indicate the donor's disease status at time of follow-up. (Reference: RECIST)"},"restrictions":{"codeList":{"left":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Relapse or recurrence","Stable"],"right":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Progression NOS","Relapse or recurrence","Stable"],"data":{"added":["Progression NOS"],"deleted":[]}}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"treatment.submitter_treatment_id"}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"weight_at_followup":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"relapse_type":{"restrictions":{"script":{"left":["(function validate() {\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"relapse_interval":{"restrictions":{"script":{"left":["(function validate() {\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"]}}},"method_of_progression_status":{"description":{"left":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Codelist reference: NCI CDE ID: 6161031)","right":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Reference: caDSR CDE ID 6161031)"},"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}},"restrictions":{"script":{"left":["(function validate() {\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}},"script":{"left":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n /* This is not a required field, so first ensure that it exists */\r\n if ($field) {\r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })()","(function validate() {\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_t_category":{"description":{"left":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"recurrence_n_category":{"description":{"left":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":true,"right":null}}},"recurrence_m_category":{"description":{"left":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"recurrence_stage_group":{"description":{"left":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery.","right":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) at the time of retreatment for a recurrence or disease progression."},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is dependent on the selected recurrence_tumour_staging_system.","right":"This field is dependent on the selected recurrence_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications"}},"restrictions":{"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.recurrence_tumour_staging_system && $field) {\r\n let codeList = [];\r\n switch ($row.recurrence_tumour_staging_system && $row.recurrence_tumour_staging_system.trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb',\r\n 'stage ive',\r\n 'stage ivs'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When 'recurrence_tumour_staging_system' is set to '${\r\n $row.recurrence_tumour_staging_system\r\n }', 'recurrence_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"posttherapy_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n /* This is not a required field, so first ensure that it exists */\r\n if ($field) {\r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"posttherapy_t_category":{"meta":{"dependsOn":{"left":"follow_up.post_therapy_tumour_staging_system","right":"follow_up.posttherapy_tumour_staging_system"}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"posttherapy_n_category":{"description":{"left":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"dependsOn":{"left":"follow_up.post_therapy_tumour_staging_system","right":"follow_up.posttherapy_tumour_staging_system"}}},"posttherapy_m_category":{"description":{"left":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"dependsOn":{"left":"follow_up.post_therapy_tumour_staging_system","right":"follow_up.posttherapy_tumour_staging_system"}},"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"posttherapy_stage_group":{"meta":{"dependsOn":{"left":"follow_up.post_therapy_tumour_staging_system","right":"follow_up.posttherapy_tumour_staging_system"},"notes":{"left":"This field is dependent on the selected posttherapy_tumour_staging_system.","right":"This field is dependent on the selected posttherapy_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications"}},"restrictions":{"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.posttherapy_tumour_staging_system && $field) {\r\n let codeList = [];\r\n switch ($row.posttherapy_tumour_staging_system && $row.posttherapy_tumour_staging_system.trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb',\r\n 'stage ive',\r\n 'stage ivs'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When 'posttherapy_tumour_staging_system' is set to '${\r\n $row.posttherapy_tumour_staging_system\r\n }', 'posttherapy_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}}},"created":{"anatomic_site_progression_or_recurrence":{"changeType":"created","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"anatomic_site_progression_or_recurrences":{"changeType":"deleted","description":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate() {\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })()"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1,C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}}}},"immunotherapy":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"immunotherapy_type":{"changeType":"created","name":"immunotherapy_type","valueType":"string","description":"Indicate the type of immunotherapy administered to donor.","meta":{"displayName":"Immunotherapy Type","core":true},"restrictions":{"required":true,"codeList":["Cell-based","Immune checkpoint inhibitors","Monoclonal antibodies other than immune checkpoint inhibitors","Other immunomodulatory substances"]}},"drug_rxnormcui":{"changeType":"created","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"created","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"created","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{}},"surgery":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"created","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"created","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"created","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"created","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"created","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"created","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"created","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"created","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"created","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"created","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"created","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"created","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"created","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"created","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}},"deleted":{}},"exposure":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"created","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"created","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"created","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"created","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"created","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"created","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"created","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"created","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"created","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"created","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"created","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"created","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"created","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}},"deleted":{}},"family_history":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"family_relative_id":{"changeType":"created","description":"Unique identifier of the relative, assigned by the data provider.","name":"family_relative_id","valueType":"string","meta":{"displayName":"Family Relative ID","primaryId":true,"notes":"This field is required to ensure that family members are identified in unique records. Ids can be as simple as an incremented numeral to ensure uniqueness."},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"relative_with_cancer_history":{"changeType":"created","description":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","name":"relative_with_cancer_history","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Relative with Cancer History"}},"relationship_type":{"changeType":"created","description":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","name":"relationship_type","restrictions":{"codeList":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"]},"valueType":"string","meta":{"displayName":"Relationship Type"}},"gender_of_relative":{"changeType":"created","description":"The self-reported gender of related individual.","name":"gender_of_relative","restrictions":{"codeList":["Female","Male","Other","Unknown"]},"valueType":"string","meta":{"displayName":"Gender of Relative"}},"age_of_relative_at_diagnosis":{"changeType":"created","description":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","name":"age_of_relative_at_diagnosis","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","displayName":"Age Of Relative At Diagnosis"}},"cancer_type_code_of_relative":{"changeType":"created","name":"cancer_type_code_of_relative","valueType":"string","description":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"examples":"C41.1,C16.9,C00.5,D46.9","dependsOn":"family_history.relative_with_cancer_history","displayName":"Cancer Type Code (ICD-10) of Relative"}},"relative_vital_status":{"changeType":"created","description":"Relative's last known state of living or deceased.","name":"relative_vital_status","restrictions":{"codeList":["Alive","Deceased","Unknown"]},"valueType":"string","meta":{"displayName":"Vital Status of Relative"}},"cause_of_death_of_relative":{"changeType":"created","description":"Indicate the cause of the death of the relative.","name":"cause_of_death_of_relative","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]},"valueType":"string","meta":{"dependsOn":"family_history.relative_vital_status","displayName":"Cause of Death of Relative"}},"relative_survival_time":{"changeType":"created","description":"Indicate how long, in days, the relative survived from the time they were diagnosed with cancer.","name":"relative_survival_time","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","units":"days","displayName":"Survival Time Of Relative"}}},"deleted":{}},"biomarker":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"created","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"created","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"created","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"created","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"created","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"created","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"created","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"created","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"created","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"created","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"created","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"created","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"created","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"created","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"created","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"created","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"created","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"created","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"created","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}},"deleted":{}},"comorbidity":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"created","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"created","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"created","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"created","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"created","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"created","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}},"deleted":{}}}} diff --git a/scripts/data/schemas/diffs/0.15/0.15-diff-1.24.json b/scripts/data/schemas/diffs/0.15/0.15-diff-1.24.json new file mode 100644 index 00000000..babd29ba --- /dev/null +++ b/scripts/data/schemas/diffs/0.15/0.15-diff-1.24.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"program_id":{"meta":{"examples":{"left":"PACA-AU,BR-CA","right":"TEST-CA"},"notes":{"left":"This is the unique id that is assigned to your program. If you have logged into the platform, this is the Program Id that you see in the Submission area. For example, PACA-CA is a Program ID.","right":"This is the unique id that is assigned to your program. If you have logged into the platform, this is the Program Id that you see in the Program Services area. For example, TEST-CA is a Program ID."}}},"submitter_donor_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"],"deleted":[]}},"script":{"left":["(function validate() {\n\n const row = $row;\n let result = {valid: true, message: \"Ok\"};\n \n const designation = row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\"){\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when tumour_normal_designation is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when tumour_normal_designation is set to Tumour.\"};\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"]}}},"submitter_sample_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased","Unknown"],"right":["Alive","Deceased"],"data":{"added":[],"deleted":["Unknown"]}}}},"cause_of_death":{"restrictions":{"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]}}},"survival_time":{"restrictions":{"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"primary_site":{"meta":{"notes":{"left":null,"right":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"examples":{"left":null,"right":"Breast|Ovary"}},"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Not Reported","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva","Unknown"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"data":{"added":["Unknown primary site"],"deleted":["Not Reported","Unknown"]}}}},"height":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"weight":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"bmi":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"menopause_status":{"description":{"left":"Indicate the donor's menopause status at the time of primary diagnosis. (Codelist reference: NCI CDE ID: 2434914)","right":"Indicate the donor's menopause status at the time of primary diagnosis. (Reference: caDSR CDE ID 2434914)"},"restrictions":{"codeList":{"left":["Indeterminate or unknown","Not applicable","Perimenopausal","Postmenopausal","Premenopausal"],"right":["Not applicable","Perimenopausal","Postmenopausal","Premenopausal","Unknown"],"data":{"added":["Unknown"],"deleted":["Indeterminate or unknown"]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age of menarche, the first occurrence of menstruation.","right":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)"},"restrictions":{}},"number_of_pregnancies":{"description":{"left":"Indicate the number of pregnancies a donor has had.","right":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)"},"restrictions":{}},"number_of_children":{"description":{"left":"Indicate the number of children the donor has birthed.","right":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)"},"restrictions":{}}},"created":{"genetic_disorders":{"changeType":"created","description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},"hrt_type":{"changeType":"created","description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},"hrt_duration":{"changeType":"created","description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},"contraception_type":{"changeType":"created","description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},"contraception_duration":{"changeType":"created","description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},"lost_to_followup_after_clinical_event_id":{"changeType":"created","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}},"deleted":{"prior_malignancy":{"changeType":"deleted","description":"Prior malignancy affecting donor.","name":"prior_malignancy","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy","examples":"C41.1, C16.9, C00.5, D46.9"}},"cancer_type_prior_malignancy":{"changeType":"deleted","description":"The code to represent the cancer type of a prior malignancy using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","name":"cancer_type_prior_malignancy","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"valueType":"string","meta":{"displayName":"Cancer Type Prior Malignancy"}},"age_at_prior_malignancy":{"changeType":"deleted","description":"If donor has history of prior malignancy, indicate age at previous diagnosis, in years.","name":"age_at_prior_malignancy","valueType":"integer","meta":{"displayName":"Age at Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"deleted","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Codelist reference: NCI CDE: 4122391)","name":"laterality_of_prior_malignancy","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality at Prior Malignancy"}}}},"specimen":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"description":{"left":"Indicate the primary diagnosis event in the clinical timeline that this specimen aquisition was related to.","right":"Indicate the primary diagnosis event in the clinical timeline that this specimen acquisition was related to."},"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"pathological_tumour_staging_system":{"meta":{"validationDependency":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"pathological_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"pathological_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"pathological_stage_group":{"description":{"left":"Specify the tumour stage, based on tumour_staging_system, used to assess the cancer at the time the tumour specimen was resected.","right":"Specify the tumour stage, based on pathological_tumour_staging_system, used to assess the cancer at the time the tumour specimen was resected."},"meta":{"notes":{"left":"This field depends on the selected pathological staging system, and is only required if the specimen is a tumour.","right":"This field depends on the selected pathological_tumour_staging_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications"}},"restrictions":{"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n if ($row.pathological_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.pathological_tumour_staging_system && $row.pathological_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'pathological_tumour_staging_system' is set to '${\n $row.pathological_tumour_staging_system\n }', 'pathological_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"specimen_acquisition_interval":{"meta":{"notes":{"left":"The associated Primary Diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."},"displayName":{"left":"Specimen Aquisition Interval","right":"Specimen Acquisition Interval"}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"specimen_storage":{"description":{"left":"Indicate the method of specimen storage for specimens that were not extracted freshly or immediately cultured.","right":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured."},"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"reference_pathology_confirmed":{"description":{"left":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. This only applies to clinical studies.","right":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)"}},"tumour_grading_system":{"meta":{"validationDependency":{"left":null,"right":true}}},"tumour_grade":{"meta":{"notes":{"left":"This field depends on the selected tumour grading system, and is only required if the specimen is a tumour.","right":"This field depends on the selected tumour_grading_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Grading Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-grading-classifications"}},"restrictions":{"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = \"'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.\";\n result.message = msg;\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"percent_tumour_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of infiltration by tumour cells in a specimen.","right":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)"},"restrictions":{}},"percent_proliferating_cells":{"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_inflammatory_tissue":{"description":{"left":"Indicate a value, in decimals, that represents local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue.","right":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_stromal_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a malignant tumour specimen but are not malignant such as fibroblasts, vascular structures, etc.","right":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_necrosis":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of cell death in a malignant tumour specimen.","right":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}}},"created":{"specimen_laterality":{"changeType":"created","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"percent_tumour_cells_measurement_method":{"changeType":"created","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}},"deleted":{}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"age_at_diagnosis":{"description":{"left":"Age that the donor was first diagnosed with cancer, in years.","right":"Age that the donor was first diagnosed with cancer, in years. This should be based on the earliest diagnosis of cancer."},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0,"max":90}}}},"number_lymph_nodes_positive":{"description":{"left":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: NCI CDE ID: 6113694)","right":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: caDSR CDE ID 6113694)"},"meta":{"dependsOn":{"left":null,"right":"primary_diagnosis.lymph_nodes_examined_status"},"notes":{"left":null,"right":"This field is only required if 'lymph_nodes_examined_status' is 'Yes'."}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"]},"range":{"left":null,"right":{"min":0}}}},"number_lymph_nodes_examined":{"description":{"left":"The total number of lymph nodes tested for the presence of cancer. (Reference: NCI CDE ID: 3)","right":"The total number of lymph nodes tested for the presence of cancer. (Reference: caDSR CDE ID 3)"},"meta":{"dependsOn":{"left":null,"right":"primary_diagnosis.lymph_nodes_examined_status"},"notes":{"left":null,"right":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'."}},"restrictions":{}},"clinical_tumour_staging_system":{"meta":{"validationDependency":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"required":{"left":true,"right":null},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"clinical_stage_group":{"description":{"left":"Stage group of the tumour, as assigned by the reporting tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.).","right":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage."},"meta":{"notes":{"left":"This field is dependent on the selected clinical_tumour_staging_system","right":"This field is dependent on the selected clinical_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications"},"examples":{"left":null,"right":"Stage I, Stage IIB"}},"restrictions":{"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n if ($row.clinical_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'clinical_tumour_staging_system' is set to '${\n $row.clinical_tumour_staging_system\n }', 'clinical_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"clinical_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"clinical_n_category":{"description":{"left":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"clinical_m_category":{"description":{"left":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned.","right":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned."},"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"presenting_symptoms":{"restrictions":{"codeList":{"left":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Nausea","None","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Unknown","Vomiting","Weight Loss"],"right":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Loss of Appetite","Nausea","None","Not Reported","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Swelling in the Neck","Unknown","Vomiting","Weight Loss"],"data":{"added":["Loss of Appetite","Not Reported","Swelling in the Neck"],"deleted":[]}}}},"performance_status":{"description":{"left":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference source: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status).","right":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status)."},"meta":{"notes":{"left":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction \n Grade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work) \n Grade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours \n Grade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours \n Grade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair","right":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction.\nGrade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work).\nGrade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours.\nGrade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours.\nGrade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair"}},"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}}},"created":{"cancer_type_additional_information":{"changeType":"created","name":"cancer_type_additional_information","valueType":"string","description":"Additional details related to the cancer type that are not covered by the ICD-10 code provided in the cancer_type field.","meta":{"displayName":"Cancer Type Additional Information"}},"laterality":{"changeType":"created","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_status":{"changeType":"created","name":"lymph_nodes_examined_status","description":"Indicate if lymph nodes were examined for metastases.","valueType":"string","restrictions":{"required":true,"codeList":["Cannot be determined","No","No lymph nodes found in resected specimen","Not applicable","Yes"]},"meta":{"core":true,"displayName":"Lymph Nodes Examined Status"}},"lymph_nodes_examined_method":{"changeType":"created","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}},"deleted":{}},"treatment":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"treatment_type":{"meta":{"notes":{"left":"Depending on the treatment_type(s) selected, additional treatment details may be required to be submitted. For example, if treatment_type includes 'Chemotherapy', the supplemental Chemotherapy treatment type file is required.","right":"Depending on the treatment_type(s) selected, additional treatment details may be required to be submitted. For example, if treatment_type includes 'Chemotherapy', the supplemental Chemotherapy treatment type file is required.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."},"examples":{"left":null,"right":"Chemotherapy|Hormonal therapy"}},"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":["End of life care"],"deleted":[]}}}},"is_primary_treatment":{"description":{"left":"Indicate if the treamtment was the primary treatment following the initial diagnosis.","right":"Indicate if the treatment was the primary treatment following the initial diagnosis."},"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Yes","No","Unknown"],"right":["Yes","No"],"data":{"added":[],"deleted":["Unknown"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"line_of_treatment":{"meta":{"dependsOn":{"left":null,"right":"treatment.is_primary_treatment"}},"restrictions":{}},"treatment_start_interval":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_duration":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"days_per_cycle":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{}},"number_of_cycles":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{}},"toxicity_type":{"description":{"left":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hemotological toxicity or non-hemotological toxicity.","right":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity."},"meta":{"dependsOn":{"left":null,"right":"treatment.outcome_of_treatment"}},"restrictions":{"codeList":{"left":["Hemotological","Non-hemotological"],"right":["Hematological","Non-hematological","Not applicable","Unknown"],"data":{"added":["Hematological","Non-hematological","Not applicable","Unknown"],"deleted":["Hemotological","Non-hemotological"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"]}}},"adverse_events":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"},"notes":{"left":null,"right":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"restrictions":{"codeList":{"left":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"right":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"data":{"added":["None","Unknown"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"clinical_trials_database":{"meta":{"notes":{"left":null,"right":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added."}},"restrictions":{"codeList":{"left":["NCI Clinical Trials","EU Clinical Trials Register"],"right":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"],"data":{"added":["Not applicable","Unknown"],"deleted":[]}}}},"clinical_trial_number":{"restrictions":{"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: 'The submitted NCI clinical trial number is in incorrect format.'};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: \"The submitted EudraCT clinical trial number is in incorrect format.\"};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: \"The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database.\"};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: \"'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.\"};\n } \n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"]}}}},"created":{"treatment_intent":{"changeType":"created","name":"treatment_intent","description":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"]},"meta":{"core":true,"displayName":"Treatment Intent","dependsOn":"treatment.treatment_type"}},"treatment_setting":{"changeType":"created","name":"treatment_setting","description":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: NCIt C124308)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"]},"meta":{"core":true,"displayName":"Treatment Setting","dependsOn":"treatment.treatment_type"}},"response_to_treatment_criteria_method":{"changeType":"created","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},"response_to_treatment":{"changeType":"created","name":"response_to_treatment","description":"The donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"codeList":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"]},"meta":{"core":true,"displayName":"Response To Treatment","dependsOn":"treatment.response_to_treatment_criteria_method","notes":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"outcome_of_treatment":{"changeType":"created","name":"outcome_of_treatment","description":"Indicate the donor's outcome of the prescribed treatment.","valueType":"string","restrictions":{"codeList":["Treatment completed as prescribed","Treatment incomplete due to technical or organizational problems","Treatment incomplete because patient died","Patient choice (stopped or interrupted treatment)","Physician decision (stopped or interrupted treatment)","Treatment stopped due to lack of efficacy (disease progression)","Treatment stopped due to acute toxicity","Other","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Outcome Of Treatment","dependsOn":"treatment.treatment_type"}},"hematological_toxicity":{"changeType":"created","name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"non-hematological_toxicity":{"changeType":"created","name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"age_at_consent_for_treatment":{"changeType":"deleted","name":"age_at_consent_for_treatment","description":"Indicate the age of donor when consent was given for treatment.","valueType":"integer","meta":{"displayName":"Age At Consent For Treatment"}},"therapeutic_intent":{"changeType":"deleted","name":"therapeutic_intent","description":"The therapeutic intent, the reason behind the choice of a therapy, of the treatment.","valueType":"string","restrictions":{"required":true,"codeList":["Adjuvant","Concurrent","Curative","Neoadjuvant","Not applicable","Palliative","Unknown"]},"meta":{"core":true,"displayName":"Therapeutic Intent"}},"response_to_therapy":{"changeType":"deleted","name":"response_to_therapy","description":"The donors's response to the applied treatment regimen. (Source: RECIST)","valueType":"string","restrictions":{"required":true,"codeList":["Complete response","Disease progression","NED","Partial response","Stable disease"]},"meta":{"core":true,"displayName":"Response To Therapy"}},"outcome_of_therapy":{"changeType":"deleted","name":"outcome_of_therapy","description":"Indicate the donor's outcome of the prescribed treatment.","valueType":"string","restrictions":{"codeList":["Treatment completed as prescribed","Treatment incomplete due to technical or organizational problems","Treatment incomplete because patient died","Patient choice (stopped or interrupted treatment)","Physician decision (stopped or interrupted treatment)","Treatment stopped due to lack of efficacy (disease progression)","Treatment stopped due to acute toxicity","Other","Not applicable","Unknown"]},"meta":{"displayName":"Outcome Of Therapy"}},"hemotological_toxicity":{"changeType":"deleted","name":"hemotological_toxicity","description":"Indicate the hemotological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5"]},"meta":{"displayName":"Hemotological Toxicity"}}}},"chemotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"description":{"left":"Name of agent or drug administered to patient as part of the treatment regimen.","right":"Name of agent or drug administered to donor as part of the treatment regimen."},"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"created","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"created","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"created","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"created","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}},"deleted":{"chemotherapy_dosage_units":{"changeType":"deleted","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate the total drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"description":{"left":"Name of agent or drug administered to patient as part of the treatment regimen.","right":"Name of agent or drug administered to donor as part of the treatment regimen."},"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"created","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{"hormone_drug_dosage_units":{"changeType":"deleted","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"radiation":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"radiation_therapy_fractions":{"description":{"left":"Indicate the number of total fractions delivered as part of treatment.","right":"Indicate the total number of fractions delivered as part of treatment."},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"radiation_therapy_dosage":{"valueType":{"left":"integer","right":"number"},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"anatomical_site_irradiated":{"description":{"left":"Indicate localization site where radiation therapy was administered.","right":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)"},"restrictions":{"codeList":{"left":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"right":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"data":{"added":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"],"deleted":["Bone","Extremities","Head-Neck","Peritoneum"]}}}}},"created":{"radiation_therapy_type":{"changeType":"created","name":"radiation_therapy_type","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal"]},"meta":{"core":true,"displayName":"Type of Radiation Therapy","notes":"Internal application includes Brachytherapy."}},"radiation_boost":{"changeType":"created","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"created","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}},"deleted":{"radiation_treatment_type":{"changeType":"deleted","name":"radiation_treatment_type","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal"]},"meta":{"core":true,"displayName":"Application Form","notes":"Internal application includes Brachytherapy."}}}},"follow_up":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_follow_up_id":{"description":{"left":"Unique identifier for a follow-up event in a donors clincal record, assigned by the data provider.","right":"Unique identifier for a follow-up event in a donor's clinical record, assigned by the data provider."},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"interval_of_followup":{"meta":{"notes":{"left":"The associated Primary Diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}}},"disease_status_at_followup":{"description":{"left":"Indicate the donor's disease status at time of follow-up.","right":"Indicate the donor's disease status at time of follow-up. (Reference: RECIST)"},"restrictions":{"codeList":{"left":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Relapse or recurrence","Stable"],"right":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Progression NOS","Relapse or recurrence","Stable"],"data":{"added":["Progression NOS"],"deleted":[]}}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"treatment.submitter_treatment_id"}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"weight_at_followup":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"relapse_type":{"restrictions":{"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"relapse_interval":{"restrictions":{"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"]}}},"method_of_progression_status":{"description":{"left":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Codelist reference: NCI CDE ID: 6161031)","right":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Reference: caDSR CDE ID 6161031)"},"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}},"restrictions":{"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}},"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_t_category":{"description":{"left":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"recurrence_n_category":{"description":{"left":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":true,"right":null}}},"recurrence_m_category":{"description":{"left":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"recurrence_stage_group":{"description":{"left":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery.","right":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) at the time of retreatment for a recurrence or disease progression."},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is dependent on the selected recurrence_tumour_staging_system.","right":"This field is dependent on the selected recurrence_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications"}},"restrictions":{"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n if ($row.recurrence_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.recurrence_tumour_staging_system && $row.recurrence_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'recurrence_tumour_staging_system' is set to '${\n $row.recurrence_tumour_staging_system\n }', 'recurrence_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"posttherapy_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"posttherapy_t_category":{"meta":{"dependsOn":{"left":"follow_up.post_therapy_tumour_staging_system","right":"follow_up.posttherapy_tumour_staging_system"}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"posttherapy_n_category":{"description":{"left":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"dependsOn":{"left":"follow_up.post_therapy_tumour_staging_system","right":"follow_up.posttherapy_tumour_staging_system"}}},"posttherapy_m_category":{"description":{"left":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"dependsOn":{"left":"follow_up.post_therapy_tumour_staging_system","right":"follow_up.posttherapy_tumour_staging_system"}},"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"posttherapy_stage_group":{"meta":{"dependsOn":{"left":"follow_up.post_therapy_tumour_staging_system","right":"follow_up.posttherapy_tumour_staging_system"},"notes":{"left":"This field is dependent on the selected posttherapy_tumour_staging_system.","right":"This field is dependent on the selected posttherapy_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications"}},"restrictions":{"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n if ($row.posttherapy_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.posttherapy_tumour_staging_system && $row.posttherapy_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'posttherapy_tumour_staging_system' is set to '${\n $row.posttherapy_tumour_staging_system\n }', 'posttherapy_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}}},"created":{"anatomic_site_progression_or_recurrence":{"changeType":"created","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"anatomic_site_progression_or_recurrences":{"changeType":"deleted","description":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })()"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1,C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}}}},"immunotherapy":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"immunotherapy_type":{"changeType":"created","name":"immunotherapy_type","valueType":"string","description":"Indicate the type of immunotherapy administered to donor.","meta":{"displayName":"Immunotherapy Type","core":true},"restrictions":{"required":true,"codeList":["Cell-based","Immune checkpoint inhibitors","Monoclonal antibodies other than immune checkpoint inhibitors","Other immunomodulatory substances"]}},"drug_rxnormcui":{"changeType":"created","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"created","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"created","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{}},"surgery":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"created","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"created","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"created","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"created","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"created","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"created","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"created","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"created","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"created","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"created","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"created","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"created","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"created","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"created","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}},"deleted":{}},"exposure":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"created","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"created","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"created","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"created","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"created","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"created","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"created","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"created","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"created","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"created","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"created","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"created","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"created","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}},"deleted":{}},"family_history":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"family_relative_id":{"changeType":"created","description":"Unique identifier of the relative, assigned by the data provider.","name":"family_relative_id","valueType":"string","meta":{"displayName":"Family Relative ID","primaryId":true,"notes":"This field is required to ensure that family members are identified in unique records. Ids can be as simple as an incremented numeral to ensure uniqueness."},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"relative_with_cancer_history":{"changeType":"created","description":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","name":"relative_with_cancer_history","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Relative with Cancer History"}},"relationship_type":{"changeType":"created","description":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","name":"relationship_type","restrictions":{"codeList":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"]},"valueType":"string","meta":{"displayName":"Relationship Type"}},"gender_of_relative":{"changeType":"created","description":"The self-reported gender of related individual.","name":"gender_of_relative","restrictions":{"codeList":["Female","Male","Other","Unknown"]},"valueType":"string","meta":{"displayName":"Gender of Relative"}},"age_of_relative_at_diagnosis":{"changeType":"created","description":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","name":"age_of_relative_at_diagnosis","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","displayName":"Age Of Relative At Diagnosis"}},"cancer_type_code_of_relative":{"changeType":"created","name":"cancer_type_code_of_relative","valueType":"string","description":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"examples":"C41.1,C16.9,C00.5,D46.9","dependsOn":"family_history.relative_with_cancer_history","displayName":"Cancer Type Code (ICD-10) of Relative"}},"relative_vital_status":{"changeType":"created","description":"Relative's last known state of living or deceased.","name":"relative_vital_status","restrictions":{"codeList":["Alive","Deceased","Unknown"]},"valueType":"string","meta":{"displayName":"Vital Status of Relative"}},"cause_of_death_of_relative":{"changeType":"created","description":"Indicate the cause of the death of the relative.","name":"cause_of_death_of_relative","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]},"valueType":"string","meta":{"dependsOn":"family_history.relative_vital_status","displayName":"Cause of Death of Relative"}},"relative_survival_time":{"changeType":"created","description":"Indicate how long, in days, the relative survived from the time they were diagnosed with cancer.","name":"relative_survival_time","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","units":"days","displayName":"Survival Time Of Relative"}}},"deleted":{}},"biomarker":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"created","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"created","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"created","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"created","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"created","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"created","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"created","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"created","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"created","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"created","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"created","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"created","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"created","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"created","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"created","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"created","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"created","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"created","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"created","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}},"deleted":{}},"comorbidity":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"created","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"created","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"created","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"created","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"created","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"created","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}},"deleted":{}}}} diff --git a/scripts/data/schemas/diffs/0.5/0.5-diff-1.24.json b/scripts/data/schemas/diffs/0.5/0.5-diff-1.24.json new file mode 100644 index 00000000..89c6b98c --- /dev/null +++ b/scripts/data/schemas/diffs/0.5/0.5-diff-1.24.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"program_id":{"meta":{"examples":{"left":"PACA-AU,BR-CA","right":"TEST-CA"},"notes":{"left":null,"right":"This is the unique id that is assigned to your program. If you have logged into the platform, this is the Program Id that you see in the Program Services area. For example, TEST-CA is a Program ID."},"displayName":{"left":null,"right":"Program ID"}}},"submitter_donor_id":{"meta":{"displayName":{"left":null,"right":"Submitter Donor ID"}}},"gender":{"meta":{"displayName":{"left":null,"right":"Gender"}}},"submitter_specimen_id":{"meta":{"displayName":{"left":null,"right":"Submitter Specimen ID"}}},"specimen_tissue_source":{"meta":{"displayName":{"left":null,"right":"Specimen Tissue Source"}}},"tumour_normal_designation":{"meta":{"displayName":{"left":null,"right":"Tumour Normal Designation"}}},"specimen_type":{"meta":{"displayName":{"left":null,"right":"Specimen Type"}},"restrictions":{"codeList":{"left":["Normal","Normal - tissue adjacent to primary tumour","Primary tumour","Primary tumour - adjacent to normal","Primary tumour - additional new primary","Recurrent tumour","Metastatic tumour","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour - additional metastatic","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line","Cell line - derived from xenograft tumour","Cell line - derived from tumour","Cell line - derived from normal"],"right":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"],"deleted":[]}},"script":{"left":["(function validate() {\n\n const row = $row;\n let result = {valid: true, message: \"Ok\"};\n \n const designation = row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\"){\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when tumour_normal_designation is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when tumour_normal_designation is set to Tumour.\"};\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"]}}},"submitter_sample_id":{"meta":{"displayName":{"left":null,"right":"Submitter Sample ID"}}},"sample_type":{"meta":{"displayName":{"left":null,"right":"Sample Type"}}}},"created":{},"deleted":{}},"donor":{"updated":{"program_id":{"meta":{"displayName":{"left":null,"right":"Program ID"}}},"submitter_donor_id":{"meta":{"displayName":{"left":null,"right":"Submitter Donor ID"}}},"vital_status":{"meta":{"displayName":{"left":null,"right":"Vital Status"}},"restrictions":{"codeList":{"left":["Alive","Deceased","Unknown"],"right":["Alive","Deceased"],"data":{"added":[],"deleted":["Unknown"]}}}},"cause_of_death":{"meta":{"displayName":{"left":null,"right":"Cause of Death"}},"restrictions":{"codeList":{"left":["Died of cancer","Died of other reasons"],"right":["Died of cancer","Died of other reasons","Unknown"],"data":{"added":["Unknown"],"deleted":[]}},"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]}}},"survival_time":{"meta":{"displayName":{"left":null,"right":"Survival Time"}},"restrictions":{"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"height":{"valueType":{"left":"integer","right":"number"},"meta":{},"restrictions":{}},"weight":{"valueType":{"left":"integer","right":"number"},"meta":{},"restrictions":{}},"bmi":{"valueType":{"left":"integer","right":"number"},"meta":{},"restrictions":{}},"menopause_status":{"description":{"left":"Indicate the donor's menopause status at the time of primary diagnosis. (Codelist reference: NCI CDE ID: 2434914)","right":"Indicate the donor's menopause status at the time of primary diagnosis. (Reference: caDSR CDE ID 2434914)"},"meta":{},"restrictions":{"codeList":{"left":["Premenopausal","Perimenopausal","Postmenopausal","Indeterminate or unknown","Not applicable"],"right":["Not applicable","Perimenopausal","Postmenopausal","Premenopausal","Unknown"],"data":{"added":["Unknown"],"deleted":["Indeterminate or unknown"]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age of menarche, the first occurrence of menstruation.","right":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)"},"meta":{},"restrictions":{}},"number_of_pregnancies":{"description":{"left":"Indicate the number of pregnancies a donor has had.","right":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)"},"meta":{},"restrictions":{}},"number_of_children":{"description":{"left":"Indicate the number of children the donor has birthed.","right":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)"},"meta":{},"restrictions":{}}},"created":{"primary_site":{"changeType":"created","name":"primary_site","valueType":"string","isArray":true,"description":"The text term used to describe the primary site of disease, as categorized by the World Health Organization's (WHO) International Classification of Diseases for Oncology (ICD-O). This categorization groups cases into general categories.","meta":{"displayName":"Primary Site","core":true,"notes":"To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Breast|Ovary"},"restrictions":{"required":true,"codeList":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"]}},"genetic_disorders":{"changeType":"created","description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},"hrt_type":{"changeType":"created","description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},"hrt_duration":{"changeType":"created","description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},"contraception_type":{"changeType":"created","description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},"contraception_duration":{"changeType":"created","description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},"lost_to_followup_after_clinical_event_id":{"changeType":"created","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}},"deleted":{"prior_malignancy":{"changeType":"deleted","description":"Prior malignancy affecting donor.","name":"prior_malignancy","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string"},"cancer_type_prior_malignancy":{"changeType":"deleted","description":"ICD-10 diagnostic code for type of cancer in a prior malignancy.","name":"cancer_type_prior_malignancy","restrictions":{"regex":"[A-Z]{1}[0-9]{2}.[0-9]{0,3}[A-Z]{0,1}$"},"valueType":"string"},"age_at_prior_malignancy":{"changeType":"deleted","description":"If donor has history of prior malignancy, indicate age at previous diagnosis, in years.","name":"age_at_prior_malignancy","valueType":"integer"},"laterality_of_prior_malignancy":{"changeType":"deleted","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis.","name":"laterality_of_prior_malignancy","valueType":"string"}}},"specimen":{"updated":{"program_id":{"meta":{"displayName":{"left":null,"right":"Program ID"}}},"submitter_donor_id":{"meta":{"displayName":{"left":null,"right":"Submitter Donor ID"}}},"submitter_specimen_id":{"meta":{"displayName":{"left":null,"right":"Submitter Specimen ID"}}},"pathological_tumour_staging_system":{"meta":{"validationDependency":{"left":null,"right":true},"displayName":{"left":null,"right":"Pathological Tumour Staging System"}},"restrictions":{"script":{"left":["(function validate() {\n\n let result = {valid: true, message: \"Ok\"};\n \n /* This is not a required field, so first ensure that it exists */\n if ($field){\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name.trim().toLowerCase().split('_tumour_staging_system')[0];\n /* Perform validation only if an AJCC value was selected */\n if (/^(AJCC)\\b/i.test($field)){\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`\n ];\n const convertedRow = Object.fromEntries(Object.entries($row).map(([fieldName,fieldVal]) => [fieldName.toLowerCase(), fieldVal]));\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(field => Object.keys(convertedRow).includes(field) && (!convertedRow[field] || checkforEmpty(convertedRow[field])))\n if (emptyFields.length){\n result = {valid: false, \"message\": `The following fields are required when ${$name} is set to an AJCC option: ${emptyFields}`};\n }\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"deleted":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"]}}}},"pathological_t_category":{"meta":{"displayName":{"left":null,"right":"Pathological T Category"}},"restrictions":{}},"pathological_n_category":{"meta":{"displayName":{"left":null,"right":"Pathological N Category"}},"restrictions":{}},"pathological_m_category":{"meta":{"displayName":{"left":null,"right":"Pathological M Category"}},"restrictions":{}},"pathological_stage_group":{"description":{"left":"Specify the tumour stage, based on tumor_staging_system, used to assess the cancer at the time the tumour specimen was resected.","right":"Specify the tumour stage, based on pathological_tumour_staging_system, used to assess the cancer at the time the tumour specimen was resected."},"meta":{"notes":{"left":null,"right":"This field depends on the selected pathological_tumour_staging_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications"},"displayName":{"left":null,"right":"Pathological Stage Group"}},"restrictions":{}},"specimen_acquisition_interval":{"meta":{"notes":{"left":null,"right":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."},"displayName":{"left":null,"right":"Specimen Acquisition Interval"}}},"tumour_histological_type":{"description":{"left":"The code to represent the histology (morphology) of neoplasms that is usually obtained from a pathology report, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Please refer to the guidelines provided in the ICD-O-3 manual at https://apps.who.int/iris/handle/10665/42344.","right":"The code to represent the histology (morphology) of neoplasms that is usually obtained from a pathology report, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344."},"meta":{"validationDependency":{"left":null,"right":true},"displayName":{"left":null,"right":"Tumour Histological Type"}}},"specimen_anatomic_location":{"description":{"left":"Anatomic location of a specimen when it was collected.","right":"Indicate the ICD-O-3 topography code for the anatomic location of a specimen when it was collected. Refer to the guidelines provided in the ICD-O-3 manual at https://apps.who.int/iris/handle/10665/42344."},"meta":{"displayName":{"left":null,"right":"Specimen Anatomic Location"},"examples":{"left":null,"right":"C50.1,C18"}},"restrictions":{"codeList":{"left":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear, pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal; distal","Esophageal; mid","Esophageal; proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck, NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es), maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"],"data":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear, pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal; distal","Esophageal; mid","Esophageal; proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck, NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es), maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"]},"regex":{"left":null,"right":"^[C][0-9]{2}(.[0-9]{1})?$"}}},"specimen_processing":{"meta":{},"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation, other","Formalin fixed & paraffin embedded","Formalin fixed, buffered","Formalin fixed, unbuffered","Fresh","Other"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"data":{"added":["Cryopreservation - other","Formalin fixed - buffered","Formalin fixed - unbuffered","Unknown"],"deleted":["Cryopreservation, other","Formalin fixed, buffered","Formalin fixed, unbuffered"]}}}},"specimen_storage":{"description":{"left":"Indicate the method of specimen storage for specimens that were not extracted freshly or immediately cultured.","right":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured."},"meta":{"displayName":{"left":null,"right":"Specimen Storage"}},"restrictions":{"codeList":{"left":["Cut slide","Frozen, -70 freezer","Frozen, liquid nitrogen","Frozen, vapor phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"data":{"added":["Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Unknown"],"deleted":["Frozen, -70 freezer","Frozen, liquid nitrogen","Frozen, vapor phase"]}}}},"tumour_grading_system":{"meta":{"validationDependency":{"left":null,"right":true},"displayName":{"left":null,"right":"Tumour Grading System"}},"restrictions":{"codeList":{"left":["Default","Gleason","Nottingham","Brain cancer","ISUP","Lymphoid neoplasms"],"right":["FNCLCC grading system","Four-tier grading system","Gleason grade group system","Grading system for GISTs","Grading system for GNETs","ISUP grading system","Nuclear grading system for DCIS","Scarff-Bloom-Richardson grading system","Three-tier grading system","Two-tier grading system","WHO grading system for CNS tumours"],"data":{"added":["FNCLCC grading system","Four-tier grading system","Gleason grade group system","Grading system for GISTs","Grading system for GNETs","ISUP grading system","Nuclear grading system for DCIS","Scarff-Bloom-Richardson grading system","Three-tier grading system","Two-tier grading system","WHO grading system for CNS tumours"],"deleted":["Default","Gleason","Nottingham","Brain cancer","ISUP","Lymphoid neoplasms"]}}}},"tumour_grade":{"meta":{"notes":{"left":"This field depends on the selected tumour grading system.","right":"This field depends on the selected tumour_grading_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Grading Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-grading-classifications"},"displayName":{"left":null,"right":"Tumour Grade"}},"restrictions":{"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'default':\n codeList = [\n 'gx - cannot be assessed',\n 'g1 well differentiated/low grade',\n 'g2 moderately differentiated/intermediated grade',\n 'g3 poorly differentiated/high grade',\n 'g4 undifferentiated/high grade',\n ];\n break;\n case 'gleason':\n codeList = [\n 'gleason x: gleason score cannot be determined',\n 'gleason 2–6: the tumor tissue is well differentiated',\n 'gleason 7: the tumor tissue is moderately differentiated',\n 'gleason 8–10: the tumor tissue is poorly differentiated or undifferentiated',\n ];\n break;\n case 'nottingham':\n codeList = [\n 'g1 (low grade or well differentiated)',\n 'g2 (intermediate grade or moderately differentiated)',\n 'g3 (high grade or poorly differentiated)',\n ];\n break;\n case 'brain cancer':\n codeList = ['grade i', 'grade ii', 'grade iii', 'grade iv'];\n break;\n case 'isup for renal cell carcinoma':\n codeList = [\n 'grade 1: tumor cell nucleoli invisible or small and basophilic at 400 x magnification',\n 'grade 2: tumor cell nucleoli conspicuous at 400 x magnification but inconspicuous at 100 x magnification',\n 'grade 3: tumor cell nucleoli eosinophilic and clearly visible at 100 x magnification',\n 'grade 4: tumors showing extreme nuclear pleomorphism and/or containing tumor giant cells and/or the presence of any proportion of tumor showing sarcomatoid and/or rhabdoid dedifferentiation',\n ];\n break;\n case 'lymphoid neoplasms':\n codeList = ['low grade or indolent nhl', 'high grade or aggressive nhl'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList.join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]},"codeList":{"right":["Low grade","High grade","GX","G1","G2","G3","G4","Low","High","Grade I","Grade II","Grade III","Grade IV","Grade Group 1","Grade Group 2","Grade Group 3","Grade Group 4","Grade Group 5"],"data":["Low grade","High grade","GX","G1","G2","G3","G4","Low","High","Grade I","Grade II","Grade III","Grade IV","Grade Group 1","Grade Group 2","Grade Group 3","Grade Group 4","Grade Group 5"]}}},"percent_tumour_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of infiltration by tumour cells in a specimen.","right":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)"},"meta":{"displayName":{"left":null,"right":"Percent Tumour Cells"}},"restrictions":{}},"percent_proliferating_cells":{"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."},"displayName":{"left":null,"right":"Percent Proliferating Cells"}},"restrictions":{}},"percent_inflammatory_tissue":{"description":{"left":"Indicate a value, in decimals, that represents local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue.","right":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."},"displayName":{"left":null,"right":"Percent Inflammatory Tissue"}},"restrictions":{}},"percent_stromal_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a malignant tumour specimen but are not malignant such as fibroblasts, vascular structures, etc.","right":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."},"displayName":{"left":null,"right":"Percent Stromal Cells"}},"restrictions":{}},"percent_necrosis":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of cell death in a malignant tumour specimen.","right":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."},"displayName":{"left":null,"right":"Percent Necrosis"}},"restrictions":{}}},"created":{"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate the primary diagnosis event in the clinical timeline that this specimen acquisition was related to.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"specimen_laterality":{"changeType":"created","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"reference_pathology_confirmed":{"changeType":"created","name":"reference_pathology_confirmed","description":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)","valueType":"string","meta":{"validationDependency":true,"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Reference Pathology Confirmed"},"restrictions":{"codeList":["Yes","No","Unknown"]}},"percent_tumour_cells_measurement_method":{"changeType":"created","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}},"deleted":{"central_pathology_confirmed":{"changeType":"deleted","name":"central_pathology_confirmed","description":"Indicate whether the histologic description of tissue or cells was confirmed by a pathology review of frozen or formalin fixed slide(s) completed after the diagnostic pathology review of the tumour sample used to extract analyte(s).","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour."},"restrictions":{"codeList":["Yes","No","Unknown"]}}}},"primary_diagnosis":{"updated":{"program_id":{"meta":{"displayName":{"left":null,"right":"Program ID"}}},"submitter_donor_id":{"meta":{"displayName":{"left":null,"right":"Submitter Donor ID"}}},"age_at_diagnosis":{"description":{"left":"Age that the donor was first diagnosed with cancer, in years.","right":"Age that the donor was first diagnosed with cancer, in years. This should be based on the earliest diagnosis of cancer."},"meta":{"displayName":{"left":null,"right":"Age at Diagnosis"}},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0,"max":90}}}},"cancer_type_code":{"description":{"left":"The code to represent the cancer type using the WHO ICD-10 code (https://icd.who.int/browse10/2016/en#/) classification.","right":"The code to represent the cancer type using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification."},"meta":{"examples":{"left":null,"right":"C41.1,C16.9,C00.5,D46.9"},"displayName":{"left":null,"right":"Cancer Type Code"}},"restrictions":{"regex":{"left":"[A-Z]{1}[0-9]{2}.[0-9]{0,3}[A-Z]{0,1}$","right":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"}}},"number_lymph_nodes_positive":{"description":{"left":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: NCI CDE ID: 6113694)","right":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: caDSR CDE ID 6113694)"},"meta":{"displayName":{"left":null,"right":"Number Of Lymph Nodes Positive"},"dependsOn":{"left":null,"right":"primary_diagnosis.lymph_nodes_examined_status"},"notes":{"left":null,"right":"This field is only required if 'lymph_nodes_examined_status' is 'Yes'."}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"]},"range":{"left":null,"right":{"min":0}}}},"number_lymph_nodes_examined":{"description":{"left":"The total number of lymph nodes tested for the presence of cancer. (Reference: NCI CDE ID: 3)","right":"The total number of lymph nodes tested for the presence of cancer. (Reference: caDSR CDE ID 3)"},"meta":{},"restrictions":{}},"clinical_tumour_staging_system":{"meta":{"validationDependency":{"left":null,"right":true},"displayName":{"left":null,"right":"Clinical Tumour Staging System"}},"restrictions":{"script":{"left":["(function validate() {\n\n let result = {valid: true, message: \"Ok\"};\n \n /* This is not a required field, so first ensure that it exists */\n if ($field){\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name.trim().toLowerCase().split('_tumour_staging_system')[0];\n /* Perform validation only if an AJCC value was selected */\n if (/^(AJCC)\\b/i.test($field)){\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`\n ];\n const convertedRow = Object.fromEntries(Object.entries($row).map(([fieldName,fieldVal]) => [fieldName.toLowerCase(), fieldVal]));\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(field => Object.keys(convertedRow).includes(field) && (!convertedRow[field] || checkforEmpty(convertedRow[field])))\n if (emptyFields.length){\n result = {valid: false, \"message\": `The following fields are required when ${$name} is set to an AJCC option: ${emptyFields}`};\n }\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"required":{"left":true,"right":null},"codeList":{"left":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"deleted":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"]}}}},"clinical_stage_group":{"description":{"left":"Stage group of the tumour, as assigned by the reporting tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.).","right":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage."},"meta":{"notes":{"left":null,"right":"This field is dependent on the selected clinical_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications"},"displayName":{"left":null,"right":"Clinical Stage Group"},"examples":{"left":null,"right":"Stage I, Stage IIB"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"clinical_t_category":{"meta":{"displayName":{"left":null,"right":"Clinical T Category"}},"restrictions":{}},"clinical_n_category":{"description":{"left":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"displayName":{"left":null,"right":"Clinical N Category"}},"restrictions":{}},"clinical_m_category":{"description":{"left":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned.","right":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned."},"meta":{"displayName":{"left":null,"right":"Clinical M Category"}},"restrictions":{}},"presenting_symptoms":{"meta":{},"restrictions":{"codeList":{"left":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Nausea","None","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Unknown","Vomiting","Weight Loss"],"right":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Loss of Appetite","Nausea","None","Not Reported","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Swelling in the Neck","Unknown","Vomiting","Weight Loss"],"data":{"added":["Loss of Appetite","Not Reported","Swelling in the Neck"],"deleted":[]}}}},"performance_status":{"description":{"left":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference source: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status).","right":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status)."},"meta":{"notes":{"left":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction \n Grade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work) \n Grade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours \n Grade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours \n Grade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair","right":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction.\nGrade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work).\nGrade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours.\nGrade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours.\nGrade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair"},"displayName":{"left":null,"right":"Performance Status"}},"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}}},"created":{"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Unique identifier of the primary diagnosis event, assigned by the data provider.","meta":{"primaryId":true,"displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"cancer_type_additional_information":{"changeType":"created","name":"cancer_type_additional_information","valueType":"string","description":"Additional details related to the cancer type that are not covered by the ICD-10 code provided in the cancer_type field.","meta":{"displayName":"Cancer Type Additional Information"}},"basis_of_diagnosis":{"changeType":"created","name":"basis_of_diagnosis","description":"Indicate the most valid basis of how the primary diagnosis was identified. If more than one diagnosis technique was used, select the term that has the highest code number (see notes). (Reference: IACR Standard for Basis of Diagnosis http://www.iacr.com.fr/images/doc/basis.pdf)","restrictions":{"codeList":["Clinical investigation","Clinical","Cytology","Death certificate only","Histology of a metastasis","Histology of a primary tumour","Specific tumour markers","Unknown"]},"valueType":"string","meta":{"notes":"0: Death certificate only: Information provided is from a death certificate.\n1: Clinical: Diagnosis made before death.\n2: Clinical investigation: All diagnostic techniques, including X-ray, endoscopy, imaging, ultrasound, exploratory surgery (such as laparotomy), and autopsy, without a tissue diagnosis.\n4: Specific tumour markers: Including biochemical and/or immunologic markers that are specific for a tumour site.\n5: Cytology: Examination of cells from a primary or secondary site, including fluids aspirated by endoscopy or needle; also includes the microscopic examination of peripheral blood and bone marrow aspirates.\n6: Histology of a metastasis: Histologic examination of tissue from a metastasis, including autopsy specimens.\n7: Histology of a primary tumour: Histologic examination of tissue from primary tumour, however obtained, including all cutting techniques and bone marrow biopsies; also includes autopsy specimens of primary tumour.\n9: Unknown: No information on how the diagnosis has been made.","displayName":"Basis of Diagnosis"}},"laterality":{"changeType":"created","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_status":{"changeType":"created","name":"lymph_nodes_examined_status","description":"Indicate if lymph nodes were examined for metastases.","valueType":"string","restrictions":{"required":true,"codeList":["Cannot be determined","No","No lymph nodes found in resected specimen","Not applicable","Yes"]},"meta":{"core":true,"displayName":"Lymph Nodes Examined Status"}},"lymph_nodes_examined_method":{"changeType":"created","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}},"deleted":{"stage_suffix":{"changeType":"deleted","name":"stage_suffix","description":"If necessary, use this field to add any applicable stage suffixes. Stage suffixes may apply to certain staging systems such as Ann Arbour staging system where the four stages are divided into 4 categories (A, B, X and E).","valueType":"string","meta":{"core":true,"dependsOn":"primary_diagnosis.clinical_tumour_staging_system"}}}},"treatment":{"updated":{"program_id":{"meta":{"displayName":{"left":null,"right":"Program ID"}}},"submitter_donor_id":{"meta":{"displayName":{"left":null,"right":"Submitter Donor ID"}}},"submitter_treatment_id":{"meta":{"displayName":{"left":null,"right":"Submitter Treatment ID"}}},"treatment_type":{"meta":{"notes":{"left":"Depending on the treatment_type selected, additional treament details may be required to be submitted.","right":"Depending on the treatment_type(s) selected, additional treatment details may be required to be submitted. For example, if treatment_type includes 'Chemotherapy', the supplemental Chemotherapy treatment type file is required.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."},"displayName":{"left":null,"right":"Treatment Type"},"examples":{"left":null,"right":"Chemotherapy|Hormonal therapy"}},"restrictions":{"codeList":{"left":["Chemotherapy","Ablation","Bone marrow transplant","Combined chemo+immunotherapy","Combined chemo+radiation therapy","Combined chemo-radiotherapy and surgery","Endoscopic therapy","Hormonal therapy","Immunotherapy","Monoclonal antibodies (for liquid tumours)","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgical resection"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":["End of life care","Surgery"],"deleted":["Combined chemo+immunotherapy","Combined chemo+radiation therapy","Combined chemo-radiotherapy and surgery","Monoclonal antibodies (for liquid tumours)","Surgical resection"]}}}},"is_primary_treatment":{"description":{"left":"Indicate if the treamtment was the primary treatment following the initial diagnosis.","right":"Indicate if the treatment was the primary treatment following the initial diagnosis."},"meta":{"displayName":{"left":null,"right":"Is Primary Treatment"},"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Yes","No","Unknown"],"right":["Yes","No"],"data":{"added":[],"deleted":["Unknown"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_start_interval":{"description":{"left":"The interval between primary diagnosis and initiation of treatment, in days.","right":"The interval between the primary diagnosis and initiation of treatment, in days."},"meta":{"notes":{"left":null,"right":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."},"displayName":{"left":null,"right":"Treatment Start Interval"},"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_duration":{"description":{"left":"The duration of treatment regimen, in days","right":"The duration of treatment regimen, in days."},"meta":{"displayName":{"left":null,"right":"Treatment Duration"},"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}}},"created":{"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate the primary diagnosis event in the clinical timeline that this treatment was related to.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"line_of_treatment":{"changeType":"created","name":"line_of_treatment","description":"Indicate the line of treatment if it is not the primary treatment.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Line Of treatment","dependsOn":"treatment.is_primary_treatment","examples":"2,3,4"}},"days_per_cycle":{"changeType":"created","name":"days_per_cycle","description":"Indicate the number of days in a treatment cycle.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Days Per Cycle","dependsOn":"treatment.treatment_type"}},"number_of_cycles":{"changeType":"created","name":"number_of_cycles","description":"Indicate the number of treatment cycles.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Number Of Cycles","dependsOn":"treatment.treatment_type"}},"treatment_intent":{"changeType":"created","name":"treatment_intent","description":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"]},"meta":{"core":true,"displayName":"Treatment Intent","dependsOn":"treatment.treatment_type"}},"treatment_setting":{"changeType":"created","name":"treatment_setting","description":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: NCIt C124308)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"]},"meta":{"core":true,"displayName":"Treatment Setting","dependsOn":"treatment.treatment_type"}},"response_to_treatment_criteria_method":{"changeType":"created","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},"response_to_treatment":{"changeType":"created","name":"response_to_treatment","description":"The donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"codeList":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"]},"meta":{"core":true,"displayName":"Response To Treatment","dependsOn":"treatment.response_to_treatment_criteria_method","notes":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"outcome_of_treatment":{"changeType":"created","name":"outcome_of_treatment","description":"Indicate the donor's outcome of the prescribed treatment.","valueType":"string","restrictions":{"codeList":["Treatment completed as prescribed","Treatment incomplete due to technical or organizational problems","Treatment incomplete because patient died","Patient choice (stopped or interrupted treatment)","Physician decision (stopped or interrupted treatment)","Treatment stopped due to lack of efficacy (disease progression)","Treatment stopped due to acute toxicity","Other","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Outcome Of Treatment","dependsOn":"treatment.treatment_type"}},"toxicity_type":{"changeType":"created","name":"toxicity_type","description":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity.","valueType":"string","restrictions":{"codeList":["Hematological","Non-hematological","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Toxicity Type","dependsOn":"treatment.outcome_of_treatment"}},"hematological_toxicity":{"changeType":"created","name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"non-hematological_toxicity":{"changeType":"created","name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"adverse_events":{"changeType":"created","name":"adverse_events","description":"Report any treatment related adverse events. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Adverse Events","dependsOn":"treatment.treatment_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"clinical_trials_database":{"changeType":"created","name":"clinical_trials_database","description":"If the donor is a participant in a clinical trial, indicate the clinical trial database where the clinical trial is registered.","valueType":"string","meta":{"display name":"Clinical Trials Database","notes":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added."},"restrictions":{"codeList":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"]}},"clinical_trial_number":{"changeType":"created","name":"clinical_trial_number","description":"Based on the clinical_trial_database, indicate the unique NCT or EudraCT clinical trial identifier of which the donor is a participant.","valueType":"string","meta":{"display name":"Clinical Trial Number","dependsOn":"treatment.clinical_trials_database","examples":"2016-002120-83,NCT02465060"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"]}}},"deleted":{"age_at_consent_for_treatment":{"changeType":"deleted","name":"age_at_consent_for_treatment","description":"Indicate the age of donor when consent was given for treatment.","valueType":"integer"},"therapeutic_intent":{"changeType":"deleted","name":"therapeutic_intent","description":"The therapeutic intent, the reason behind the choice of a therapy, of the treatment.","valueType":"string","restrictions":{"required":true,"codeList":["Adjuvant","Concurrent","Curative","Neoadjuvant","Not applicable","Palliative","Unknown"]},"meta":{"core":true}},"response_to_therapy":{"changeType":"deleted","name":"response_to_therapy","description":"The donors's response to the applied treatment regimen. (Source: RECIST)","valueType":"string","restrictions":{"required":true,"codeList":["Complete response","Disease progression","NED","Partial response","Stable disease"]},"meta":{"core":true}}}},"chemotherapy":{"updated":{"program_id":{"meta":{"displayName":{"left":null,"right":"Program ID"}}},"submitter_donor_id":{"meta":{"displayName":{"left":null,"right":"Submitter Donor ID"}}},"submitter_treatment_id":{"meta":{"displayName":{"left":null,"right":"Submitter Treatment ID"}}}},"created":{"drug_rxnormcui":{"changeType":"created","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"created","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"created","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"created","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"created","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"created","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}},"deleted":{"chemotherapy_drug_name":{"changeType":"deleted","name":"chemotherapy_drug_name","description":"Name of agent or drug administered to patient as part of the chemotherapy treatment regimen.","valueType":"string","restrictions":{"required":true,"codeList":["Placeholder list 1","Need list","Still need it"]},"meta":{"validationDependency":true,"core":true,"notes":"This field uses a controlled vocabulary gathered from the DrugBank database of drug names.","examples":"Allopurinol, Dronabinol, Sucralfate, Lapatinib"}},"chemotherapy_dosage_units":{"changeType":"deleted","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m²","IU/m²","µg/m²","g/m²","kg"]},"meta":{"core":true}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate the total drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"integer","restrictions":{"required":true},"meta":{"core":true}}}},"hormone_therapy":{"updated":{"program_id":{"meta":{"displayName":{"left":null,"right":"Program ID"}}},"submitter_donor_id":{"meta":{"displayName":{"left":null,"right":"Submitter Donor ID"}}},"submitter_treatment_id":{"meta":{"displayName":{"left":null,"right":"Submitter Treatment ID"}}}},"created":{"drug_rxnormcui":{"changeType":"created","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"created","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Hormone Therapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"created","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{"hormone_therapy_drug_name":{"changeType":"deleted","name":"hormone_therapy_drug_name","description":"Name of agent or drug administered to patient as part of the hormone therapy treatment regimen.","valueType":"string","restrictions":{"required":true,"codeList":["Placeholder list 1","Need list","Still need it"]},"meta":{"validationDependency":true,"core":true,"notes":"This field uses a controlled vocabulary gathered from the DrugBank database of drug names."}},"hormone_drug_dosage_units":{"changeType":"deleted","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m²","IU/m²","µg/m²","g/m²","kg "]},"meta":{"core":true}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"integer","restrictions":{"required":true},"meta":{"core":true}}}},"radiation":{"updated":{"program_id":{"meta":{"displayName":{"left":null,"right":"Program ID"}}},"submitter_donor_id":{"meta":{"displayName":{"left":null,"right":"Submitter Donor ID"}}},"submitter_treatment_id":{"meta":{"displayName":{"left":null,"right":"Submitter Treatment ID"}}},"radiation_therapy_modality":{"meta":{"displayName":{"left":null,"right":"Radiation Therapy Modality"}}},"radiation_therapy_fractions":{"description":{"left":"Indicate the number of total fractions delivered as part of treatment.","right":"Indicate the total number of fractions delivered as part of treatment."},"meta":{"displayName":{"left":null,"right":"Radiation Therapy Fractions"}},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"radiation_therapy_dosage":{"valueType":{"left":"integer","right":"number"},"meta":{"displayName":{"left":null,"right":"Radiation Therapy Dosage"}},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"anatomical_site_irradiated":{"description":{"left":"Indicate localization site where radiation therapy was administered.","right":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)"},"meta":{"displayName":{"left":null,"right":"Anatomical Site Irradiated"}},"restrictions":{"codeList":{"left":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"right":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"data":{"added":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"],"deleted":["Bone","Extremities","Head-Neck","Peritoneum"]}}}}},"created":{"radiation_therapy_type":{"changeType":"created","name":"radiation_therapy_type","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal"]},"meta":{"core":true,"displayName":"Type of Radiation Therapy","notes":"Internal application includes Brachytherapy."}},"radiation_boost":{"changeType":"created","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"created","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}},"deleted":{"application_form":{"changeType":"deleted","name":"application_form","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal (including Brachytherapy)"]},"meta":{"core":true}}}},"follow_up":{"updated":{"program_id":{"meta":{"displayName":{"left":null,"right":"Program ID"}}},"submitter_donor_id":{"meta":{"displayName":{"left":null,"right":"Submitter Donor ID"}}},"submitter_follow_up_id":{"description":{"left":"Unique identifier for a follow-up event in a donors clincal record, assigned by the data provider.","right":"Unique identifier for a follow-up event in a donor's clinical record, assigned by the data provider."},"meta":{"displayName":{"left":null,"right":"Submitter Follow-Up ID"}}},"interval_of_followup":{"description":{"left":"Interval from the primary diagnosis date to the follow up date, in days.","right":"Interval from the primary diagnosis date to the follow-up date, in days."},"meta":{"displayName":{"left":null,"right":"Interval Of Follow-Up"},"notes":{"left":null,"right":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}}},"disease_status_at_followup":{"description":{"left":"Indicate the donor's disease status at time of follow-up.","right":"Indicate the donor's disease status at time of follow-up. (Reference: RECIST)"},"meta":{"displayName":{"left":null,"right":"Disease Status at Follow-Up"}},"restrictions":{"codeList":{"left":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Relapse","Stable"],"right":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Progression NOS","Relapse or recurrence","Stable"],"data":{"added":["Progression NOS","Relapse or recurrence"],"deleted":["Relapse"]}}}},"relapse_type":{"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."},"displayName":{"left":null,"right":"Relapse Type"}},"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"relapse_interval":{"description":{"left":"If the donor was clinically disease free following primary treatment and then relapse or progression (for liquid tumours) occurred afterwards, then this field will indicate the length of disease free interval, in days.","right":"If the donor was clinically disease free following primary treatment and then relapse or recurrence or progression (for liquid tumours) occurred afterwards, then this field will indicate the length of disease free interval, in days."},"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."},"displayName":{"left":null,"right":"Relapse Interval"}},"restrictions":{"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"]}}},"method_of_progression_status":{"description":{"left":"Indicate the method(s) used to confirm the donor's progression disease status. (Codelist reference: NCI CDE ID: 6161031)","right":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Reference: caDSR CDE ID 6161031)"},"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."},"displayName":{"left":null,"right":"Method Of Progression Status"}},"restrictions":{"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]},"codeList":{"left":["Autopsy","Biomarker in liquid biopsy (e.g. tumor marker in blood or urine)","Biopsy","Blood draw","Bone marrow aspirate","Core biopsy","Cystoscopy","Cytology","Debulking","Diagnostic imaging","Dilation and curettage procedure","Enucleation","Excisional biopsy","Fine needle aspiration","Imaging","Incisional biopsy","Laparoscopy","Laparotomy","Other","Pap Smear","Pathologic review","Physical exam","Surgical resection","Thoracentesis","Ultrasound guided biopsy"],"right":["Biomarker in liquid biopsy (e.g. tumour marker in blood or urine)","Biopsy","Blood draw","Bone marrow aspirate","Core biopsy","Cystoscopy","Cytology","Debulking","Diagnostic imaging","Dilation and curettage procedure","Enucleation","Excisional biopsy","Fine needle aspiration","Imaging","Incisional biopsy","Laparoscopy","Laparotomy","Other","Pap Smear","Pathologic review","Physical exam","Surgical resection","Thoracentesis","Ultrasound guided biopsy"],"data":{"added":["Biomarker in liquid biopsy (e.g. tumour marker in blood or urine)"],"deleted":["Autopsy","Biomarker in liquid biopsy (e.g. tumor marker in blood or urine)"]}}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."},"displayName":{"left":null,"right":"Recurrance Tumour Staging System"}},"restrictions":{"codeList":{"left":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"deleted":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"]}},"script":{"left":["(function validate() {\n\n let result = {valid: true, message: \"Ok\"};\n \n /* This is not a required field, so first ensure that it exists */\n if ($field){\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name.trim().toLowerCase().split('_tumour_staging_system')[0];\n /* Perform validation only if an AJCC value was selected */\n if (/^(AJCC)\\b/i.test($field)){\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`\n ];\n const convertedRow = Object.fromEntries(Object.entries($row).map(([fieldName,fieldVal]) => [fieldName.toLowerCase(), fieldVal]));\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(field => Object.keys(convertedRow).includes(field) && (!convertedRow[field] || checkforEmpty(convertedRow[field])))\n if (emptyFields.length){\n result = {valid: false, \"message\": `The following fields are required when ${$name} is set to an AJCC option: ${emptyFields}`};\n }\n }\n }\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_t_category":{"description":{"left":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":true,"right":null},"displayName":{"left":null,"right":"Recurrence T Category"}},"restrictions":{}},"recurrence_n_category":{"description":{"left":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":true,"right":null},"displayName":{"left":null,"right":"Recurrence N Category"}},"restrictions":{}},"recurrence_m_category":{"description":{"left":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":true,"right":null},"displayName":{"left":null,"right":"Recurrence M Category"}},"restrictions":{}},"recurrence_stage_group":{"description":{"left":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery.","right":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) at the time of retreatment for a recurrence or disease progression."},"meta":{"core":{"left":true,"right":null},"notes":{"left":null,"right":"This field is dependent on the selected recurrence_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications"},"displayName":{"left":null,"right":"Recurrence Stage Group"}},"restrictions":{}},"posttherapy_tumour_staging_system":{"meta":{},"restrictions":{"script":{"left":["(function validate() {\n\n let result = {valid: true, message: \"Ok\"};\n \n /* This is not a required field, so first ensure that it exists */\n if ($field){\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name.trim().toLowerCase().split('_tumour_staging_system')[0];\n /* Perform validation only if an AJCC value was selected */\n if (/^(AJCC)\\b/i.test($field)){\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`\n ];\n const convertedRow = Object.fromEntries(Object.entries($row).map(([fieldName,fieldVal]) => [fieldName.toLowerCase(), fieldVal]));\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(field => Object.keys(convertedRow).includes(field) && (!convertedRow[field] || checkforEmpty(convertedRow[field])))\n if (emptyFields.length){\n result = {valid: false, \"message\": `The following fields are required when ${$name} is set to an AJCC option: ${emptyFields}`};\n }\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"deleted":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"]}}}},"posttherapy_t_category":{"meta":{"dependsOn":{"left":"follow_up.post_therapy_tumour_staging_system","right":"follow_up.posttherapy_tumour_staging_system"},"displayName":{"left":null,"right":"Post-therapy T Category"}},"restrictions":{}},"posttherapy_n_category":{"description":{"left":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"dependsOn":{"left":"follow_up.post_therapy_tumour_staging_system","right":"follow_up.posttherapy_tumour_staging_system"},"displayName":{"left":null,"right":"Post-therapy N Category"}},"restrictions":{}},"posttherapy_m_category":{"description":{"left":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"dependsOn":{"left":"follow_up.post_therapy_tumour_staging_system","right":"follow_up.posttherapy_tumour_staging_system"},"displayName":{"left":null,"right":"Post-therapy M Category"}},"restrictions":{}},"posttherapy_stage_group":{"meta":{"dependsOn":{"left":"follow_up.post_therapy_tumour_staging_system","right":"follow_up.posttherapy_tumour_staging_system"},"notes":{"left":"This field value is dependent on the selected posttherapy_tumour_staging_system.","right":"This field is dependent on the selected posttherapy_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications"},"displayName":{"left":null,"right":"Post-therapy Stage Group"}},"restrictions":{}}},"created":{"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate if the follow-up is related to a specific primary diagnosis event in the clinical timeline.","meta":{"validationDependency":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID","primaryId":true},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"Indicate if the follow-up is related to a specific treatment event in the clinical timeline.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"weight_at_followup":{"changeType":"created","description":"Indicate the donor's weight, in kilograms (kg), at the time of follow-up.","name":"weight_at_followup","valueType":"number","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Weight at Follow-Up"}},"anatomic_site_progression_or_recurrence":{"changeType":"created","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"anatomic_site_progression_or_recurrences":{"changeType":"deleted","description":"Indicate the anatomic site where disease progression or recurrence occurred. (Codelist reference: NCI CDE ID: 4742851)","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"],"codeList":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear, pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal; distal","Esophageal; mid","Esophageal; proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck, NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es), maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"]},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","notes":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse."}}}},"immunotherapy":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"immunotherapy_type":{"changeType":"created","name":"immunotherapy_type","valueType":"string","description":"Indicate the type of immunotherapy administered to donor.","meta":{"displayName":"Immunotherapy Type","core":true},"restrictions":{"required":true,"codeList":["Cell-based","Immune checkpoint inhibitors","Monoclonal antibodies other than immune checkpoint inhibitors","Other immunomodulatory substances"]}},"drug_rxnormcui":{"changeType":"created","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"created","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"created","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{}},"surgery":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"created","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"created","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"created","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"created","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"created","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"created","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"created","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"created","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"created","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"created","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"created","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"created","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"created","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"created","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}},"deleted":{}},"exposure":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"created","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"created","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"created","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"created","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"created","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"created","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"created","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"created","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"created","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"created","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"created","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"created","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"created","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}},"deleted":{}},"family_history":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"family_relative_id":{"changeType":"created","description":"Unique identifier of the relative, assigned by the data provider.","name":"family_relative_id","valueType":"string","meta":{"displayName":"Family Relative ID","primaryId":true,"notes":"This field is required to ensure that family members are identified in unique records. Ids can be as simple as an incremented numeral to ensure uniqueness."},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"relative_with_cancer_history":{"changeType":"created","description":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","name":"relative_with_cancer_history","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Relative with Cancer History"}},"relationship_type":{"changeType":"created","description":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","name":"relationship_type","restrictions":{"codeList":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"]},"valueType":"string","meta":{"displayName":"Relationship Type"}},"gender_of_relative":{"changeType":"created","description":"The self-reported gender of related individual.","name":"gender_of_relative","restrictions":{"codeList":["Female","Male","Other","Unknown"]},"valueType":"string","meta":{"displayName":"Gender of Relative"}},"age_of_relative_at_diagnosis":{"changeType":"created","description":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","name":"age_of_relative_at_diagnosis","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","displayName":"Age Of Relative At Diagnosis"}},"cancer_type_code_of_relative":{"changeType":"created","name":"cancer_type_code_of_relative","valueType":"string","description":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"examples":"C41.1,C16.9,C00.5,D46.9","dependsOn":"family_history.relative_with_cancer_history","displayName":"Cancer Type Code (ICD-10) of Relative"}},"relative_vital_status":{"changeType":"created","description":"Relative's last known state of living or deceased.","name":"relative_vital_status","restrictions":{"codeList":["Alive","Deceased","Unknown"]},"valueType":"string","meta":{"displayName":"Vital Status of Relative"}},"cause_of_death_of_relative":{"changeType":"created","description":"Indicate the cause of the death of the relative.","name":"cause_of_death_of_relative","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]},"valueType":"string","meta":{"dependsOn":"family_history.relative_vital_status","displayName":"Cause of Death of Relative"}},"relative_survival_time":{"changeType":"created","description":"Indicate how long, in days, the relative survived from the time they were diagnosed with cancer.","name":"relative_survival_time","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","units":"days","displayName":"Survival Time Of Relative"}}},"deleted":{}},"biomarker":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"created","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"created","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"created","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"created","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"created","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"created","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"created","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"created","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"created","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"created","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"created","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"created","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"created","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"created","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"created","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"created","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"created","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"created","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"created","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}},"deleted":{}},"comorbidity":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"created","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"created","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"created","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"created","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"created","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"created","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}},"deleted":{}}}} diff --git a/scripts/data/schemas/diffs/0.6/0.6-diff-1.24.json b/scripts/data/schemas/diffs/0.6/0.6-diff-1.24.json new file mode 100644 index 00000000..96dea50b --- /dev/null +++ b/scripts/data/schemas/diffs/0.6/0.6-diff-1.24.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"program_id":{"meta":{"examples":{"left":"PACA-AU,BR-CA","right":"TEST-CA"},"notes":{"left":null,"right":"This is the unique id that is assigned to your program. If you have logged into the platform, this is the Program Id that you see in the Program Services area. For example, TEST-CA is a Program ID."},"displayName":{"left":null,"right":"Program ID"}}},"submitter_donor_id":{"meta":{"displayName":{"left":null,"right":"Submitter Donor ID"}}},"gender":{"meta":{"displayName":{"left":null,"right":"Gender"}}},"submitter_specimen_id":{"meta":{"displayName":{"left":null,"right":"Submitter Specimen ID"}}},"specimen_tissue_source":{"meta":{"displayName":{"left":null,"right":"Specimen Tissue Source"}}},"tumour_normal_designation":{"meta":{"displayName":{"left":null,"right":"Tumour Normal Designation"}}},"specimen_type":{"meta":{"displayName":{"left":null,"right":"Specimen Type"}},"restrictions":{"codeList":{"left":["Normal","Normal - tissue adjacent to primary tumour","Primary tumour","Primary tumour - adjacent to normal","Primary tumour - additional new primary","Recurrent tumour","Metastatic tumour","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour - additional metastatic","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line","Cell line - derived from xenograft tumour","Cell line - derived from tumour","Cell line - derived from normal"],"right":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"],"deleted":[]}},"script":{"left":["(function validate() {\n\n const row = $row;\n let result = {valid: true, message: \"Ok\"};\n \n const designation = row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\"){\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when tumour_normal_designation is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when tumour_normal_designation is set to Tumour.\"};\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"]}}},"submitter_sample_id":{"meta":{"displayName":{"left":null,"right":"Submitter Sample ID"}}},"sample_type":{"meta":{"displayName":{"left":null,"right":"Sample Type"}}}},"created":{},"deleted":{}},"donor":{"updated":{"program_id":{"meta":{"displayName":{"left":null,"right":"Program ID"}}},"submitter_donor_id":{"meta":{"displayName":{"left":null,"right":"Submitter Donor ID"}}},"vital_status":{"meta":{"displayName":{"left":null,"right":"Vital Status"}},"restrictions":{"codeList":{"left":["Alive","Deceased","Unknown"],"right":["Alive","Deceased"],"data":{"added":[],"deleted":["Unknown"]}}}},"cause_of_death":{"meta":{"displayName":{"left":null,"right":"Cause of Death"}},"restrictions":{"codeList":{"left":["Died of cancer","Died of other reasons"],"right":["Died of cancer","Died of other reasons","Unknown"],"data":{"added":["Unknown"],"deleted":[]}},"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]}}},"survival_time":{"meta":{"displayName":{"left":null,"right":"Survival Time"}},"restrictions":{"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"height":{"valueType":{"left":"integer","right":"number"},"meta":{},"restrictions":{}},"weight":{"valueType":{"left":"integer","right":"number"},"meta":{},"restrictions":{}},"bmi":{"valueType":{"left":"integer","right":"number"},"meta":{},"restrictions":{}},"menopause_status":{"description":{"left":"Indicate the donor's menopause status at the time of primary diagnosis. (Codelist reference: NCI CDE ID: 2434914)","right":"Indicate the donor's menopause status at the time of primary diagnosis. (Reference: caDSR CDE ID 2434914)"},"meta":{},"restrictions":{"codeList":{"left":["Premenopausal","Perimenopausal","Postmenopausal","Indeterminate or unknown","Not applicable"],"right":["Not applicable","Perimenopausal","Postmenopausal","Premenopausal","Unknown"],"data":{"added":["Unknown"],"deleted":["Indeterminate or unknown"]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age of menarche, the first occurrence of menstruation.","right":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)"},"meta":{},"restrictions":{}},"number_of_pregnancies":{"description":{"left":"Indicate the number of pregnancies a donor has had.","right":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)"},"meta":{},"restrictions":{}},"number_of_children":{"description":{"left":"Indicate the number of children the donor has birthed.","right":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)"},"meta":{},"restrictions":{}}},"created":{"primary_site":{"changeType":"created","name":"primary_site","valueType":"string","isArray":true,"description":"The text term used to describe the primary site of disease, as categorized by the World Health Organization's (WHO) International Classification of Diseases for Oncology (ICD-O). This categorization groups cases into general categories.","meta":{"displayName":"Primary Site","core":true,"notes":"To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Breast|Ovary"},"restrictions":{"required":true,"codeList":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"]}},"genetic_disorders":{"changeType":"created","description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},"hrt_type":{"changeType":"created","description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},"hrt_duration":{"changeType":"created","description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},"contraception_type":{"changeType":"created","description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},"contraception_duration":{"changeType":"created","description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},"lost_to_followup_after_clinical_event_id":{"changeType":"created","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}},"deleted":{"prior_malignancy":{"changeType":"deleted","description":"Prior malignancy affecting donor.","name":"prior_malignancy","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string"},"cancer_type_prior_malignancy":{"changeType":"deleted","description":"ICD-10 diagnostic code for type of cancer in a prior malignancy.","name":"cancer_type_prior_malignancy","restrictions":{"regex":"[A-Z]{1}[0-9]{2}.[0-9]{0,3}[A-Z]{0,1}$"},"valueType":"string"},"age_at_prior_malignancy":{"changeType":"deleted","description":"If donor has history of prior malignancy, indicate age at previous diagnosis, in years.","name":"age_at_prior_malignancy","valueType":"integer"},"laterality_of_prior_malignancy":{"changeType":"deleted","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis.","name":"laterality_of_prior_malignancy","valueType":"string"}}},"specimen":{"updated":{"program_id":{"meta":{"displayName":{"left":null,"right":"Program ID"}}},"submitter_donor_id":{"meta":{"displayName":{"left":null,"right":"Submitter Donor ID"}}},"submitter_specimen_id":{"meta":{"displayName":{"left":null,"right":"Submitter Specimen ID"}}},"pathological_tumour_staging_system":{"meta":{"validationDependency":{"left":null,"right":true},"displayName":{"left":null,"right":"Pathological Tumour Staging System"}},"restrictions":{"script":{"left":["(function validate() {\n\n let result = {valid: true, message: \"Ok\"};\n \n /* This is not a required field, so first ensure that it exists */\n if ($field){\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name.trim().toLowerCase().split('_tumour_staging_system')[0];\n /* Perform validation only if an AJCC value was selected */\n if (/^(AJCC)\\b/i.test($field)){\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`\n ];\n const convertedRow = Object.fromEntries(Object.entries($row).map(([fieldName,fieldVal]) => [fieldName.toLowerCase(), fieldVal]));\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(field => Object.keys(convertedRow).includes(field) && (!convertedRow[field] || checkforEmpty(convertedRow[field])))\n if (emptyFields.length){\n result = {valid: false, \"message\": `The following fields are required when ${$name} is set to an AJCC option: ${emptyFields}`};\n }\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"deleted":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"]}}}},"pathological_t_category":{"meta":{"displayName":{"left":null,"right":"Pathological T Category"}},"restrictions":{}},"pathological_n_category":{"meta":{"displayName":{"left":null,"right":"Pathological N Category"}},"restrictions":{}},"pathological_m_category":{"meta":{"displayName":{"left":null,"right":"Pathological M Category"}},"restrictions":{}},"pathological_stage_group":{"description":{"left":"Specify the tumour stage, based on tumor_staging_system, used to assess the cancer at the time the tumour specimen was resected.","right":"Specify the tumour stage, based on pathological_tumour_staging_system, used to assess the cancer at the time the tumour specimen was resected."},"meta":{"notes":{"left":"This field depends on the selected pathological staging system, and is only required if the specimen is a tumour.","right":"This field depends on the selected pathological_tumour_staging_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications"},"displayName":{"left":null,"right":"Pathological Stage Group"}},"restrictions":{}},"specimen_acquisition_interval":{"meta":{"notes":{"left":null,"right":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."},"displayName":{"left":null,"right":"Specimen Acquisition Interval"}}},"tumour_histological_type":{"description":{"left":"The code to represent the histology (morphology) of neoplasms that is usually obtained from a pathology report, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Please refer to the guidelines provided in the ICD-O-3 manual at https://apps.who.int/iris/handle/10665/42344.","right":"The code to represent the histology (morphology) of neoplasms that is usually obtained from a pathology report, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344."},"meta":{"validationDependency":{"left":null,"right":true},"displayName":{"left":null,"right":"Tumour Histological Type"}}},"specimen_anatomic_location":{"description":{"left":"Anatomic location of a specimen when it was collected.","right":"Indicate the ICD-O-3 topography code for the anatomic location of a specimen when it was collected. Refer to the guidelines provided in the ICD-O-3 manual at https://apps.who.int/iris/handle/10665/42344."},"meta":{"displayName":{"left":null,"right":"Specimen Anatomic Location"},"examples":{"left":null,"right":"C50.1,C18"}},"restrictions":{"codeList":{"left":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear, pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal; distal","Esophageal; mid","Esophageal; proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck, NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es), maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"],"data":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear, pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal; distal","Esophageal; mid","Esophageal; proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck, NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es), maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"]},"regex":{"left":null,"right":"^[C][0-9]{2}(.[0-9]{1})?$"}}},"specimen_processing":{"meta":{},"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation, other","Formalin fixed & paraffin embedded","Formalin fixed, buffered","Formalin fixed, unbuffered","Fresh","Other"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"data":{"added":["Cryopreservation - other","Formalin fixed - buffered","Formalin fixed - unbuffered","Unknown"],"deleted":["Cryopreservation, other","Formalin fixed, buffered","Formalin fixed, unbuffered"]}}}},"specimen_storage":{"description":{"left":"Indicate the method of specimen storage for specimens that were not extracted freshly or immediately cultured.","right":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured."},"meta":{"displayName":{"left":null,"right":"Specimen Storage"}},"restrictions":{"codeList":{"left":["Cut slide","Frozen, -70 freezer","Frozen, liquid nitrogen","Frozen, vapor phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"data":{"added":["Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Unknown"],"deleted":["Frozen, -70 freezer","Frozen, liquid nitrogen","Frozen, vapor phase"]}}}},"tumour_grading_system":{"meta":{"validationDependency":{"left":null,"right":true},"displayName":{"left":null,"right":"Tumour Grading System"}},"restrictions":{"codeList":{"left":["Default","Gleason","Nottingham","Brain cancer","ISUP","Lymphoid neoplasms"],"right":["FNCLCC grading system","Four-tier grading system","Gleason grade group system","Grading system for GISTs","Grading system for GNETs","ISUP grading system","Nuclear grading system for DCIS","Scarff-Bloom-Richardson grading system","Three-tier grading system","Two-tier grading system","WHO grading system for CNS tumours"],"data":{"added":["FNCLCC grading system","Four-tier grading system","Gleason grade group system","Grading system for GISTs","Grading system for GNETs","ISUP grading system","Nuclear grading system for DCIS","Scarff-Bloom-Richardson grading system","Three-tier grading system","Two-tier grading system","WHO grading system for CNS tumours"],"deleted":["Default","Gleason","Nottingham","Brain cancer","ISUP","Lymphoid neoplasms"]}}}},"tumour_grade":{"meta":{"notes":{"left":"This field depends on the selected tumour grading system, and is only required if the specimen is a tumour.","right":"This field depends on the selected tumour_grading_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Grading Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-grading-classifications"},"displayName":{"left":null,"right":"Tumour Grade"}},"restrictions":{"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'default':\n codeList = [\n 'gx - cannot be assessed',\n 'g1 well differentiated/low grade',\n 'g2 moderately differentiated/intermediated grade',\n 'g3 poorly differentiated/high grade',\n 'g4 undifferentiated/high grade',\n ];\n break;\n case 'gleason':\n codeList = [\n 'gleason x: gleason score cannot be determined',\n 'gleason 2–6: the tumor tissue is well differentiated',\n 'gleason 7: the tumor tissue is moderately differentiated',\n 'gleason 8–10: the tumor tissue is poorly differentiated or undifferentiated',\n ];\n break;\n case 'nottingham':\n codeList = [\n 'g1 (low grade or well differentiated)',\n 'g2 (intermediate grade or moderately differentiated)',\n 'g3 (high grade or poorly differentiated)',\n ];\n break;\n case 'brain cancer':\n codeList = ['grade i', 'grade ii', 'grade iii', 'grade iv'];\n break;\n case 'isup for renal cell carcinoma':\n codeList = [\n 'grade 1: tumor cell nucleoli invisible or small and basophilic at 400 x magnification',\n 'grade 2: tumor cell nucleoli conspicuous at 400 x magnification but inconspicuous at 100 x magnification',\n 'grade 3: tumor cell nucleoli eosinophilic and clearly visible at 100 x magnification',\n 'grade 4: tumors showing extreme nuclear pleomorphism and/or containing tumor giant cells and/or the presence of any proportion of tumor showing sarcomatoid and/or rhabdoid dedifferentiation',\n ];\n break;\n case 'lymphoid neoplasms':\n codeList = ['low grade or indolent nhl', 'high grade or aggressive nhl'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]},"codeList":{"right":["Low grade","High grade","GX","G1","G2","G3","G4","Low","High","Grade I","Grade II","Grade III","Grade IV","Grade Group 1","Grade Group 2","Grade Group 3","Grade Group 4","Grade Group 5"],"data":["Low grade","High grade","GX","G1","G2","G3","G4","Low","High","Grade I","Grade II","Grade III","Grade IV","Grade Group 1","Grade Group 2","Grade Group 3","Grade Group 4","Grade Group 5"]}}},"percent_tumour_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of infiltration by tumour cells in a specimen.","right":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)"},"meta":{"displayName":{"left":null,"right":"Percent Tumour Cells"}},"restrictions":{}},"percent_proliferating_cells":{"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."},"displayName":{"left":null,"right":"Percent Proliferating Cells"}},"restrictions":{}},"percent_inflammatory_tissue":{"description":{"left":"Indicate a value, in decimals, that represents local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue.","right":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."},"displayName":{"left":null,"right":"Percent Inflammatory Tissue"}},"restrictions":{}},"percent_stromal_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a malignant tumour specimen but are not malignant such as fibroblasts, vascular structures, etc.","right":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."},"displayName":{"left":null,"right":"Percent Stromal Cells"}},"restrictions":{}},"percent_necrosis":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of cell death in a malignant tumour specimen.","right":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."},"displayName":{"left":null,"right":"Percent Necrosis"}},"restrictions":{}}},"created":{"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate the primary diagnosis event in the clinical timeline that this specimen acquisition was related to.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"specimen_laterality":{"changeType":"created","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"reference_pathology_confirmed":{"changeType":"created","name":"reference_pathology_confirmed","description":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)","valueType":"string","meta":{"validationDependency":true,"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Reference Pathology Confirmed"},"restrictions":{"codeList":["Yes","No","Unknown"]}},"percent_tumour_cells_measurement_method":{"changeType":"created","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}},"deleted":{"central_pathology_confirmed":{"changeType":"deleted","name":"central_pathology_confirmed","description":"Indicate whether the histologic description of tissue or cells was confirmed by a pathology review of frozen or formalin fixed slide(s) completed after the diagnostic pathology review of the tumour sample used to extract analyte(s).","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour."},"restrictions":{"codeList":["Yes","No","Unknown"]}}}},"primary_diagnosis":{"updated":{"program_id":{"meta":{"displayName":{"left":null,"right":"Program ID"}}},"submitter_donor_id":{"meta":{"displayName":{"left":null,"right":"Submitter Donor ID"}}},"age_at_diagnosis":{"description":{"left":"Age that the donor was first diagnosed with cancer, in years.","right":"Age that the donor was first diagnosed with cancer, in years. This should be based on the earliest diagnosis of cancer."},"meta":{"displayName":{"left":null,"right":"Age at Diagnosis"}},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0,"max":90}}}},"cancer_type_code":{"description":{"left":"The code to represent the cancer type using the WHO ICD-10 code (https://icd.who.int/browse10/2016/en#/) classification.","right":"The code to represent the cancer type using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification."},"meta":{"examples":{"left":"C41.1,C16.9,C00.543A","right":"C41.1,C16.9,C00.5,D46.9"},"displayName":{"left":null,"right":"Cancer Type Code"}},"restrictions":{"regex":{"left":"^C[0-9]{2}.[0-9]{0,3}[A-Z]{0,1}$","right":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"}}},"number_lymph_nodes_positive":{"description":{"left":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: NCI CDE ID: 6113694)","right":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: caDSR CDE ID 6113694)"},"meta":{"displayName":{"left":null,"right":"Number Of Lymph Nodes Positive"},"dependsOn":{"left":null,"right":"primary_diagnosis.lymph_nodes_examined_status"},"notes":{"left":null,"right":"This field is only required if 'lymph_nodes_examined_status' is 'Yes'."}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"]},"range":{"left":null,"right":{"min":0}}}},"number_lymph_nodes_examined":{"description":{"left":"The total number of lymph nodes tested for the presence of cancer. (Reference: NCI CDE ID: 3)","right":"The total number of lymph nodes tested for the presence of cancer. (Reference: caDSR CDE ID 3)"},"meta":{},"restrictions":{}},"clinical_tumour_staging_system":{"meta":{"validationDependency":{"left":null,"right":true},"displayName":{"left":null,"right":"Clinical Tumour Staging System"}},"restrictions":{"script":{"left":["(function validate() {\n\n let result = {valid: true, message: \"Ok\"};\n \n /* This is not a required field, so first ensure that it exists */\n if ($field){\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name.trim().toLowerCase().split('_tumour_staging_system')[0];\n /* Perform validation only if an AJCC value was selected */\n if (/^(AJCC)\\b/i.test($field)){\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`\n ];\n const convertedRow = Object.fromEntries(Object.entries($row).map(([fieldName,fieldVal]) => [fieldName.toLowerCase(), fieldVal]));\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(field => Object.keys(convertedRow).includes(field) && (!convertedRow[field] || checkforEmpty(convertedRow[field])))\n if (emptyFields.length){\n result = {valid: false, \"message\": `The following fields are required when ${$name} is set to an AJCC option: ${emptyFields}`};\n }\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"required":{"left":true,"right":null},"codeList":{"left":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"deleted":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"]}}}},"clinical_stage_group":{"description":{"left":"Stage group of the tumour, as assigned by the reporting tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.).","right":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage."},"meta":{"notes":{"left":null,"right":"This field is dependent on the selected clinical_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications"},"displayName":{"left":null,"right":"Clinical Stage Group"},"examples":{"left":null,"right":"Stage I, Stage IIB"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"clinical_t_category":{"meta":{"displayName":{"left":null,"right":"Clinical T Category"}},"restrictions":{}},"clinical_n_category":{"description":{"left":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"displayName":{"left":null,"right":"Clinical N Category"}},"restrictions":{}},"clinical_m_category":{"description":{"left":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned.","right":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned."},"meta":{"displayName":{"left":null,"right":"Clinical M Category"}},"restrictions":{}},"presenting_symptoms":{"meta":{},"restrictions":{"codeList":{"left":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Nausea","None","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Unknown","Vomiting","Weight Loss"],"right":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Loss of Appetite","Nausea","None","Not Reported","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Swelling in the Neck","Unknown","Vomiting","Weight Loss"],"data":{"added":["Loss of Appetite","Not Reported","Swelling in the Neck"],"deleted":[]}}}},"performance_status":{"description":{"left":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference source: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status).","right":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status)."},"meta":{"notes":{"left":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction \n Grade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work) \n Grade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours \n Grade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours \n Grade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair","right":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction.\nGrade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work).\nGrade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours.\nGrade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours.\nGrade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair"},"displayName":{"left":null,"right":"Performance Status"}},"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}}},"created":{"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Unique identifier of the primary diagnosis event, assigned by the data provider.","meta":{"primaryId":true,"displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"cancer_type_additional_information":{"changeType":"created","name":"cancer_type_additional_information","valueType":"string","description":"Additional details related to the cancer type that are not covered by the ICD-10 code provided in the cancer_type field.","meta":{"displayName":"Cancer Type Additional Information"}},"basis_of_diagnosis":{"changeType":"created","name":"basis_of_diagnosis","description":"Indicate the most valid basis of how the primary diagnosis was identified. If more than one diagnosis technique was used, select the term that has the highest code number (see notes). (Reference: IACR Standard for Basis of Diagnosis http://www.iacr.com.fr/images/doc/basis.pdf)","restrictions":{"codeList":["Clinical investigation","Clinical","Cytology","Death certificate only","Histology of a metastasis","Histology of a primary tumour","Specific tumour markers","Unknown"]},"valueType":"string","meta":{"notes":"0: Death certificate only: Information provided is from a death certificate.\n1: Clinical: Diagnosis made before death.\n2: Clinical investigation: All diagnostic techniques, including X-ray, endoscopy, imaging, ultrasound, exploratory surgery (such as laparotomy), and autopsy, without a tissue diagnosis.\n4: Specific tumour markers: Including biochemical and/or immunologic markers that are specific for a tumour site.\n5: Cytology: Examination of cells from a primary or secondary site, including fluids aspirated by endoscopy or needle; also includes the microscopic examination of peripheral blood and bone marrow aspirates.\n6: Histology of a metastasis: Histologic examination of tissue from a metastasis, including autopsy specimens.\n7: Histology of a primary tumour: Histologic examination of tissue from primary tumour, however obtained, including all cutting techniques and bone marrow biopsies; also includes autopsy specimens of primary tumour.\n9: Unknown: No information on how the diagnosis has been made.","displayName":"Basis of Diagnosis"}},"laterality":{"changeType":"created","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_status":{"changeType":"created","name":"lymph_nodes_examined_status","description":"Indicate if lymph nodes were examined for metastases.","valueType":"string","restrictions":{"required":true,"codeList":["Cannot be determined","No","No lymph nodes found in resected specimen","Not applicable","Yes"]},"meta":{"core":true,"displayName":"Lymph Nodes Examined Status"}},"lymph_nodes_examined_method":{"changeType":"created","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}},"deleted":{"stage_suffix":{"changeType":"deleted","name":"stage_suffix","description":"If necessary, use this field to add any applicable stage suffixes. Stage suffixes may apply to certain staging systems such as Ann Arbour staging system where the four stages are divided into 4 categories (A, B, X and E).","valueType":"string","meta":{"core":true,"dependsOn":"primary_diagnosis.clinical_tumour_staging_system"}}}},"treatment":{"updated":{"program_id":{"meta":{"displayName":{"left":null,"right":"Program ID"}}},"submitter_donor_id":{"meta":{"displayName":{"left":null,"right":"Submitter Donor ID"}}},"submitter_treatment_id":{"meta":{"displayName":{"left":null,"right":"Submitter Treatment ID"}}},"treatment_type":{"meta":{"notes":{"left":"Depending on the treatment_type selected, additional treament details may be required to be submitted.","right":"Depending on the treatment_type(s) selected, additional treatment details may be required to be submitted. For example, if treatment_type includes 'Chemotherapy', the supplemental Chemotherapy treatment type file is required.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."},"displayName":{"left":null,"right":"Treatment Type"},"examples":{"left":null,"right":"Chemotherapy|Hormonal therapy"}},"restrictions":{"codeList":{"left":["Chemotherapy","Ablation","Bone marrow transplant","Combined chemo+immunotherapy","Combined chemo+radiation therapy","Combined chemo-radiotherapy and surgery","Endoscopic therapy","Hormonal therapy","Immunotherapy","Monoclonal antibodies (for liquid tumours)","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgical resection"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":["End of life care","Surgery"],"deleted":["Combined chemo+immunotherapy","Combined chemo+radiation therapy","Combined chemo-radiotherapy and surgery","Monoclonal antibodies (for liquid tumours)","Surgical resection"]}}}},"is_primary_treatment":{"description":{"left":"Indicate if the treamtment was the primary treatment following the initial diagnosis.","right":"Indicate if the treatment was the primary treatment following the initial diagnosis."},"meta":{"displayName":{"left":null,"right":"Is Primary Treatment"},"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Yes","No","Unknown"],"right":["Yes","No"],"data":{"added":[],"deleted":["Unknown"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_start_interval":{"description":{"left":"The interval between primary diagnosis and initiation of treatment, in days.","right":"The interval between the primary diagnosis and initiation of treatment, in days."},"meta":{"notes":{"left":null,"right":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."},"displayName":{"left":null,"right":"Treatment Start Interval"},"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_duration":{"description":{"left":"The duration of treatment regimen, in days","right":"The duration of treatment regimen, in days."},"meta":{"displayName":{"left":null,"right":"Treatment Duration"},"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}}},"created":{"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate the primary diagnosis event in the clinical timeline that this treatment was related to.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"line_of_treatment":{"changeType":"created","name":"line_of_treatment","description":"Indicate the line of treatment if it is not the primary treatment.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Line Of treatment","dependsOn":"treatment.is_primary_treatment","examples":"2,3,4"}},"days_per_cycle":{"changeType":"created","name":"days_per_cycle","description":"Indicate the number of days in a treatment cycle.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Days Per Cycle","dependsOn":"treatment.treatment_type"}},"number_of_cycles":{"changeType":"created","name":"number_of_cycles","description":"Indicate the number of treatment cycles.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Number Of Cycles","dependsOn":"treatment.treatment_type"}},"treatment_intent":{"changeType":"created","name":"treatment_intent","description":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"]},"meta":{"core":true,"displayName":"Treatment Intent","dependsOn":"treatment.treatment_type"}},"treatment_setting":{"changeType":"created","name":"treatment_setting","description":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: NCIt C124308)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"]},"meta":{"core":true,"displayName":"Treatment Setting","dependsOn":"treatment.treatment_type"}},"response_to_treatment_criteria_method":{"changeType":"created","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},"response_to_treatment":{"changeType":"created","name":"response_to_treatment","description":"The donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"codeList":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"]},"meta":{"core":true,"displayName":"Response To Treatment","dependsOn":"treatment.response_to_treatment_criteria_method","notes":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"outcome_of_treatment":{"changeType":"created","name":"outcome_of_treatment","description":"Indicate the donor's outcome of the prescribed treatment.","valueType":"string","restrictions":{"codeList":["Treatment completed as prescribed","Treatment incomplete due to technical or organizational problems","Treatment incomplete because patient died","Patient choice (stopped or interrupted treatment)","Physician decision (stopped or interrupted treatment)","Treatment stopped due to lack of efficacy (disease progression)","Treatment stopped due to acute toxicity","Other","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Outcome Of Treatment","dependsOn":"treatment.treatment_type"}},"toxicity_type":{"changeType":"created","name":"toxicity_type","description":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity.","valueType":"string","restrictions":{"codeList":["Hematological","Non-hematological","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Toxicity Type","dependsOn":"treatment.outcome_of_treatment"}},"hematological_toxicity":{"changeType":"created","name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"non-hematological_toxicity":{"changeType":"created","name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"adverse_events":{"changeType":"created","name":"adverse_events","description":"Report any treatment related adverse events. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Adverse Events","dependsOn":"treatment.treatment_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"clinical_trials_database":{"changeType":"created","name":"clinical_trials_database","description":"If the donor is a participant in a clinical trial, indicate the clinical trial database where the clinical trial is registered.","valueType":"string","meta":{"display name":"Clinical Trials Database","notes":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added."},"restrictions":{"codeList":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"]}},"clinical_trial_number":{"changeType":"created","name":"clinical_trial_number","description":"Based on the clinical_trial_database, indicate the unique NCT or EudraCT clinical trial identifier of which the donor is a participant.","valueType":"string","meta":{"display name":"Clinical Trial Number","dependsOn":"treatment.clinical_trials_database","examples":"2016-002120-83,NCT02465060"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"]}}},"deleted":{"age_at_consent_for_treatment":{"changeType":"deleted","name":"age_at_consent_for_treatment","description":"Indicate the age of donor when consent was given for treatment.","valueType":"integer"},"therapeutic_intent":{"changeType":"deleted","name":"therapeutic_intent","description":"The therapeutic intent, the reason behind the choice of a therapy, of the treatment.","valueType":"string","restrictions":{"required":true,"codeList":["Adjuvant","Concurrent","Curative","Neoadjuvant","Not applicable","Palliative","Unknown"]},"meta":{"core":true}},"response_to_therapy":{"changeType":"deleted","name":"response_to_therapy","description":"The donors's response to the applied treatment regimen. (Source: RECIST)","valueType":"string","restrictions":{"required":true,"codeList":["Complete response","Disease progression","NED","Partial response","Stable disease"]},"meta":{"core":true}}}},"chemotherapy":{"updated":{"program_id":{"meta":{"displayName":{"left":null,"right":"Program ID"}}},"submitter_donor_id":{"meta":{"displayName":{"left":null,"right":"Submitter Donor ID"}}},"submitter_treatment_id":{"meta":{"displayName":{"left":null,"right":"Submitter Treatment ID"}}}},"created":{"drug_rxnormcui":{"changeType":"created","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"created","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"created","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"created","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"created","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"created","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}},"deleted":{"chemotherapy_drug_name":{"changeType":"deleted","name":"chemotherapy_drug_name","description":"Name of agent or drug administered to patient as part of the chemotherapy treatment regimen.","valueType":"string","restrictions":{"required":true,"codeList":["Placeholder list 1","Need list","Still need it"]},"meta":{"validationDependency":true,"core":true,"notes":"This field uses a controlled vocabulary gathered from the DrugBank database of drug names.","examples":"Allopurinol, Dronabinol, Sucralfate, Lapatinib"}},"chemotherapy_dosage_units":{"changeType":"deleted","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m²","IU/m²","µg/m²","g/m²","mg/kg"]},"meta":{"core":true}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate the total drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"integer","restrictions":{"required":true},"meta":{"core":true}}}},"hormone_therapy":{"updated":{"program_id":{"meta":{"displayName":{"left":null,"right":"Program ID"}}},"submitter_donor_id":{"meta":{"displayName":{"left":null,"right":"Submitter Donor ID"}}},"submitter_treatment_id":{"meta":{"displayName":{"left":null,"right":"Submitter Treatment ID"}}}},"created":{"drug_rxnormcui":{"changeType":"created","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"created","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Hormone Therapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"created","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{"hormone_therapy_drug_name":{"changeType":"deleted","name":"hormone_therapy_drug_name","description":"Name of agent or drug administered to patient as part of the hormone therapy treatment regimen.","valueType":"string","restrictions":{"required":true,"codeList":["Placeholder list 1","Need list","Still need it"]},"meta":{"validationDependency":true,"core":true,"notes":"This field uses a controlled vocabulary gathered from the DrugBank database of drug names."}},"hormone_drug_dosage_units":{"changeType":"deleted","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m²","IU/m²","µg/m²","g/m²","mg/kg"]},"meta":{"core":true}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"integer","restrictions":{"required":true},"meta":{"core":true}}}},"radiation":{"updated":{"program_id":{"meta":{"displayName":{"left":null,"right":"Program ID"}}},"submitter_donor_id":{"meta":{"displayName":{"left":null,"right":"Submitter Donor ID"}}},"submitter_treatment_id":{"meta":{"displayName":{"left":null,"right":"Submitter Treatment ID"}}},"radiation_therapy_modality":{"meta":{"displayName":{"left":null,"right":"Radiation Therapy Modality"}}},"radiation_therapy_fractions":{"description":{"left":"Indicate the number of total fractions delivered as part of treatment.","right":"Indicate the total number of fractions delivered as part of treatment."},"meta":{"displayName":{"left":null,"right":"Radiation Therapy Fractions"}},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"radiation_therapy_dosage":{"valueType":{"left":"integer","right":"number"},"meta":{"displayName":{"left":null,"right":"Radiation Therapy Dosage"}},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"anatomical_site_irradiated":{"description":{"left":"Indicate localization site where radiation therapy was administered.","right":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)"},"meta":{"displayName":{"left":null,"right":"Anatomical Site Irradiated"}},"restrictions":{"codeList":{"left":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"right":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"data":{"added":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"],"deleted":["Bone","Extremities","Head-Neck","Peritoneum"]}}}}},"created":{"radiation_therapy_type":{"changeType":"created","name":"radiation_therapy_type","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal"]},"meta":{"core":true,"displayName":"Type of Radiation Therapy","notes":"Internal application includes Brachytherapy."}},"radiation_boost":{"changeType":"created","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"created","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}},"deleted":{"application_form":{"changeType":"deleted","name":"application_form","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal (including Brachytherapy)"]},"meta":{"core":true}}}},"follow_up":{"updated":{"program_id":{"meta":{"displayName":{"left":null,"right":"Program ID"}}},"submitter_donor_id":{"meta":{"displayName":{"left":null,"right":"Submitter Donor ID"}}},"submitter_follow_up_id":{"description":{"left":"Unique identifier for a follow-up event in a donors clincal record, assigned by the data provider.","right":"Unique identifier for a follow-up event in a donor's clinical record, assigned by the data provider."},"meta":{"displayName":{"left":null,"right":"Submitter Follow-Up ID"}}},"interval_of_followup":{"description":{"left":"Interval from the primary diagnosis date to the follow up date, in days.","right":"Interval from the primary diagnosis date to the follow-up date, in days."},"meta":{"displayName":{"left":null,"right":"Interval Of Follow-Up"},"notes":{"left":null,"right":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}}},"disease_status_at_followup":{"description":{"left":"Indicate the donor's disease status at time of follow-up.","right":"Indicate the donor's disease status at time of follow-up. (Reference: RECIST)"},"meta":{"displayName":{"left":null,"right":"Disease Status at Follow-Up"}},"restrictions":{"codeList":{"left":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Relapse","Stable"],"right":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Progression NOS","Relapse or recurrence","Stable"],"data":{"added":["Progression NOS","Relapse or recurrence"],"deleted":["Relapse"]}}}},"relapse_type":{"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."},"displayName":{"left":null,"right":"Relapse Type"}},"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"relapse_interval":{"description":{"left":"If the donor was clinically disease free following primary treatment and then relapse or progression (for liquid tumours) occurred afterwards, then this field will indicate the length of disease free interval, in days.","right":"If the donor was clinically disease free following primary treatment and then relapse or recurrence or progression (for liquid tumours) occurred afterwards, then this field will indicate the length of disease free interval, in days."},"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."},"displayName":{"left":null,"right":"Relapse Interval"}},"restrictions":{"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"]}}},"method_of_progression_status":{"description":{"left":"Indicate the method(s) used to confirm the donor's progression disease status. (Codelist reference: NCI CDE ID: 6161031)","right":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Reference: caDSR CDE ID 6161031)"},"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."},"displayName":{"left":null,"right":"Method Of Progression Status"}},"restrictions":{"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]},"codeList":{"left":["Autopsy","Biomarker in liquid biopsy (e.g. tumor marker in blood or urine)","Biopsy","Blood draw","Bone marrow aspirate","Core biopsy","Cystoscopy","Cytology","Debulking","Diagnostic imaging","Dilation and curettage procedure","Enucleation","Excisional biopsy","Fine needle aspiration","Imaging","Incisional biopsy","Laparoscopy","Laparotomy","Other","Pap Smear","Pathologic review","Physical exam","Surgical resection","Thoracentesis","Ultrasound guided biopsy"],"right":["Biomarker in liquid biopsy (e.g. tumour marker in blood or urine)","Biopsy","Blood draw","Bone marrow aspirate","Core biopsy","Cystoscopy","Cytology","Debulking","Diagnostic imaging","Dilation and curettage procedure","Enucleation","Excisional biopsy","Fine needle aspiration","Imaging","Incisional biopsy","Laparoscopy","Laparotomy","Other","Pap Smear","Pathologic review","Physical exam","Surgical resection","Thoracentesis","Ultrasound guided biopsy"],"data":{"added":["Biomarker in liquid biopsy (e.g. tumour marker in blood or urine)"],"deleted":["Autopsy","Biomarker in liquid biopsy (e.g. tumor marker in blood or urine)"]}}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."},"displayName":{"left":null,"right":"Recurrance Tumour Staging System"}},"restrictions":{"codeList":{"left":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"deleted":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"]}},"script":{"left":["(function validate() {\n\n let result = {valid: true, message: \"Ok\"};\n \n /* This is not a required field, so first ensure that it exists */\n if ($field){\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name.trim().toLowerCase().split('_tumour_staging_system')[0];\n /* Perform validation only if an AJCC value was selected */\n if (/^(AJCC)\\b/i.test($field)){\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`\n ];\n const convertedRow = Object.fromEntries(Object.entries($row).map(([fieldName,fieldVal]) => [fieldName.toLowerCase(), fieldVal]));\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(field => Object.keys(convertedRow).includes(field) && (!convertedRow[field] || checkforEmpty(convertedRow[field])))\n if (emptyFields.length){\n result = {valid: false, \"message\": `The following fields are required when ${$name} is set to an AJCC option: ${emptyFields}`};\n }\n }\n }\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_t_category":{"description":{"left":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":true,"right":null},"displayName":{"left":null,"right":"Recurrence T Category"}},"restrictions":{}},"recurrence_n_category":{"description":{"left":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":true,"right":null},"displayName":{"left":null,"right":"Recurrence N Category"}},"restrictions":{}},"recurrence_m_category":{"description":{"left":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":true,"right":null},"displayName":{"left":null,"right":"Recurrence M Category"}},"restrictions":{}},"recurrence_stage_group":{"description":{"left":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery.","right":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) at the time of retreatment for a recurrence or disease progression."},"meta":{"core":{"left":true,"right":null},"notes":{"left":null,"right":"This field is dependent on the selected recurrence_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications"},"displayName":{"left":null,"right":"Recurrence Stage Group"}},"restrictions":{}},"posttherapy_tumour_staging_system":{"meta":{},"restrictions":{"script":{"left":["(function validate() {\n\n let result = {valid: true, message: \"Ok\"};\n \n /* This is not a required field, so first ensure that it exists */\n if ($field){\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name.trim().toLowerCase().split('_tumour_staging_system')[0];\n /* Perform validation only if an AJCC value was selected */\n if (/^(AJCC)\\b/i.test($field)){\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`\n ];\n const convertedRow = Object.fromEntries(Object.entries($row).map(([fieldName,fieldVal]) => [fieldName.toLowerCase(), fieldVal]));\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(field => Object.keys(convertedRow).includes(field) && (!convertedRow[field] || checkforEmpty(convertedRow[field])))\n if (emptyFields.length){\n result = {valid: false, \"message\": `The following fields are required when ${$name} is set to an AJCC option: ${emptyFields}`};\n }\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"deleted":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"]}}}},"posttherapy_t_category":{"meta":{"dependsOn":{"left":"follow_up.post_therapy_tumour_staging_system","right":"follow_up.posttherapy_tumour_staging_system"},"displayName":{"left":null,"right":"Post-therapy T Category"}},"restrictions":{}},"posttherapy_n_category":{"description":{"left":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"dependsOn":{"left":"follow_up.post_therapy_tumour_staging_system","right":"follow_up.posttherapy_tumour_staging_system"},"displayName":{"left":null,"right":"Post-therapy N Category"}},"restrictions":{}},"posttherapy_m_category":{"description":{"left":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"dependsOn":{"left":"follow_up.post_therapy_tumour_staging_system","right":"follow_up.posttherapy_tumour_staging_system"},"displayName":{"left":null,"right":"Post-therapy M Category"}},"restrictions":{}},"posttherapy_stage_group":{"meta":{"dependsOn":{"left":"follow_up.post_therapy_tumour_staging_system","right":"follow_up.posttherapy_tumour_staging_system"},"notes":{"left":"This field value is dependent on the selected posttherapy_tumour_staging_system.","right":"This field is dependent on the selected posttherapy_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications"},"displayName":{"left":null,"right":"Post-therapy Stage Group"}},"restrictions":{}}},"created":{"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate if the follow-up is related to a specific primary diagnosis event in the clinical timeline.","meta":{"validationDependency":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID","primaryId":true},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"Indicate if the follow-up is related to a specific treatment event in the clinical timeline.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"weight_at_followup":{"changeType":"created","description":"Indicate the donor's weight, in kilograms (kg), at the time of follow-up.","name":"weight_at_followup","valueType":"number","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Weight at Follow-Up"}},"anatomic_site_progression_or_recurrence":{"changeType":"created","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"anatomic_site_progression_or_recurrences":{"changeType":"deleted","description":"Indicate the anatomic site where disease progression or recurrence occurred. (Codelist reference: NCI CDE ID: 4742851)","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"],"codeList":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear, pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal; distal","Esophageal; mid","Esophageal; proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck, NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es), maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"]},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","notes":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse."}}}},"immunotherapy":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"immunotherapy_type":{"changeType":"created","name":"immunotherapy_type","valueType":"string","description":"Indicate the type of immunotherapy administered to donor.","meta":{"displayName":"Immunotherapy Type","core":true},"restrictions":{"required":true,"codeList":["Cell-based","Immune checkpoint inhibitors","Monoclonal antibodies other than immune checkpoint inhibitors","Other immunomodulatory substances"]}},"drug_rxnormcui":{"changeType":"created","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"created","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"created","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{}},"surgery":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"created","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"created","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"created","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"created","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"created","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"created","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"created","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"created","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"created","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"created","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"created","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"created","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"created","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"created","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}},"deleted":{}},"exposure":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"created","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"created","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"created","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"created","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"created","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"created","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"created","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"created","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"created","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"created","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"created","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"created","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"created","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}},"deleted":{}},"family_history":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"family_relative_id":{"changeType":"created","description":"Unique identifier of the relative, assigned by the data provider.","name":"family_relative_id","valueType":"string","meta":{"displayName":"Family Relative ID","primaryId":true,"notes":"This field is required to ensure that family members are identified in unique records. Ids can be as simple as an incremented numeral to ensure uniqueness."},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"relative_with_cancer_history":{"changeType":"created","description":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","name":"relative_with_cancer_history","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Relative with Cancer History"}},"relationship_type":{"changeType":"created","description":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","name":"relationship_type","restrictions":{"codeList":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"]},"valueType":"string","meta":{"displayName":"Relationship Type"}},"gender_of_relative":{"changeType":"created","description":"The self-reported gender of related individual.","name":"gender_of_relative","restrictions":{"codeList":["Female","Male","Other","Unknown"]},"valueType":"string","meta":{"displayName":"Gender of Relative"}},"age_of_relative_at_diagnosis":{"changeType":"created","description":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","name":"age_of_relative_at_diagnosis","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","displayName":"Age Of Relative At Diagnosis"}},"cancer_type_code_of_relative":{"changeType":"created","name":"cancer_type_code_of_relative","valueType":"string","description":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"examples":"C41.1,C16.9,C00.5,D46.9","dependsOn":"family_history.relative_with_cancer_history","displayName":"Cancer Type Code (ICD-10) of Relative"}},"relative_vital_status":{"changeType":"created","description":"Relative's last known state of living or deceased.","name":"relative_vital_status","restrictions":{"codeList":["Alive","Deceased","Unknown"]},"valueType":"string","meta":{"displayName":"Vital Status of Relative"}},"cause_of_death_of_relative":{"changeType":"created","description":"Indicate the cause of the death of the relative.","name":"cause_of_death_of_relative","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]},"valueType":"string","meta":{"dependsOn":"family_history.relative_vital_status","displayName":"Cause of Death of Relative"}},"relative_survival_time":{"changeType":"created","description":"Indicate how long, in days, the relative survived from the time they were diagnosed with cancer.","name":"relative_survival_time","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","units":"days","displayName":"Survival Time Of Relative"}}},"deleted":{}},"biomarker":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"created","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"created","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"created","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"created","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"created","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"created","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"created","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"created","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"created","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"created","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"created","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"created","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"created","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"created","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"created","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"created","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"created","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"created","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"created","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}},"deleted":{}},"comorbidity":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"created","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"created","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"created","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"created","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"created","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"created","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}},"deleted":{}}}} diff --git a/scripts/data/schemas/diffs/0.7/0.7-diff-1.24.json b/scripts/data/schemas/diffs/0.7/0.7-diff-1.24.json new file mode 100644 index 00000000..ef7ec304 --- /dev/null +++ b/scripts/data/schemas/diffs/0.7/0.7-diff-1.24.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"program_id":{"meta":{"examples":{"left":"PACA-AU,BR-CA","right":"TEST-CA"},"notes":{"left":null,"right":"This is the unique id that is assigned to your program. If you have logged into the platform, this is the Program Id that you see in the Program Services area. For example, TEST-CA is a Program ID."},"displayName":{"left":null,"right":"Program ID"}}},"submitter_donor_id":{"meta":{"displayName":{"left":null,"right":"Submitter Donor ID"}}},"gender":{"meta":{"displayName":{"left":null,"right":"Gender"}}},"submitter_specimen_id":{"meta":{"displayName":{"left":null,"right":"Submitter Specimen ID"}}},"specimen_tissue_source":{"meta":{"displayName":{"left":null,"right":"Specimen Tissue Source"}}},"tumour_normal_designation":{"meta":{"displayName":{"left":null,"right":"Tumour Normal Designation"}}},"specimen_type":{"meta":{"displayName":{"left":null,"right":"Specimen Type"}},"restrictions":{"codeList":{"left":["Normal","Normal - tissue adjacent to primary tumour","Primary tumour","Primary tumour - adjacent to normal","Primary tumour - additional new primary","Recurrent tumour","Metastatic tumour","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour - additional metastatic","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line","Cell line - derived from xenograft tumour","Cell line - derived from tumour","Cell line - derived from normal"],"right":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"],"deleted":[]}},"script":{"left":["(function validate() {\n\n const row = $row;\n let result = {valid: true, message: \"Ok\"};\n \n const designation = row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\"){\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when tumour_normal_designation is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when tumour_normal_designation is set to Tumour.\"};\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"]}}},"submitter_sample_id":{"meta":{"displayName":{"left":null,"right":"Submitter Sample ID"}}},"sample_type":{"meta":{"displayName":{"left":null,"right":"Sample Type"}}}},"created":{},"deleted":{}},"donor":{"updated":{"program_id":{"meta":{"displayName":{"left":null,"right":"Program ID"}}},"submitter_donor_id":{"meta":{"displayName":{"left":null,"right":"Submitter Donor ID"}}},"vital_status":{"meta":{"displayName":{"left":null,"right":"Vital Status"}},"restrictions":{"codeList":{"left":["Alive","Deceased","Unknown"],"right":["Alive","Deceased"],"data":{"added":[],"deleted":["Unknown"]}}}},"cause_of_death":{"meta":{"displayName":{"left":null,"right":"Cause of Death"}},"restrictions":{"codeList":{"left":["Died of cancer","Died of other reasons"],"right":["Died of cancer","Died of other reasons","Unknown"],"data":{"added":["Unknown"],"deleted":[]}},"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]}}},"survival_time":{"meta":{"displayName":{"left":null,"right":"Survival Time"}},"restrictions":{"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"height":{"valueType":{"left":"integer","right":"number"},"meta":{},"restrictions":{}},"weight":{"valueType":{"left":"integer","right":"number"},"meta":{},"restrictions":{}},"bmi":{"valueType":{"left":"integer","right":"number"},"meta":{},"restrictions":{}},"menopause_status":{"description":{"left":"Indicate the donor's menopause status at the time of primary diagnosis. (Codelist reference: NCI CDE ID: 2434914)","right":"Indicate the donor's menopause status at the time of primary diagnosis. (Reference: caDSR CDE ID 2434914)"},"meta":{},"restrictions":{"codeList":{"left":["Premenopausal","Perimenopausal","Postmenopausal","Indeterminate or unknown","Not applicable"],"right":["Not applicable","Perimenopausal","Postmenopausal","Premenopausal","Unknown"],"data":{"added":["Unknown"],"deleted":["Indeterminate or unknown"]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age of menarche, the first occurrence of menstruation.","right":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)"},"meta":{},"restrictions":{}},"number_of_pregnancies":{"description":{"left":"Indicate the number of pregnancies a donor has had.","right":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)"},"meta":{},"restrictions":{}},"number_of_children":{"description":{"left":"Indicate the number of children the donor has birthed.","right":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)"},"meta":{},"restrictions":{}}},"created":{"primary_site":{"changeType":"created","name":"primary_site","valueType":"string","isArray":true,"description":"The text term used to describe the primary site of disease, as categorized by the World Health Organization's (WHO) International Classification of Diseases for Oncology (ICD-O). This categorization groups cases into general categories.","meta":{"displayName":"Primary Site","core":true,"notes":"To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Breast|Ovary"},"restrictions":{"required":true,"codeList":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"]}},"genetic_disorders":{"changeType":"created","description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},"hrt_type":{"changeType":"created","description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},"hrt_duration":{"changeType":"created","description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},"contraception_type":{"changeType":"created","description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},"contraception_duration":{"changeType":"created","description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},"lost_to_followup_after_clinical_event_id":{"changeType":"created","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}},"deleted":{"prior_malignancy":{"changeType":"deleted","description":"Prior malignancy affecting donor.","name":"prior_malignancy","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string"},"cancer_type_prior_malignancy":{"changeType":"deleted","description":"ICD-10 diagnostic code for type of cancer in a prior malignancy.","name":"cancer_type_prior_malignancy","restrictions":{"regex":"[A-Z]{1}[0-9]{2}.[0-9]{0,3}[A-Z]{0,1}$"},"valueType":"string"},"age_at_prior_malignancy":{"changeType":"deleted","description":"If donor has history of prior malignancy, indicate age at previous diagnosis, in years.","name":"age_at_prior_malignancy","valueType":"integer"},"laterality_of_prior_malignancy":{"changeType":"deleted","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis.","name":"laterality_of_prior_malignancy","valueType":"string"}}},"specimen":{"updated":{"program_id":{"meta":{"displayName":{"left":null,"right":"Program ID"}}},"submitter_donor_id":{"meta":{"displayName":{"left":null,"right":"Submitter Donor ID"}}},"submitter_specimen_id":{"meta":{"displayName":{"left":null,"right":"Submitter Specimen ID"}}},"pathological_tumour_staging_system":{"meta":{"validationDependency":{"left":null,"right":true},"displayName":{"left":null,"right":"Pathological Tumour Staging System"}},"restrictions":{"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(\n field =>\n Object.keys(convertedRow).includes(field) &&\n (!convertedRow[field] || checkforEmpty(convertedRow[field])),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"deleted":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"]}}}},"pathological_t_category":{"meta":{"displayName":{"left":null,"right":"Pathological T Category"}},"restrictions":{}},"pathological_n_category":{"meta":{"displayName":{"left":null,"right":"Pathological N Category"}},"restrictions":{}},"pathological_m_category":{"meta":{"displayName":{"left":null,"right":"Pathological M Category"}},"restrictions":{}},"pathological_stage_group":{"description":{"left":"Specify the tumour stage, based on tumor_staging_system, used to assess the cancer at the time the tumour specimen was resected.","right":"Specify the tumour stage, based on pathological_tumour_staging_system, used to assess the cancer at the time the tumour specimen was resected."},"meta":{"notes":{"left":"This field depends on the selected pathological staging system, and is only required if the specimen is a tumour.","right":"This field depends on the selected pathological_tumour_staging_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications"},"displayName":{"left":null,"right":"Pathological Stage Group"}},"restrictions":{}},"specimen_acquisition_interval":{"meta":{"notes":{"left":null,"right":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."},"displayName":{"left":null,"right":"Specimen Acquisition Interval"}}},"tumour_histological_type":{"description":{"left":"The code to represent the histology (morphology) of neoplasms that is usually obtained from a pathology report, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Please refer to the guidelines provided in the ICD-O-3 manual at https://apps.who.int/iris/handle/10665/42344.","right":"The code to represent the histology (morphology) of neoplasms that is usually obtained from a pathology report, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344."},"meta":{"validationDependency":{"left":null,"right":true},"displayName":{"left":null,"right":"Tumour Histological Type"}}},"specimen_anatomic_location":{"description":{"left":"Anatomic location of a specimen when it was collected.","right":"Indicate the ICD-O-3 topography code for the anatomic location of a specimen when it was collected. Refer to the guidelines provided in the ICD-O-3 manual at https://apps.who.int/iris/handle/10665/42344."},"meta":{"displayName":{"left":null,"right":"Specimen Anatomic Location"},"examples":{"left":null,"right":"C50.1,C18"}},"restrictions":{"codeList":{"left":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear, pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal; distal","Esophageal; mid","Esophageal; proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck, NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es), maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"],"data":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear, pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal; distal","Esophageal; mid","Esophageal; proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck, NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es), maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"]},"regex":{"left":null,"right":"^[C][0-9]{2}(.[0-9]{1})?$"}}},"specimen_processing":{"meta":{},"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation, other","Formalin fixed & paraffin embedded","Formalin fixed, buffered","Formalin fixed, unbuffered","Fresh","Other"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"data":{"added":["Cryopreservation - other","Formalin fixed - buffered","Formalin fixed - unbuffered","Unknown"],"deleted":["Cryopreservation, other","Formalin fixed, buffered","Formalin fixed, unbuffered"]}}}},"specimen_storage":{"description":{"left":"Indicate the method of specimen storage for specimens that were not extracted freshly or immediately cultured.","right":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured."},"meta":{"displayName":{"left":null,"right":"Specimen Storage"}},"restrictions":{"codeList":{"left":["Cut slide","Frozen, -70 freezer","Frozen, liquid nitrogen","Frozen, vapor phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"data":{"added":["Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Unknown"],"deleted":["Frozen, -70 freezer","Frozen, liquid nitrogen","Frozen, vapor phase"]}}}},"tumour_grading_system":{"meta":{"validationDependency":{"left":null,"right":true},"displayName":{"left":null,"right":"Tumour Grading System"}},"restrictions":{"codeList":{"left":["Default","Gleason","Nottingham","Brain cancer","ISUP","Lymphoid neoplasms"],"right":["FNCLCC grading system","Four-tier grading system","Gleason grade group system","Grading system for GISTs","Grading system for GNETs","ISUP grading system","Nuclear grading system for DCIS","Scarff-Bloom-Richardson grading system","Three-tier grading system","Two-tier grading system","WHO grading system for CNS tumours"],"data":{"added":["FNCLCC grading system","Four-tier grading system","Gleason grade group system","Grading system for GISTs","Grading system for GNETs","ISUP grading system","Nuclear grading system for DCIS","Scarff-Bloom-Richardson grading system","Three-tier grading system","Two-tier grading system","WHO grading system for CNS tumours"],"deleted":["Default","Gleason","Nottingham","Brain cancer","ISUP","Lymphoid neoplasms"]}}}},"tumour_grade":{"meta":{"notes":{"left":"This field depends on the selected tumour grading system, and is only required if the specimen is a tumour.","right":"This field depends on the selected tumour_grading_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Grading Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-grading-classifications"},"displayName":{"left":null,"right":"Tumour Grade"}},"restrictions":{"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'default':\n codeList = [\n 'gx - cannot be assessed',\n 'g1 well differentiated/low grade',\n 'g2 moderately differentiated/intermediated grade',\n 'g3 poorly differentiated/high grade',\n 'g4 undifferentiated/high grade',\n ];\n break;\n case 'gleason':\n codeList = [\n 'gleason x: gleason score cannot be determined',\n 'gleason 2–6: the tumor tissue is well differentiated',\n 'gleason 7: the tumor tissue is moderately differentiated',\n 'gleason 8–10: the tumor tissue is poorly differentiated or undifferentiated',\n ];\n break;\n case 'nottingham':\n codeList = [\n 'g1 (low grade or well differentiated)',\n 'g2 (intermediate grade or moderately differentiated)',\n 'g3 (high grade or poorly differentiated)',\n ];\n break;\n case 'brain cancer':\n codeList = ['grade i', 'grade ii', 'grade iii', 'grade iv'];\n break;\n case 'isup for renal cell carcinoma':\n codeList = [\n 'grade 1: tumor cell nucleoli invisible or small and basophilic at 400 x magnification',\n 'grade 2: tumor cell nucleoli conspicuous at 400 x magnification but inconspicuous at 100 x magnification',\n 'grade 3: tumor cell nucleoli eosinophilic and clearly visible at 100 x magnification',\n 'grade 4: tumors showing extreme nuclear pleomorphism and/or containing tumor giant cells and/or the presence of any proportion of tumor showing sarcomatoid and/or rhabdoid dedifferentiation',\n ];\n break;\n case 'lymphoid neoplasms':\n codeList = ['low grade or indolent nhl', 'high grade or aggressive nhl'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]},"codeList":{"right":["Low grade","High grade","GX","G1","G2","G3","G4","Low","High","Grade I","Grade II","Grade III","Grade IV","Grade Group 1","Grade Group 2","Grade Group 3","Grade Group 4","Grade Group 5"],"data":["Low grade","High grade","GX","G1","G2","G3","G4","Low","High","Grade I","Grade II","Grade III","Grade IV","Grade Group 1","Grade Group 2","Grade Group 3","Grade Group 4","Grade Group 5"]}}},"percent_tumour_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of infiltration by tumour cells in a specimen.","right":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)"},"meta":{"displayName":{"left":null,"right":"Percent Tumour Cells"}},"restrictions":{}},"percent_proliferating_cells":{"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."},"displayName":{"left":null,"right":"Percent Proliferating Cells"}},"restrictions":{}},"percent_inflammatory_tissue":{"description":{"left":"Indicate a value, in decimals, that represents local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue.","right":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."},"displayName":{"left":null,"right":"Percent Inflammatory Tissue"}},"restrictions":{}},"percent_stromal_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a malignant tumour specimen but are not malignant such as fibroblasts, vascular structures, etc.","right":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."},"displayName":{"left":null,"right":"Percent Stromal Cells"}},"restrictions":{}},"percent_necrosis":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of cell death in a malignant tumour specimen.","right":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."},"displayName":{"left":null,"right":"Percent Necrosis"}},"restrictions":{}}},"created":{"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate the primary diagnosis event in the clinical timeline that this specimen acquisition was related to.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"specimen_laterality":{"changeType":"created","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"reference_pathology_confirmed":{"changeType":"created","name":"reference_pathology_confirmed","description":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)","valueType":"string","meta":{"validationDependency":true,"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Reference Pathology Confirmed"},"restrictions":{"codeList":["Yes","No","Unknown"]}},"percent_tumour_cells_measurement_method":{"changeType":"created","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}},"deleted":{"central_pathology_confirmed":{"changeType":"deleted","name":"central_pathology_confirmed","description":"Indicate whether the histologic description of tissue or cells was confirmed by a pathology review of frozen or formalin fixed slide(s) completed after the diagnostic pathology review of the tumour sample used to extract analyte(s).","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour."},"restrictions":{"codeList":["Yes","No","Unknown"]}}}},"primary_diagnosis":{"updated":{"program_id":{"meta":{"displayName":{"left":null,"right":"Program ID"}}},"submitter_donor_id":{"meta":{"displayName":{"left":null,"right":"Submitter Donor ID"}}},"age_at_diagnosis":{"description":{"left":"Age that the donor was first diagnosed with cancer, in years.","right":"Age that the donor was first diagnosed with cancer, in years. This should be based on the earliest diagnosis of cancer."},"meta":{"displayName":{"left":null,"right":"Age at Diagnosis"}},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0,"max":90}}}},"cancer_type_code":{"description":{"left":"The code to represent the cancer type using the WHO ICD-10 code (https://icd.who.int/browse10/2016/en#/) classification.","right":"The code to represent the cancer type using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification."},"meta":{"examples":{"left":"C41.1,C16.9,C00.543A","right":"C41.1,C16.9,C00.5,D46.9"},"displayName":{"left":null,"right":"Cancer Type Code"}},"restrictions":{"regex":{"left":"^C[0-9]{2}.[0-9]{0,3}[A-Z]{0,1}$","right":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"}}},"basis_of_diagnosis":{"meta":{"displayName":{"left":null,"right":"Basis of Diagnosis"}}},"number_lymph_nodes_positive":{"description":{"left":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: NCI CDE ID: 6113694)","right":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: caDSR CDE ID 6113694)"},"meta":{"displayName":{"left":null,"right":"Number Of Lymph Nodes Positive"},"dependsOn":{"left":null,"right":"primary_diagnosis.lymph_nodes_examined_status"},"notes":{"left":null,"right":"This field is only required if 'lymph_nodes_examined_status' is 'Yes'."}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"]},"range":{"left":null,"right":{"min":0}}}},"number_lymph_nodes_examined":{"description":{"left":"The total number of lymph nodes tested for the presence of cancer. (Reference: NCI CDE ID: 3)","right":"The total number of lymph nodes tested for the presence of cancer. (Reference: caDSR CDE ID 3)"},"meta":{},"restrictions":{}},"clinical_tumour_staging_system":{"meta":{"validationDependency":{"left":null,"right":true},"displayName":{"left":null,"right":"Clinical Tumour Staging System"}},"restrictions":{"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(\n field =>\n Object.keys(convertedRow).includes(field) &&\n (!convertedRow[field] || checkforEmpty(convertedRow[field])),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"required":{"left":true,"right":null},"codeList":{"left":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"deleted":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"]}}}},"clinical_stage_group":{"description":{"left":"Stage group of the tumour, as assigned by the reporting tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.).","right":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage."},"meta":{"notes":{"left":null,"right":"This field is dependent on the selected clinical_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications"},"displayName":{"left":null,"right":"Clinical Stage Group"},"examples":{"left":null,"right":"Stage I, Stage IIB"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"clinical_t_category":{"meta":{"displayName":{"left":null,"right":"Clinical T Category"}},"restrictions":{}},"clinical_n_category":{"description":{"left":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"displayName":{"left":null,"right":"Clinical N Category"}},"restrictions":{}},"clinical_m_category":{"description":{"left":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned.","right":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned."},"meta":{"displayName":{"left":null,"right":"Clinical M Category"}},"restrictions":{}},"presenting_symptoms":{"meta":{},"restrictions":{"codeList":{"left":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Nausea","None","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Unknown","Vomiting","Weight Loss"],"right":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Loss of Appetite","Nausea","None","Not Reported","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Swelling in the Neck","Unknown","Vomiting","Weight Loss"],"data":{"added":["Loss of Appetite","Not Reported","Swelling in the Neck"],"deleted":[]}}}},"performance_status":{"description":{"left":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference source: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status).","right":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status)."},"meta":{"notes":{"left":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction \n Grade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work) \n Grade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours \n Grade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours \n Grade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair","right":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction.\nGrade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work).\nGrade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours.\nGrade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours.\nGrade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair"},"displayName":{"left":null,"right":"Performance Status"}},"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}}},"created":{"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Unique identifier of the primary diagnosis event, assigned by the data provider.","meta":{"primaryId":true,"displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"cancer_type_additional_information":{"changeType":"created","name":"cancer_type_additional_information","valueType":"string","description":"Additional details related to the cancer type that are not covered by the ICD-10 code provided in the cancer_type field.","meta":{"displayName":"Cancer Type Additional Information"}},"laterality":{"changeType":"created","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_status":{"changeType":"created","name":"lymph_nodes_examined_status","description":"Indicate if lymph nodes were examined for metastases.","valueType":"string","restrictions":{"required":true,"codeList":["Cannot be determined","No","No lymph nodes found in resected specimen","Not applicable","Yes"]},"meta":{"core":true,"displayName":"Lymph Nodes Examined Status"}},"lymph_nodes_examined_method":{"changeType":"created","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}},"deleted":{"stage_suffix":{"changeType":"deleted","name":"stage_suffix","description":"If necessary, use this field to add any applicable stage suffixes. Stage suffixes may apply to certain staging systems such as Ann Arbour staging system where the four stages are divided into 4 categories (A, B, X and E).","valueType":"string","meta":{"core":true,"dependsOn":"primary_diagnosis.clinical_tumour_staging_system"}}}},"treatment":{"updated":{"program_id":{"meta":{"displayName":{"left":null,"right":"Program ID"}}},"submitter_donor_id":{"meta":{"displayName":{"left":null,"right":"Submitter Donor ID"}}},"submitter_treatment_id":{"meta":{"displayName":{"left":null,"right":"Submitter Treatment ID"}}},"treatment_type":{"meta":{"notes":{"left":"Depending on the treatment_type selected, additional treament details may be required to be submitted.","right":"Depending on the treatment_type(s) selected, additional treatment details may be required to be submitted. For example, if treatment_type includes 'Chemotherapy', the supplemental Chemotherapy treatment type file is required.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."},"displayName":{"left":null,"right":"Treatment Type"},"examples":{"left":null,"right":"Chemotherapy|Hormonal therapy"}},"restrictions":{"codeList":{"left":["Chemotherapy","Ablation","Bone marrow transplant","Combined chemo+immunotherapy","Combined chemo+radiation therapy","Combined chemo-radiotherapy and surgery","Endoscopic therapy","Hormonal therapy","Immunotherapy","Monoclonal antibodies (for liquid tumours)","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgical resection"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":["End of life care","Surgery"],"deleted":["Combined chemo+immunotherapy","Combined chemo+radiation therapy","Combined chemo-radiotherapy and surgery","Monoclonal antibodies (for liquid tumours)","Surgical resection"]}}}},"is_primary_treatment":{"description":{"left":"Indicate if the treamtment was the primary treatment following the initial diagnosis.","right":"Indicate if the treatment was the primary treatment following the initial diagnosis."},"meta":{"displayName":{"left":null,"right":"Is Primary Treatment"},"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Yes","No","Unknown"],"right":["Yes","No"],"data":{"added":[],"deleted":["Unknown"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_start_interval":{"description":{"left":"The interval between primary diagnosis and initiation of treatment, in days.","right":"The interval between the primary diagnosis and initiation of treatment, in days."},"meta":{"notes":{"left":null,"right":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."},"displayName":{"left":null,"right":"Treatment Start Interval"},"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_duration":{"description":{"left":"The duration of treatment regimen, in days","right":"The duration of treatment regimen, in days."},"meta":{"displayName":{"left":null,"right":"Treatment Duration"},"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}}},"created":{"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate the primary diagnosis event in the clinical timeline that this treatment was related to.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"line_of_treatment":{"changeType":"created","name":"line_of_treatment","description":"Indicate the line of treatment if it is not the primary treatment.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Line Of treatment","dependsOn":"treatment.is_primary_treatment","examples":"2,3,4"}},"days_per_cycle":{"changeType":"created","name":"days_per_cycle","description":"Indicate the number of days in a treatment cycle.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Days Per Cycle","dependsOn":"treatment.treatment_type"}},"number_of_cycles":{"changeType":"created","name":"number_of_cycles","description":"Indicate the number of treatment cycles.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Number Of Cycles","dependsOn":"treatment.treatment_type"}},"treatment_intent":{"changeType":"created","name":"treatment_intent","description":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"]},"meta":{"core":true,"displayName":"Treatment Intent","dependsOn":"treatment.treatment_type"}},"treatment_setting":{"changeType":"created","name":"treatment_setting","description":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: NCIt C124308)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"]},"meta":{"core":true,"displayName":"Treatment Setting","dependsOn":"treatment.treatment_type"}},"response_to_treatment_criteria_method":{"changeType":"created","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},"response_to_treatment":{"changeType":"created","name":"response_to_treatment","description":"The donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"codeList":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"]},"meta":{"core":true,"displayName":"Response To Treatment","dependsOn":"treatment.response_to_treatment_criteria_method","notes":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"outcome_of_treatment":{"changeType":"created","name":"outcome_of_treatment","description":"Indicate the donor's outcome of the prescribed treatment.","valueType":"string","restrictions":{"codeList":["Treatment completed as prescribed","Treatment incomplete due to technical or organizational problems","Treatment incomplete because patient died","Patient choice (stopped or interrupted treatment)","Physician decision (stopped or interrupted treatment)","Treatment stopped due to lack of efficacy (disease progression)","Treatment stopped due to acute toxicity","Other","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Outcome Of Treatment","dependsOn":"treatment.treatment_type"}},"toxicity_type":{"changeType":"created","name":"toxicity_type","description":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity.","valueType":"string","restrictions":{"codeList":["Hematological","Non-hematological","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Toxicity Type","dependsOn":"treatment.outcome_of_treatment"}},"hematological_toxicity":{"changeType":"created","name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"non-hematological_toxicity":{"changeType":"created","name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"adverse_events":{"changeType":"created","name":"adverse_events","description":"Report any treatment related adverse events. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Adverse Events","dependsOn":"treatment.treatment_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"clinical_trials_database":{"changeType":"created","name":"clinical_trials_database","description":"If the donor is a participant in a clinical trial, indicate the clinical trial database where the clinical trial is registered.","valueType":"string","meta":{"display name":"Clinical Trials Database","notes":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added."},"restrictions":{"codeList":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"]}},"clinical_trial_number":{"changeType":"created","name":"clinical_trial_number","description":"Based on the clinical_trial_database, indicate the unique NCT or EudraCT clinical trial identifier of which the donor is a participant.","valueType":"string","meta":{"display name":"Clinical Trial Number","dependsOn":"treatment.clinical_trials_database","examples":"2016-002120-83,NCT02465060"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"]}}},"deleted":{"age_at_consent_for_treatment":{"changeType":"deleted","name":"age_at_consent_for_treatment","description":"Indicate the age of donor when consent was given for treatment.","valueType":"integer"},"therapeutic_intent":{"changeType":"deleted","name":"therapeutic_intent","description":"The therapeutic intent, the reason behind the choice of a therapy, of the treatment.","valueType":"string","restrictions":{"required":true,"codeList":["Adjuvant","Concurrent","Curative","Neoadjuvant","Not applicable","Palliative","Unknown"]},"meta":{"core":true}},"response_to_therapy":{"changeType":"deleted","name":"response_to_therapy","description":"The donors's response to the applied treatment regimen. (Source: RECIST)","valueType":"string","restrictions":{"required":true,"codeList":["Complete response","Disease progression","NED","Partial response","Stable disease"]},"meta":{"core":true}}}},"chemotherapy":{"updated":{"program_id":{"meta":{"displayName":{"left":null,"right":"Program ID"}}},"submitter_donor_id":{"meta":{"displayName":{"left":null,"right":"Submitter Donor ID"}}},"submitter_treatment_id":{"meta":{"displayName":{"left":null,"right":"Submitter Treatment ID"}}}},"created":{"drug_rxnormcui":{"changeType":"created","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"created","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"created","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"created","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"created","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"created","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}},"deleted":{"chemotherapy_drug_name":{"changeType":"deleted","name":"chemotherapy_drug_name","description":"Name of agent or drug administered to patient as part of the chemotherapy treatment regimen.","valueType":"string","restrictions":{"required":true,"codeList":["Placeholder list 1","Need list","Still need it"]},"meta":{"validationDependency":true,"core":true,"notes":"This field uses a controlled vocabulary gathered from the DrugBank database of drug names.","examples":"Allopurinol, Dronabinol, Sucralfate, Lapatinib"}},"chemotherapy_dosage_units":{"changeType":"deleted","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m²","IU/m²","µg/m²","g/m²","mg/kg"]},"meta":{"core":true}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate the total drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"integer","restrictions":{"required":true},"meta":{"core":true}}}},"hormone_therapy":{"updated":{"program_id":{"meta":{"displayName":{"left":null,"right":"Program ID"}}},"submitter_donor_id":{"meta":{"displayName":{"left":null,"right":"Submitter Donor ID"}}},"submitter_treatment_id":{"meta":{"displayName":{"left":null,"right":"Submitter Treatment ID"}}}},"created":{"drug_rxnormcui":{"changeType":"created","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"created","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Hormone Therapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"created","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{"hormone_therapy_drug_name":{"changeType":"deleted","name":"hormone_therapy_drug_name","description":"Name of agent or drug administered to patient as part of the hormone therapy treatment regimen.","valueType":"string","restrictions":{"required":true,"codeList":["Placeholder list 1","Need list","Still need it"]},"meta":{"validationDependency":true,"core":true,"notes":"This field uses a controlled vocabulary gathered from the DrugBank database of drug names."}},"hormone_drug_dosage_units":{"changeType":"deleted","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m²","IU/m²","µg/m²","g/m²","mg/kg"]},"meta":{"core":true}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"integer","restrictions":{"required":true},"meta":{"core":true}}}},"radiation":{"updated":{"program_id":{"meta":{"displayName":{"left":null,"right":"Program ID"}}},"submitter_donor_id":{"meta":{"displayName":{"left":null,"right":"Submitter Donor ID"}}},"submitter_treatment_id":{"meta":{"displayName":{"left":null,"right":"Submitter Treatment ID"}}},"radiation_therapy_modality":{"meta":{"displayName":{"left":null,"right":"Radiation Therapy Modality"}}},"radiation_therapy_fractions":{"description":{"left":"Indicate the number of total fractions delivered as part of treatment.","right":"Indicate the total number of fractions delivered as part of treatment."},"meta":{"displayName":{"left":null,"right":"Radiation Therapy Fractions"}},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"radiation_therapy_dosage":{"valueType":{"left":"integer","right":"number"},"meta":{"displayName":{"left":null,"right":"Radiation Therapy Dosage"}},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"anatomical_site_irradiated":{"description":{"left":"Indicate localization site where radiation therapy was administered.","right":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)"},"meta":{"displayName":{"left":null,"right":"Anatomical Site Irradiated"}},"restrictions":{"codeList":{"left":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"right":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"data":{"added":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"],"deleted":["Bone","Extremities","Head-Neck","Peritoneum"]}}}}},"created":{"radiation_therapy_type":{"changeType":"created","name":"radiation_therapy_type","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal"]},"meta":{"core":true,"displayName":"Type of Radiation Therapy","notes":"Internal application includes Brachytherapy."}},"radiation_boost":{"changeType":"created","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"created","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}},"deleted":{"application_form":{"changeType":"deleted","name":"application_form","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal (including Brachytherapy)"]},"meta":{"core":true}}}},"follow_up":{"updated":{"program_id":{"meta":{"displayName":{"left":null,"right":"Program ID"}}},"submitter_donor_id":{"meta":{"displayName":{"left":null,"right":"Submitter Donor ID"}}},"submitter_follow_up_id":{"description":{"left":"Unique identifier for a follow-up event in a donors clincal record, assigned by the data provider.","right":"Unique identifier for a follow-up event in a donor's clinical record, assigned by the data provider."},"meta":{"displayName":{"left":null,"right":"Submitter Follow-Up ID"}}},"interval_of_followup":{"description":{"left":"Interval from the primary diagnosis date to the follow up date, in days.","right":"Interval from the primary diagnosis date to the follow-up date, in days."},"meta":{"displayName":{"left":null,"right":"Interval Of Follow-Up"},"notes":{"left":null,"right":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}}},"disease_status_at_followup":{"description":{"left":"Indicate the donor's disease status at time of follow-up.","right":"Indicate the donor's disease status at time of follow-up. (Reference: RECIST)"},"meta":{"displayName":{"left":null,"right":"Disease Status at Follow-Up"}},"restrictions":{"codeList":{"left":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Relapse","Stable"],"right":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Progression NOS","Relapse or recurrence","Stable"],"data":{"added":["Progression NOS","Relapse or recurrence"],"deleted":["Relapse"]}}}},"relapse_type":{"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."},"displayName":{"left":null,"right":"Relapse Type"}},"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"relapse_interval":{"description":{"left":"If the donor was clinically disease free following primary treatment and then relapse or progression (for liquid tumours) occurred afterwards, then this field will indicate the length of disease free interval, in days.","right":"If the donor was clinically disease free following primary treatment and then relapse or recurrence or progression (for liquid tumours) occurred afterwards, then this field will indicate the length of disease free interval, in days."},"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."},"displayName":{"left":null,"right":"Relapse Interval"}},"restrictions":{"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"]}}},"method_of_progression_status":{"description":{"left":"Indicate the method(s) used to confirm the donor's progression disease status. (Codelist reference: NCI CDE ID: 6161031)","right":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Reference: caDSR CDE ID 6161031)"},"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."},"displayName":{"left":null,"right":"Method Of Progression Status"}},"restrictions":{"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]},"codeList":{"left":["Autopsy","Biomarker in liquid biopsy (e.g. tumor marker in blood or urine)","Biopsy","Blood draw","Bone marrow aspirate","Core biopsy","Cystoscopy","Cytology","Debulking","Diagnostic imaging","Dilation and curettage procedure","Enucleation","Excisional biopsy","Fine needle aspiration","Imaging","Incisional biopsy","Laparoscopy","Laparotomy","Other","Pap Smear","Pathologic review","Physical exam","Surgical resection","Thoracentesis","Ultrasound guided biopsy"],"right":["Biomarker in liquid biopsy (e.g. tumour marker in blood or urine)","Biopsy","Blood draw","Bone marrow aspirate","Core biopsy","Cystoscopy","Cytology","Debulking","Diagnostic imaging","Dilation and curettage procedure","Enucleation","Excisional biopsy","Fine needle aspiration","Imaging","Incisional biopsy","Laparoscopy","Laparotomy","Other","Pap Smear","Pathologic review","Physical exam","Surgical resection","Thoracentesis","Ultrasound guided biopsy"],"data":{"added":["Biomarker in liquid biopsy (e.g. tumour marker in blood or urine)"],"deleted":["Autopsy","Biomarker in liquid biopsy (e.g. tumor marker in blood or urine)"]}}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."},"displayName":{"left":null,"right":"Recurrance Tumour Staging System"}},"restrictions":{"codeList":{"left":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"deleted":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"]}},"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(\n field =>\n Object.keys(convertedRow).includes(field) &&\n (!convertedRow[field] || checkforEmpty(convertedRow[field])),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_t_category":{"description":{"left":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":true,"right":null},"displayName":{"left":null,"right":"Recurrence T Category"}},"restrictions":{}},"recurrence_n_category":{"description":{"left":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":true,"right":null},"displayName":{"left":null,"right":"Recurrence N Category"}},"restrictions":{}},"recurrence_m_category":{"description":{"left":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":true,"right":null},"displayName":{"left":null,"right":"Recurrence M Category"}},"restrictions":{}},"recurrence_stage_group":{"description":{"left":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery.","right":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) at the time of retreatment for a recurrence or disease progression."},"meta":{"core":{"left":true,"right":null},"notes":{"left":null,"right":"This field is dependent on the selected recurrence_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications"},"displayName":{"left":null,"right":"Recurrence Stage Group"}},"restrictions":{}},"posttherapy_tumour_staging_system":{"meta":{},"restrictions":{"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(\n field =>\n Object.keys(convertedRow).includes(field) &&\n (!convertedRow[field] || checkforEmpty(convertedRow[field])),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"deleted":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"]}}}},"posttherapy_t_category":{"meta":{"dependsOn":{"left":"follow_up.post_therapy_tumour_staging_system","right":"follow_up.posttherapy_tumour_staging_system"},"displayName":{"left":null,"right":"Post-therapy T Category"}},"restrictions":{}},"posttherapy_n_category":{"description":{"left":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"dependsOn":{"left":"follow_up.post_therapy_tumour_staging_system","right":"follow_up.posttherapy_tumour_staging_system"},"displayName":{"left":null,"right":"Post-therapy N Category"}},"restrictions":{}},"posttherapy_m_category":{"description":{"left":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"dependsOn":{"left":"follow_up.post_therapy_tumour_staging_system","right":"follow_up.posttherapy_tumour_staging_system"},"displayName":{"left":null,"right":"Post-therapy M Category"}},"restrictions":{}},"posttherapy_stage_group":{"meta":{"dependsOn":{"left":"follow_up.post_therapy_tumour_staging_system","right":"follow_up.posttherapy_tumour_staging_system"},"notes":{"left":"This field value is dependent on the selected posttherapy_tumour_staging_system.","right":"This field is dependent on the selected posttherapy_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications"},"displayName":{"left":null,"right":"Post-therapy Stage Group"}},"restrictions":{}}},"created":{"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate if the follow-up is related to a specific primary diagnosis event in the clinical timeline.","meta":{"validationDependency":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID","primaryId":true},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"Indicate if the follow-up is related to a specific treatment event in the clinical timeline.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"weight_at_followup":{"changeType":"created","description":"Indicate the donor's weight, in kilograms (kg), at the time of follow-up.","name":"weight_at_followup","valueType":"number","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Weight at Follow-Up"}},"anatomic_site_progression_or_recurrence":{"changeType":"created","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"anatomic_site_progression_or_recurrences":{"changeType":"deleted","description":"Indicate the anatomic site where disease progression or recurrence occurred. (Codelist reference: NCI CDE ID: 4742851)","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"],"codeList":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear, pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal; distal","Esophageal; mid","Esophageal; proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck, NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es), maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"]},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","notes":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse."}}}},"immunotherapy":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"immunotherapy_type":{"changeType":"created","name":"immunotherapy_type","valueType":"string","description":"Indicate the type of immunotherapy administered to donor.","meta":{"displayName":"Immunotherapy Type","core":true},"restrictions":{"required":true,"codeList":["Cell-based","Immune checkpoint inhibitors","Monoclonal antibodies other than immune checkpoint inhibitors","Other immunomodulatory substances"]}},"drug_rxnormcui":{"changeType":"created","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"created","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"created","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{}},"surgery":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"created","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"created","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"created","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"created","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"created","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"created","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"created","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"created","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"created","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"created","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"created","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"created","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"created","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"created","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}},"deleted":{}},"exposure":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"created","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"created","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"created","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"created","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"created","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"created","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"created","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"created","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"created","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"created","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"created","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"created","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"created","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}},"deleted":{}},"family_history":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"family_relative_id":{"changeType":"created","description":"Unique identifier of the relative, assigned by the data provider.","name":"family_relative_id","valueType":"string","meta":{"displayName":"Family Relative ID","primaryId":true,"notes":"This field is required to ensure that family members are identified in unique records. Ids can be as simple as an incremented numeral to ensure uniqueness."},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"relative_with_cancer_history":{"changeType":"created","description":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","name":"relative_with_cancer_history","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Relative with Cancer History"}},"relationship_type":{"changeType":"created","description":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","name":"relationship_type","restrictions":{"codeList":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"]},"valueType":"string","meta":{"displayName":"Relationship Type"}},"gender_of_relative":{"changeType":"created","description":"The self-reported gender of related individual.","name":"gender_of_relative","restrictions":{"codeList":["Female","Male","Other","Unknown"]},"valueType":"string","meta":{"displayName":"Gender of Relative"}},"age_of_relative_at_diagnosis":{"changeType":"created","description":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","name":"age_of_relative_at_diagnosis","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","displayName":"Age Of Relative At Diagnosis"}},"cancer_type_code_of_relative":{"changeType":"created","name":"cancer_type_code_of_relative","valueType":"string","description":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"examples":"C41.1,C16.9,C00.5,D46.9","dependsOn":"family_history.relative_with_cancer_history","displayName":"Cancer Type Code (ICD-10) of Relative"}},"relative_vital_status":{"changeType":"created","description":"Relative's last known state of living or deceased.","name":"relative_vital_status","restrictions":{"codeList":["Alive","Deceased","Unknown"]},"valueType":"string","meta":{"displayName":"Vital Status of Relative"}},"cause_of_death_of_relative":{"changeType":"created","description":"Indicate the cause of the death of the relative.","name":"cause_of_death_of_relative","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]},"valueType":"string","meta":{"dependsOn":"family_history.relative_vital_status","displayName":"Cause of Death of Relative"}},"relative_survival_time":{"changeType":"created","description":"Indicate how long, in days, the relative survived from the time they were diagnosed with cancer.","name":"relative_survival_time","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","units":"days","displayName":"Survival Time Of Relative"}}},"deleted":{}},"biomarker":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"created","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"created","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"created","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"created","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"created","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"created","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"created","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"created","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"created","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"created","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"created","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"created","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"created","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"created","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"created","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"created","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"created","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"created","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"created","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}},"deleted":{}},"comorbidity":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"created","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"created","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"created","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"created","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"created","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"created","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}},"deleted":{}}}} diff --git a/scripts/data/schemas/diffs/1.0/1.0-diff-1.24.json b/scripts/data/schemas/diffs/1.0/1.0-diff-1.24.json new file mode 100644 index 00000000..41924dbf --- /dev/null +++ b/scripts/data/schemas/diffs/1.0/1.0-diff-1.24.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"],"deleted":[]}},"script":{"left":["(function validate() {\r\n\r\n const row = $row;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n const designation = row.tumour_normal_designation.trim().toLowerCase();\r\n const specimen_type = $field.trim().toLowerCase();\r\n \r\n if (designation === \"normal\"){\r\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\r\n if (!validTypes.includes(specimen_type)){\r\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when tumour_normal_designation is set to Normal.\"};\r\n }\r\n }\r\n else if (designation === \"tumour\") {\r\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\r\n if (invalidTypes.includes(specimen_type)){\r\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when tumour_normal_designation is set to Tumour.\"};\r\n }\r\n }\r\n return result;\r\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"]}}},"submitter_sample_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased","Unknown"],"right":["Alive","Deceased"],"data":{"added":[],"deleted":["Unknown"]}}}},"cause_of_death":{"restrictions":{"script":{"left":["(function validate() {\r\n let result = {valid: true, message: \"Ok\"};\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n const vitalStatus = $row.vital_status.trim().toLowerCase();\r\n \r\n if (!currField && vitalStatus === \"deceased\"){\r\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\r\n }\r\n else if (currField && vitalStatus != \"deceased\"){\r\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\r\n }\r\n return result;\r\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]}}},"survival_time":{"restrictions":{"script":{"left":["(function validate() {\r\n let result = {valid: true, message: \"Ok\"};\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n const vitalStatus = $row.vital_status.trim().toLowerCase();\r\n \r\n if (!currField && vitalStatus === \"deceased\"){\r\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\r\n }\r\n else if (currField && vitalStatus != \"deceased\"){\r\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\r\n }\r\n return result;\r\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"primary_site":{"meta":{"notes":{"left":null,"right":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"examples":{"left":null,"right":"Breast|Ovary"}},"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Not Reported","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva","Unknown"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"data":{"added":["Unknown primary site"],"deleted":["Not Reported","Unknown"]}}}},"height":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"weight":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"bmi":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"menopause_status":{"description":{"left":"Indicate the donor's menopause status at the time of primary diagnosis. (Codelist reference: NCI CDE ID: 2434914)","right":"Indicate the donor's menopause status at the time of primary diagnosis. (Reference: caDSR CDE ID 2434914)"},"restrictions":{"codeList":{"left":["Indeterminate or unknown","Not applicable","Perimenopausal","Postmenopausal","Premenopausal"],"right":["Not applicable","Perimenopausal","Postmenopausal","Premenopausal","Unknown"],"data":{"added":["Unknown"],"deleted":["Indeterminate or unknown"]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age of menarche, the first occurrence of menstruation.","right":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)"},"restrictions":{}},"number_of_pregnancies":{"description":{"left":"Indicate the number of pregnancies a donor has had.","right":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)"},"restrictions":{}},"number_of_children":{"description":{"left":"Indicate the number of children the donor has birthed.","right":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)"},"restrictions":{}}},"created":{"genetic_disorders":{"changeType":"created","description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},"hrt_type":{"changeType":"created","description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},"hrt_duration":{"changeType":"created","description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},"contraception_type":{"changeType":"created","description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},"contraception_duration":{"changeType":"created","description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},"lost_to_followup_after_clinical_event_id":{"changeType":"created","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}},"deleted":{"prior_malignancy":{"changeType":"deleted","description":"Prior malignancy affecting donor.","name":"prior_malignancy","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy","examples":"C41.1, C16.9, C00.5, D46.9"}},"cancer_type_prior_malignancy":{"changeType":"deleted","description":"The code to represent the cancer type of a prior malignancy using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","name":"cancer_type_prior_malignancy","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"valueType":"string","meta":{"displayName":"Cancer Type Prior Malignancy"}},"age_at_prior_malignancy":{"changeType":"deleted","description":"If donor has history of prior malignancy, indicate age at previous diagnosis, in years.","name":"age_at_prior_malignancy","valueType":"integer","meta":{"displayName":"Age at Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"deleted","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Codelist reference: NCI CDE: 4122391)","name":"laterality_of_prior_malignancy","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality at Prior Malignancy"}}}},"specimen":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null},"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"pathological_tumour_staging_system":{"meta":{"validationDependency":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n /* This is not a required field, so first ensure that it exists */\r\n if ($field) {\r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"pathological_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"pathological_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"pathological_stage_group":{"restrictions":{"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.pathological_tumour_staging_system && $field) {\r\n let codeList = [];\r\n switch ($row.pathological_tumour_staging_system && $row.pathological_tumour_staging_system.trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb',\r\n 'stage ive',\r\n 'stage ivs'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When 'pathological_tumour_staging_system' is set to '${\r\n $row.pathological_tumour_staging_system\r\n }', 'pathological_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"specimen_storage":{"description":{"left":"Indicate the method of specimen storage for specimens that were not extracted freshly or immediately cultured.","right":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured."},"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"reference_pathology_confirmed":{"description":{"left":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist.","right":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)"}},"tumour_grading_system":{"meta":{"validationDependency":{"left":null,"right":true}}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.tumour_grading_system && $field) {\r\n let codeList = [];\r\n const tieredGradingList = ['gx','g1','g2','g3'];\r\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\r\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\r\n case 'two-tier grading system':\r\n codeList = [\r\n 'low grade',\r\n 'high grade',\r\n ];\r\n break;\r\n case 'three-tier grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'four-tier grading system':\r\n codeList = [\r\n 'gx',\r\n 'g1',\r\n 'g2',\r\n 'g3',\r\n 'g4',\r\n ];\r\n break;\r\n case 'grading system for gists':\r\n codeList = [\r\n 'low',\r\n 'high',\r\n ];\r\n break;\r\n case 'grading system for gnets':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'isup grading system':\r\n codeList = [\r\n 'gx',\r\n 'g1',\r\n 'g2',\r\n 'g3',\r\n 'g4',\r\n ];\r\n break;\r\n case 'who grading system for cns tumours':\r\n codeList = [\r\n 'grade i',\r\n 'grade ii',\r\n 'grade iii',\r\n 'grade iv',\r\n ];\r\n break;\r\n case 'fnclcc grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'gleason grade group system':\r\n codeList = [\r\n 'grade group 1',\r\n 'grade group 2',\r\n 'grade group 3',\r\n 'grade group 4',\r\n 'grade group 5',\r\n ];\r\n break;\r\n case 'scarff-bloom-richardson grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'nuclear grading system for dcis':\r\n codeList = tieredGradingList;\r\n break;\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase())) {\r\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\r\n $row.tumour_grading_system\r\n }', 'tumour_grade' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\r\n result.valid = false;\r\n const msg = \"'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.\";\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"percent_tumour_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of infiltration by tumour cells in a specimen.","right":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)"},"restrictions":{}},"percent_proliferating_cells":{"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_inflammatory_tissue":{"description":{"left":"Indicate a value, in decimals, that represents local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue.","right":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_stromal_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a malignant tumour specimen but are not malignant such as fibroblasts, vascular structures, etc.","right":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_necrosis":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of cell death in a malignant tumour specimen.","right":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}}},"created":{"specimen_laterality":{"changeType":"created","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"percent_tumour_cells_measurement_method":{"changeType":"created","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}},"deleted":{}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"age_at_diagnosis":{"description":{"left":"Age that the donor was first diagnosed with cancer, in years.","right":"Age that the donor was first diagnosed with cancer, in years. This should be based on the earliest diagnosis of cancer."},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0,"max":90}}}},"number_lymph_nodes_positive":{"description":{"left":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: NCI CDE ID: 6113694)","right":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: caDSR CDE ID 6113694)"},"meta":{"dependsOn":{"left":null,"right":"primary_diagnosis.lymph_nodes_examined_status"},"notes":{"left":null,"right":"This field is only required if 'lymph_nodes_examined_status' is 'Yes'."}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"]},"range":{"left":null,"right":{"min":0}}}},"number_lymph_nodes_examined":{"description":{"left":"The total number of lymph nodes tested for the presence of cancer. (Reference: NCI CDE ID: 3)","right":"The total number of lymph nodes tested for the presence of cancer. (Reference: caDSR CDE ID 3)"},"meta":{"dependsOn":{"left":null,"right":"primary_diagnosis.lymph_nodes_examined_status"},"notes":{"left":null,"right":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'."}},"restrictions":{}},"clinical_tumour_staging_system":{"meta":{"validationDependency":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n /* This is not a required field, so first ensure that it exists */\r\n if ($field) {\r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"required":{"left":true,"right":null},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"clinical_stage_group":{"description":{"left":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.).","right":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage."},"meta":{"examples":{"left":null,"right":"Stage I, Stage IIB"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.clinical_tumour_staging_system && $field) {\r\n let codeList = [];\r\n switch ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system.trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb',\r\n 'stage ive',\r\n 'stage ivs'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When 'clinical_tumour_staging_system' is set to '${\r\n $row.clinical_tumour_staging_system\r\n }', 'clinical_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"clinical_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"clinical_n_category":{"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"clinical_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"presenting_symptoms":{"restrictions":{"codeList":{"left":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Loss of Appetite","Nausea","None","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Unknown","Vomiting","Weight Loss"],"right":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Loss of Appetite","Nausea","None","Not Reported","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Swelling in the Neck","Unknown","Vomiting","Weight Loss"],"data":{"added":["Not Reported","Swelling in the Neck"],"deleted":[]}}}},"performance_status":{"description":{"left":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference source: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status).","right":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status)."},"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}}},"created":{"laterality":{"changeType":"created","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_status":{"changeType":"created","name":"lymph_nodes_examined_status","description":"Indicate if lymph nodes were examined for metastases.","valueType":"string","restrictions":{"required":true,"codeList":["Cannot be determined","No","No lymph nodes found in resected specimen","Not applicable","Yes"]},"meta":{"core":true,"displayName":"Lymph Nodes Examined Status"}},"lymph_nodes_examined_method":{"changeType":"created","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}},"deleted":{}},"treatment":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null},"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":["End of life care"],"deleted":[]}}}},"is_primary_treatment":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Yes","No","Unknown"],"right":["Yes","No"],"data":{"added":[],"deleted":["Unknown"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"line_of_treatment":{"meta":{"dependsOn":{"left":null,"right":"treatment.is_primary_treatment"}},"restrictions":{}},"treatment_start_interval":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_duration":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"days_per_cycle":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{}},"number_of_cycles":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{}},"toxicity_type":{"description":{"left":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hemotological toxicity or non-hemotological toxicity.","right":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity."},"meta":{"dependsOn":{"left":null,"right":"treatment.outcome_of_treatment"}},"restrictions":{"codeList":{"left":["Hemotological","Non-hemotological"],"right":["Hematological","Non-hematological","Not applicable","Unknown"],"data":{"added":["Hematological","Non-hematological","Not applicable","Unknown"],"deleted":["Hemotological","Non-hemotological"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"]}}},"adverse_events":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"codeList":{"left":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"right":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"data":{"added":["None","Unknown"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"clinical_trials_database":{"meta":{"notes":{"left":null,"right":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added."}},"restrictions":{"codeList":{"left":["NCI Clinical Trials","EU Clinical Trials Register"],"right":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"],"data":{"added":["Not applicable","Unknown"],"deleted":[]}}}},"clinical_trial_number":{"restrictions":{"script":{"left":["(function validate() {\r\n let result = {valid: true, message: \"Ok\"};\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n //regex check for clinical trial number\r\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\r\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\r\n\r\n // list of valid clinical trial databases\r\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\r\n \r\n if ($row.clinical_trials_database && $field) {\r\n const trialNumber = $field.trim();\r\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\r\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\r\n result = {valid: false, message: 'The submitted NCI clinical trial number is in incorrect format.'};\r\n }\r\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\r\n result = {valid: false, message: \"The submitted EudraCT clinical trial number is in incorrect format.\"};\r\n }\r\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\r\n result = {valid: false, message: \"The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database.\"};\r\n }\r\n }\r\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\r\n result = {valid: true, message: \"Ok\"};\r\n }\r\n else if ($row.clinical_trials_database && !$field) {\r\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\r\n result = {valid: false, message: \"'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.\"};\r\n } \r\n }\r\n return result;\r\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"]}}}},"created":{"treatment_intent":{"changeType":"created","name":"treatment_intent","description":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"]},"meta":{"core":true,"displayName":"Treatment Intent","dependsOn":"treatment.treatment_type"}},"treatment_setting":{"changeType":"created","name":"treatment_setting","description":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: NCIt C124308)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"]},"meta":{"core":true,"displayName":"Treatment Setting","dependsOn":"treatment.treatment_type"}},"response_to_treatment_criteria_method":{"changeType":"created","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},"response_to_treatment":{"changeType":"created","name":"response_to_treatment","description":"The donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"codeList":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"]},"meta":{"core":true,"displayName":"Response To Treatment","dependsOn":"treatment.response_to_treatment_criteria_method","notes":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"outcome_of_treatment":{"changeType":"created","name":"outcome_of_treatment","description":"Indicate the donor's outcome of the prescribed treatment.","valueType":"string","restrictions":{"codeList":["Treatment completed as prescribed","Treatment incomplete due to technical or organizational problems","Treatment incomplete because patient died","Patient choice (stopped or interrupted treatment)","Physician decision (stopped or interrupted treatment)","Treatment stopped due to lack of efficacy (disease progression)","Treatment stopped due to acute toxicity","Other","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Outcome Of Treatment","dependsOn":"treatment.treatment_type"}},"hematological_toxicity":{"changeType":"created","name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"non-hematological_toxicity":{"changeType":"created","name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"age_at_consent_for_treatment":{"changeType":"deleted","name":"age_at_consent_for_treatment","description":"Indicate the age of donor when consent was given for treatment.","valueType":"integer","meta":{"displayName":"Age At Consent For Treatment"}},"therapeutic_intent":{"changeType":"deleted","name":"therapeutic_intent","description":"The therapeutic intent, the reason behind the choice of a therapy, of the treatment.","valueType":"string","restrictions":{"required":true,"codeList":["Adjuvant","Concurrent","Curative","Neoadjuvant","Not applicable","Palliative","Unknown"]},"meta":{"core":true,"displayName":"Therapeutic Intent"}},"response_to_therapy":{"changeType":"deleted","name":"response_to_therapy","description":"The donor's response to the applied treatment regimen. (Source: RECIST)","valueType":"string","restrictions":{"required":true,"codeList":["Complete response","Disease progression","NED","Partial response","Stable disease"]},"meta":{"core":true,"displayName":"Response To Therapy"}},"outcome_of_therapy":{"changeType":"deleted","name":"outcome_of_therapy","description":"Indicate the donor's outcome of the prescribed treatment.","valueType":"string","restrictions":{"codeList":["Treatment completed as prescribed","Treatment incomplete due to technical or organizational problems","Treatment incomplete because patient died","Patient choice (stopped or interrupted treatment)","Physician decision (stopped or interrupted treatment)","Treatment stopped due to lack of efficacy (disease progression)","Treatment stopped due to acute toxicity","Other","Not applicable","Unknown"]},"meta":{"displayName":"Outcome Of Therapy"}},"hemotological_toxicity":{"changeType":"deleted","name":"hemotological_toxicity","description":"Indicate the hemotological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5"]},"meta":{"displayName":"Hemotological Toxicity","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"chemotherapy":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"description":{"left":"Name of agent or drug administered to patient as part of the treatment regimen.","right":"Name of agent or drug administered to donor as part of the treatment regimen."},"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"created","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"created","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"created","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"created","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}},"deleted":{"chemotherapy_dosage_units":{"changeType":"deleted","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate the total drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"description":{"left":"Name of agent or drug administered to patient as part of the treatment regimen.","right":"Name of agent or drug administered to donor as part of the treatment regimen."},"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"created","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{"hormone_drug_dosage_units":{"changeType":"deleted","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"radiation":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"radiation_therapy_fractions":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"radiation_therapy_dosage":{"valueType":{"left":"integer","right":"number"},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"anatomical_site_irradiated":{"description":{"left":"Indicate localization site where radiation therapy was administered.","right":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)"},"restrictions":{"codeList":{"left":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"right":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"data":{"added":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"],"deleted":["Bone","Extremities","Head-Neck","Peritoneum"]}}}}},"created":{"radiation_boost":{"changeType":"created","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"created","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}},"deleted":{}},"follow_up":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_follow_up_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"disease_status_at_followup":{"description":{"left":"Indicate the donor's disease status at time of follow-up.","right":"Indicate the donor's disease status at time of follow-up. (Reference: RECIST)"},"restrictions":{"codeList":{"left":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Relapse or recurrence","Stable"],"right":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Progression NOS","Relapse or recurrence","Stable"],"data":{"added":["Progression NOS"],"deleted":[]}}}},"submitter_primary_diagnosis_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null},"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null},"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"treatment.submitter_treatment_id"}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"weight_at_followup":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"relapse_type":{"restrictions":{"script":{"left":["(function validate() {\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"relapse_interval":{"restrictions":{"script":{"left":["(function validate() {\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const intervalOfFollowup = parseInt($row.interval_of_followup);\r\n\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n relapseInterval = parseInt($field);\r\n if (relapseInterval > intervalOfFollowup) {\r\n result = {valid: false, message: `'${$name}' cannot be greater than the 'interval_of_followup'.` }\r\n }\r\n }\r\n return result;\r\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"]}}},"method_of_progression_status":{"description":{"left":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Codelist reference: NCI CDE ID: 6161031)","right":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Reference: caDSR CDE ID 6161031)"},"restrictions":{"script":{"left":["(function validate() {\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}},"script":{"left":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n /* This is not a required field, so first ensure that it exists */\r\n if ($field) {\r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })()","(function validate() {\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_t_category":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"recurrence_n_category":{"meta":{"core":{"left":true,"right":null}}},"recurrence_m_category":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"recurrence_stage_group":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.recurrence_tumour_staging_system && $field) {\r\n let codeList = [];\r\n switch ($row.recurrence_tumour_staging_system && $row.recurrence_tumour_staging_system.trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb',\r\n 'stage ive',\r\n 'stage ivs'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When 'recurrence_tumour_staging_system' is set to '${\r\n $row.recurrence_tumour_staging_system\r\n }', 'recurrence_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"posttherapy_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n /* This is not a required field, so first ensure that it exists */\r\n if ($field) {\r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"posttherapy_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"posttherapy_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"posttherapy_stage_group":{"restrictions":{"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.posttherapy_tumour_staging_system && $field) {\r\n let codeList = [];\r\n switch ($row.posttherapy_tumour_staging_system && $row.posttherapy_tumour_staging_system.trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb',\r\n 'stage ive',\r\n 'stage ivs'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When 'posttherapy_tumour_staging_system' is set to '${\r\n $row.posttherapy_tumour_staging_system\r\n }', 'posttherapy_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}}},"created":{"anatomic_site_progression_or_recurrence":{"changeType":"created","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"anatomic_site_progression_or_recurrences":{"changeType":"deleted","description":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate() {\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })()"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1,C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}}}},"immunotherapy":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"immunotherapy_type":{"changeType":"created","name":"immunotherapy_type","valueType":"string","description":"Indicate the type of immunotherapy administered to donor.","meta":{"displayName":"Immunotherapy Type","core":true},"restrictions":{"required":true,"codeList":["Cell-based","Immune checkpoint inhibitors","Monoclonal antibodies other than immune checkpoint inhibitors","Other immunomodulatory substances"]}},"drug_rxnormcui":{"changeType":"created","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"created","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"created","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{}},"surgery":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"created","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"created","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"created","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"created","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"created","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"created","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"created","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"created","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"created","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"created","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"created","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"created","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"created","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"created","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}},"deleted":{}},"exposure":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"created","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"created","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"created","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"created","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"created","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"created","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"created","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"created","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"created","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"created","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"created","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"created","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"created","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}},"deleted":{}},"family_history":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"family_relative_id":{"changeType":"created","description":"Unique identifier of the relative, assigned by the data provider.","name":"family_relative_id","valueType":"string","meta":{"displayName":"Family Relative ID","primaryId":true,"notes":"This field is required to ensure that family members are identified in unique records. Ids can be as simple as an incremented numeral to ensure uniqueness."},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"relative_with_cancer_history":{"changeType":"created","description":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","name":"relative_with_cancer_history","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Relative with Cancer History"}},"relationship_type":{"changeType":"created","description":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","name":"relationship_type","restrictions":{"codeList":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"]},"valueType":"string","meta":{"displayName":"Relationship Type"}},"gender_of_relative":{"changeType":"created","description":"The self-reported gender of related individual.","name":"gender_of_relative","restrictions":{"codeList":["Female","Male","Other","Unknown"]},"valueType":"string","meta":{"displayName":"Gender of Relative"}},"age_of_relative_at_diagnosis":{"changeType":"created","description":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","name":"age_of_relative_at_diagnosis","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","displayName":"Age Of Relative At Diagnosis"}},"cancer_type_code_of_relative":{"changeType":"created","name":"cancer_type_code_of_relative","valueType":"string","description":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"examples":"C41.1,C16.9,C00.5,D46.9","dependsOn":"family_history.relative_with_cancer_history","displayName":"Cancer Type Code (ICD-10) of Relative"}},"relative_vital_status":{"changeType":"created","description":"Relative's last known state of living or deceased.","name":"relative_vital_status","restrictions":{"codeList":["Alive","Deceased","Unknown"]},"valueType":"string","meta":{"displayName":"Vital Status of Relative"}},"cause_of_death_of_relative":{"changeType":"created","description":"Indicate the cause of the death of the relative.","name":"cause_of_death_of_relative","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]},"valueType":"string","meta":{"dependsOn":"family_history.relative_vital_status","displayName":"Cause of Death of Relative"}},"relative_survival_time":{"changeType":"created","description":"Indicate how long, in days, the relative survived from the time they were diagnosed with cancer.","name":"relative_survival_time","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","units":"days","displayName":"Survival Time Of Relative"}}},"deleted":{}},"biomarker":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"created","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"created","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"created","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"created","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"created","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"created","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"created","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"created","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"created","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"created","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"created","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"created","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"created","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"created","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"created","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"created","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"created","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"created","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"created","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}},"deleted":{}},"comorbidity":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"created","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"created","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"created","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"created","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"created","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"created","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}},"deleted":{}}}} diff --git a/scripts/data/schemas/diffs/1.1/1.1-diff-1.24.json b/scripts/data/schemas/diffs/1.1/1.1-diff-1.24.json new file mode 100644 index 00000000..ad276aa5 --- /dev/null +++ b/scripts/data/schemas/diffs/1.1/1.1-diff-1.24.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"],"deleted":[]}},"script":{"left":["(function validate() {\n\n const row = $row;\n let result = {valid: true, message: \"Ok\"};\n \n const designation = row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\"){\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when tumour_normal_designation is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when tumour_normal_designation is set to Tumour.\"};\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"]}}},"submitter_sample_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased","Unknown"],"right":["Alive","Deceased"],"data":{"added":[],"deleted":["Unknown"]}}}},"cause_of_death":{"restrictions":{"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]}}},"survival_time":{"restrictions":{"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"primary_site":{"meta":{"notes":{"left":null,"right":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"examples":{"left":null,"right":"Breast|Ovary"}},"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Not Reported","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva","Unknown"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"data":{"added":["Unknown primary site"],"deleted":["Not Reported","Unknown"]}}}},"height":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"weight":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"bmi":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"menopause_status":{"description":{"left":"Indicate the donor's menopause status at the time of primary diagnosis. (Codelist reference: NCI CDE ID: 2434914)","right":"Indicate the donor's menopause status at the time of primary diagnosis. (Reference: caDSR CDE ID 2434914)"},"restrictions":{"codeList":{"left":["Indeterminate or unknown","Not applicable","Perimenopausal","Postmenopausal","Premenopausal"],"right":["Not applicable","Perimenopausal","Postmenopausal","Premenopausal","Unknown"],"data":{"added":["Unknown"],"deleted":["Indeterminate or unknown"]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age of menarche, the first occurrence of menstruation.","right":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)"},"restrictions":{}},"number_of_pregnancies":{"description":{"left":"Indicate the number of pregnancies a donor has had.","right":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)"},"restrictions":{}},"number_of_children":{"description":{"left":"Indicate the number of children the donor has birthed.","right":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)"},"restrictions":{}}},"created":{"genetic_disorders":{"changeType":"created","description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},"hrt_type":{"changeType":"created","description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},"hrt_duration":{"changeType":"created","description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},"contraception_type":{"changeType":"created","description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},"contraception_duration":{"changeType":"created","description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},"lost_to_followup_after_clinical_event_id":{"changeType":"created","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}},"deleted":{"prior_malignancy":{"changeType":"deleted","description":"Prior malignancy affecting donor.","name":"prior_malignancy","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy","examples":"C41.1, C16.9, C00.5, D46.9"}},"cancer_type_prior_malignancy":{"changeType":"deleted","description":"The code to represent the cancer type of a prior malignancy using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","name":"cancer_type_prior_malignancy","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"valueType":"string","meta":{"displayName":"Cancer Type Prior Malignancy"}},"age_at_prior_malignancy":{"changeType":"deleted","description":"If donor has history of prior malignancy, indicate age at previous diagnosis, in years.","name":"age_at_prior_malignancy","valueType":"integer","meta":{"displayName":"Age at Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"deleted","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Codelist reference: NCI CDE: 4122391)","name":"laterality_of_prior_malignancy","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality at Prior Malignancy"}}}},"specimen":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null},"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"pathological_tumour_staging_system":{"meta":{"validationDependency":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"pathological_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"pathological_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"pathological_stage_group":{"restrictions":{"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n if ($row.pathological_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.pathological_tumour_staging_system && $row.pathological_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'pathological_tumour_staging_system' is set to '${\n $row.pathological_tumour_staging_system\n }', 'pathological_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"specimen_storage":{"description":{"left":"Indicate the method of specimen storage for specimens that were not extracted freshly or immediately cultured.","right":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured."},"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"reference_pathology_confirmed":{"description":{"left":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist.","right":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)"}},"tumour_grading_system":{"meta":{"validationDependency":{"left":null,"right":true}}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = \"'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.\";\n result.message = msg;\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"percent_tumour_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of infiltration by tumour cells in a specimen.","right":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)"},"restrictions":{}},"percent_proliferating_cells":{"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_inflammatory_tissue":{"description":{"left":"Indicate a value, in decimals, that represents local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue.","right":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_stromal_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a malignant tumour specimen but are not malignant such as fibroblasts, vascular structures, etc.","right":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_necrosis":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of cell death in a malignant tumour specimen.","right":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}}},"created":{"specimen_laterality":{"changeType":"created","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"percent_tumour_cells_measurement_method":{"changeType":"created","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}},"deleted":{}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"age_at_diagnosis":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0,"max":90}}}},"number_lymph_nodes_positive":{"description":{"left":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: NCI CDE ID: 6113694)","right":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: caDSR CDE ID 6113694)"},"meta":{"dependsOn":{"left":null,"right":"primary_diagnosis.lymph_nodes_examined_status"},"notes":{"left":null,"right":"This field is only required if 'lymph_nodes_examined_status' is 'Yes'."}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"]},"range":{"left":null,"right":{"min":0}}}},"number_lymph_nodes_examined":{"description":{"left":"The total number of lymph nodes tested for the presence of cancer. (Reference: NCI CDE ID: 3)","right":"The total number of lymph nodes tested for the presence of cancer. (Reference: caDSR CDE ID 3)"},"meta":{"dependsOn":{"left":null,"right":"primary_diagnosis.lymph_nodes_examined_status"},"notes":{"left":null,"right":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'."}},"restrictions":{}},"clinical_tumour_staging_system":{"meta":{"validationDependency":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"required":{"left":true,"right":null},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"clinical_stage_group":{"description":{"left":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.).","right":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage."},"meta":{"examples":{"left":null,"right":"Stage I, Stage IIB"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n if ($row.clinical_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'clinical_tumour_staging_system' is set to '${\n $row.clinical_tumour_staging_system\n }', 'clinical_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"clinical_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"clinical_n_category":{"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"clinical_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"presenting_symptoms":{"restrictions":{"codeList":{"left":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Loss of Appetite","Nausea","None","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Unknown","Vomiting","Weight Loss"],"right":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Loss of Appetite","Nausea","None","Not Reported","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Swelling in the Neck","Unknown","Vomiting","Weight Loss"],"data":{"added":["Not Reported","Swelling in the Neck"],"deleted":[]}}}},"performance_status":{"description":{"left":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference source: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status).","right":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status)."},"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}}},"created":{"laterality":{"changeType":"created","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_status":{"changeType":"created","name":"lymph_nodes_examined_status","description":"Indicate if lymph nodes were examined for metastases.","valueType":"string","restrictions":{"required":true,"codeList":["Cannot be determined","No","No lymph nodes found in resected specimen","Not applicable","Yes"]},"meta":{"core":true,"displayName":"Lymph Nodes Examined Status"}},"lymph_nodes_examined_method":{"changeType":"created","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}},"deleted":{}},"treatment":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null},"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":["End of life care"],"deleted":[]}}}},"is_primary_treatment":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Yes","No","Unknown"],"right":["Yes","No"],"data":{"added":[],"deleted":["Unknown"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"line_of_treatment":{"meta":{"dependsOn":{"left":null,"right":"treatment.is_primary_treatment"}},"restrictions":{}},"treatment_start_interval":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_duration":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"days_per_cycle":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{}},"number_of_cycles":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{}},"toxicity_type":{"description":{"left":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hemotological toxicity or non-hemotological toxicity.","right":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity."},"meta":{"dependsOn":{"left":null,"right":"treatment.outcome_of_treatment"}},"restrictions":{"codeList":{"left":["Hemotological","Non-hemotological"],"right":["Hematological","Non-hematological","Not applicable","Unknown"],"data":{"added":["Hematological","Non-hematological","Not applicable","Unknown"],"deleted":["Hemotological","Non-hemotological"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"]}}},"adverse_events":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"codeList":{"left":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"right":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"data":{"added":["None","Unknown"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"clinical_trials_database":{"meta":{"notes":{"left":null,"right":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added."}},"restrictions":{"codeList":{"left":["NCI Clinical Trials","EU Clinical Trials Register"],"right":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"],"data":{"added":["Not applicable","Unknown"],"deleted":[]}}}},"clinical_trial_number":{"restrictions":{"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: 'The submitted NCI clinical trial number is in incorrect format.'};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: \"The submitted EudraCT clinical trial number is in incorrect format.\"};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: \"The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database.\"};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: \"'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.\"};\n } \n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"]}}}},"created":{"treatment_intent":{"changeType":"created","name":"treatment_intent","description":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"]},"meta":{"core":true,"displayName":"Treatment Intent","dependsOn":"treatment.treatment_type"}},"treatment_setting":{"changeType":"created","name":"treatment_setting","description":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: NCIt C124308)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"]},"meta":{"core":true,"displayName":"Treatment Setting","dependsOn":"treatment.treatment_type"}},"response_to_treatment_criteria_method":{"changeType":"created","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},"response_to_treatment":{"changeType":"created","name":"response_to_treatment","description":"The donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"codeList":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"]},"meta":{"core":true,"displayName":"Response To Treatment","dependsOn":"treatment.response_to_treatment_criteria_method","notes":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"outcome_of_treatment":{"changeType":"created","name":"outcome_of_treatment","description":"Indicate the donor's outcome of the prescribed treatment.","valueType":"string","restrictions":{"codeList":["Treatment completed as prescribed","Treatment incomplete due to technical or organizational problems","Treatment incomplete because patient died","Patient choice (stopped or interrupted treatment)","Physician decision (stopped or interrupted treatment)","Treatment stopped due to lack of efficacy (disease progression)","Treatment stopped due to acute toxicity","Other","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Outcome Of Treatment","dependsOn":"treatment.treatment_type"}},"hematological_toxicity":{"changeType":"created","name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"non-hematological_toxicity":{"changeType":"created","name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"age_at_consent_for_treatment":{"changeType":"deleted","name":"age_at_consent_for_treatment","description":"Indicate the age of donor when consent was given for treatment.","valueType":"integer","meta":{"displayName":"Age At Consent For Treatment"}},"therapeutic_intent":{"changeType":"deleted","name":"therapeutic_intent","description":"The therapeutic intent, the reason behind the choice of a therapy, of the treatment.","valueType":"string","restrictions":{"required":true,"codeList":["Adjuvant","Concurrent","Curative","Neoadjuvant","Not applicable","Palliative","Unknown"]},"meta":{"core":true,"displayName":"Therapeutic Intent"}},"response_to_therapy":{"changeType":"deleted","name":"response_to_therapy","description":"The donor's response to the applied treatment regimen. (Source: RECIST)","valueType":"string","restrictions":{"required":true,"codeList":["Complete response","Disease progression","NED","Partial response","Stable disease"]},"meta":{"core":true,"displayName":"Response To Therapy"}},"outcome_of_therapy":{"changeType":"deleted","name":"outcome_of_therapy","description":"Indicate the donor's outcome of the prescribed treatment.","valueType":"string","restrictions":{"codeList":["Treatment completed as prescribed","Treatment incomplete due to technical or organizational problems","Treatment incomplete because patient died","Patient choice (stopped or interrupted treatment)","Physician decision (stopped or interrupted treatment)","Treatment stopped due to lack of efficacy (disease progression)","Treatment stopped due to acute toxicity","Other","Not applicable","Unknown"]},"meta":{"displayName":"Outcome Of Therapy"}},"hemotological_toxicity":{"changeType":"deleted","name":"hemotological_toxicity","description":"Indicate the hemotological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5"]},"meta":{"displayName":"Hemotological Toxicity","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"chemotherapy":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"description":{"left":"Name of agent or drug administered to patient as part of the treatment regimen.","right":"Name of agent or drug administered to donor as part of the treatment regimen."},"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"created","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"created","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"created","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"created","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}},"deleted":{"chemotherapy_dosage_units":{"changeType":"deleted","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate the total drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"description":{"left":"Name of agent or drug administered to patient as part of the treatment regimen.","right":"Name of agent or drug administered to donor as part of the treatment regimen."},"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"created","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{"hormone_drug_dosage_units":{"changeType":"deleted","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"radiation":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"radiation_therapy_fractions":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"radiation_therapy_dosage":{"valueType":{"left":"integer","right":"number"},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"anatomical_site_irradiated":{"description":{"left":"Indicate localization site where radiation therapy was administered.","right":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)"},"restrictions":{"codeList":{"left":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"right":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"data":{"added":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"],"deleted":["Bone","Extremities","Head-Neck","Peritoneum"]}}}}},"created":{"radiation_boost":{"changeType":"created","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"created","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}},"deleted":{}},"follow_up":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_follow_up_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null},"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null},"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"treatment.submitter_treatment_id"}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"weight_at_followup":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"relapse_type":{"restrictions":{"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"relapse_interval":{"restrictions":{"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `'${$name}' cannot be greater than the 'interval_of_followup'.` }\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"]}}},"method_of_progression_status":{"description":{"left":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Codelist reference: NCI CDE ID: 6161031)","right":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Reference: caDSR CDE ID 6161031)"},"restrictions":{"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}},"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_t_category":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"recurrence_n_category":{"meta":{"core":{"left":true,"right":null}}},"recurrence_m_category":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"recurrence_stage_group":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n if ($row.recurrence_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.recurrence_tumour_staging_system && $row.recurrence_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'recurrence_tumour_staging_system' is set to '${\n $row.recurrence_tumour_staging_system\n }', 'recurrence_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"posttherapy_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"posttherapy_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"posttherapy_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"posttherapy_stage_group":{"restrictions":{"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n if ($row.posttherapy_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.posttherapy_tumour_staging_system && $row.posttherapy_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'posttherapy_tumour_staging_system' is set to '${\n $row.posttherapy_tumour_staging_system\n }', 'posttherapy_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}}},"created":{"anatomic_site_progression_or_recurrence":{"changeType":"created","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"anatomic_site_progression_or_recurrences":{"changeType":"deleted","description":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })()"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1,C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}}}},"immunotherapy":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"immunotherapy_type":{"changeType":"created","name":"immunotherapy_type","valueType":"string","description":"Indicate the type of immunotherapy administered to donor.","meta":{"displayName":"Immunotherapy Type","core":true},"restrictions":{"required":true,"codeList":["Cell-based","Immune checkpoint inhibitors","Monoclonal antibodies other than immune checkpoint inhibitors","Other immunomodulatory substances"]}},"drug_rxnormcui":{"changeType":"created","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"created","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"created","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{}},"surgery":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"created","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"created","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"created","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"created","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"created","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"created","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"created","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"created","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"created","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"created","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"created","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"created","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"created","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"created","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}},"deleted":{}},"exposure":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"created","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"created","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"created","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"created","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"created","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"created","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"created","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"created","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"created","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"created","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"created","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"created","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"created","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}},"deleted":{}},"family_history":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"family_relative_id":{"changeType":"created","description":"Unique identifier of the relative, assigned by the data provider.","name":"family_relative_id","valueType":"string","meta":{"displayName":"Family Relative ID","primaryId":true,"notes":"This field is required to ensure that family members are identified in unique records. Ids can be as simple as an incremented numeral to ensure uniqueness."},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"relative_with_cancer_history":{"changeType":"created","description":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","name":"relative_with_cancer_history","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Relative with Cancer History"}},"relationship_type":{"changeType":"created","description":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","name":"relationship_type","restrictions":{"codeList":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"]},"valueType":"string","meta":{"displayName":"Relationship Type"}},"gender_of_relative":{"changeType":"created","description":"The self-reported gender of related individual.","name":"gender_of_relative","restrictions":{"codeList":["Female","Male","Other","Unknown"]},"valueType":"string","meta":{"displayName":"Gender of Relative"}},"age_of_relative_at_diagnosis":{"changeType":"created","description":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","name":"age_of_relative_at_diagnosis","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","displayName":"Age Of Relative At Diagnosis"}},"cancer_type_code_of_relative":{"changeType":"created","name":"cancer_type_code_of_relative","valueType":"string","description":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"examples":"C41.1,C16.9,C00.5,D46.9","dependsOn":"family_history.relative_with_cancer_history","displayName":"Cancer Type Code (ICD-10) of Relative"}},"relative_vital_status":{"changeType":"created","description":"Relative's last known state of living or deceased.","name":"relative_vital_status","restrictions":{"codeList":["Alive","Deceased","Unknown"]},"valueType":"string","meta":{"displayName":"Vital Status of Relative"}},"cause_of_death_of_relative":{"changeType":"created","description":"Indicate the cause of the death of the relative.","name":"cause_of_death_of_relative","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]},"valueType":"string","meta":{"dependsOn":"family_history.relative_vital_status","displayName":"Cause of Death of Relative"}},"relative_survival_time":{"changeType":"created","description":"Indicate how long, in days, the relative survived from the time they were diagnosed with cancer.","name":"relative_survival_time","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","units":"days","displayName":"Survival Time Of Relative"}}},"deleted":{}},"biomarker":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"created","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"created","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"created","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"created","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"created","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"created","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"created","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"created","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"created","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"created","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"created","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"created","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"created","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"created","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"created","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"created","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"created","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"created","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"created","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}},"deleted":{}},"comorbidity":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"created","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"created","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"created","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"created","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"created","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"created","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}},"deleted":{}}}} diff --git a/scripts/data/schemas/diffs/1.10/1.10-diff-1.24.json b/scripts/data/schemas/diffs/1.10/1.10-diff-1.24.json new file mode 100644 index 00000000..083d4d30 --- /dev/null +++ b/scripts/data/schemas/diffs/1.10/1.10-diff-1.24.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \r\n const designation = $row.tumour_normal_designation.trim().toLowerCase();\r\n const specimen_type = $field.trim().toLowerCase();\r\n \r\n if (designation === \"normal\") {\r\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\r\n if (!validTypes.includes(specimen_type)) {\r\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\r\n }\r\n }\r\n else if (designation === \"tumour\") {\r\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\r\n if (invalidTypes.includes(specimen_type)) {\r\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\r\n }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"]}}},"submitter_sample_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased","Unknown"],"right":["Alive","Deceased"],"data":{"added":[],"deleted":["Unknown"]}}}},"cause_of_death":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n \r\n if ($row.vital_status != null) {\r\n const vitalStatus = $row.vital_status.trim().toLowerCase();\r\n\r\n if (!currField && vitalStatus === \"deceased\") {\r\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\r\n }\r\n else if (currField && vitalStatus != \"deceased\"){\r\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\r\n }\r\n }\r\n else if (($row.vital_status === null) && (currField)) {\r\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]}}},"survival_time":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n \r\n if ($row.vital_status != null) {\r\n const vitalStatus = $row.vital_status.trim().toLowerCase();\r\n\r\n if (!currField && vitalStatus === \"deceased\") {\r\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\r\n }\r\n else if (currField && vitalStatus != \"deceased\"){\r\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\r\n }\r\n }\r\n else if (($row.vital_status === null) && (currField)) {\r\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]}}},"primary_site":{"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"data":{"added":["Unknown primary site"],"deleted":[]}}}},"genetic_disorders":{"description":{"left":"Indicate presence of any hereditary genetic disorders. (Reference: Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","right":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)"},"restrictions":{"codeList":{"left":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Serrated Polyposis Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"],"right":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"],"data":{"added":["None","Not applicable","Unknown"],"deleted":[]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age at which the first menstruation event occurred. (Reference: NCIt C19666)","right":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)"}},"hrt_type":{"restrictions":{"codeList":{"left":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Other","Patch","Pill","Unknown"],"right":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"],"data":{"added":["Not applicable"],"deleted":[]}}}},"hrt_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n const type = $name.trim().toLowerCase().split('_duration')[0];\r\n const hormoneType = type + `_type`;\r\n \r\n if ($field != null && !(checkforEmpty($field))) {\r\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\r\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\r\n }\r\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\") {\r\n const submittedValue = $row[hormoneType].toLowerCase()\r\n result = {valid: false, message: `If '${$name}' is submitted, then '${hormoneType}' field cannot be '${submittedValue}'.`};\r\n }\r\n\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"]}}},"contraception_type":{"restrictions":{"codeList":{"left":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Other","Progestin-only pill","Unknown","Vaginal ring"],"right":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"],"data":{"added":["Not applicable","Oral contraceptive pill"],"deleted":[]}}}},"contraception_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n const type = $name.trim().toLowerCase().split('_duration')[0];\r\n const hormoneType = type + `_type`;\r\n \r\n if ($field != null && !(checkforEmpty($field))) {\r\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\r\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\r\n }\r\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\") {\r\n const submittedValue = $row[hormoneType].toLowerCase()\r\n result = {valid: false, message: `If '${$name}' is submitted, then '${hormoneType}' field cannot be '${submittedValue}'.`};\r\n }\r\n\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"]}}}},"created":{"lost_to_followup_after_clinical_event_id":{"changeType":"created","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}},"deleted":{}},"specimen":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"pathological_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\r\n\r\n \r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\r\n if (!($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n /* This is not a required field, so first ensure that it exists */\r\n else if ($field) {\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"pathological_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"pathological_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"pathological_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Cannot be assessed"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_stage_group')[0];\r\n\r\n const stagingSystem = stagingName + `_tumour_staging_system`;\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\r\n result.valid = false;\r\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\r\n result.message = msg;\r\n }\r\n else if (!($row[stagingSystem]) && $field) {\r\n result.valid = false;\r\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\r\n result.message = msg;\r\n }\r\n else if ($row[stagingSystem] && $field) {\r\n let codeList = [];\r\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage ii bulky',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ies',\r\n 'stage iae',\r\n 'stage ias',\r\n 'stage iaes',\r\n 'stage ib',\r\n 'stage ibe',\r\n 'stage ibs',\r\n 'stage ibes',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iies',\r\n 'stage iiae',\r\n 'stage iias',\r\n 'stage iiaes',\r\n 'stage iib',\r\n 'stage iibe',\r\n 'stage iibs',\r\n 'stage iibes',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iiies',\r\n 'stage iiiae',\r\n 'stage iiias',\r\n 'stage iiiaes',\r\n 'stage iiib',\r\n 'stage iiibe',\r\n 'stage iiibs',\r\n 'stage iiibes',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ive',\r\n 'stage ivs',\r\n 'stage ives',\r\n 'stage ivae',\r\n 'stage ivas',\r\n 'stage ivaes',\r\n 'stage ivb',\r\n 'stage ivbe',\r\n 'stage ivbs',\r\n 'stage ivbes'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\r\n $row[stagingSystem]\r\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n \r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"specimen_acquisition_interval":{"restrictions":{"range":{"left":{"min":0},"right":null}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"specimen_storage":{"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"reference_pathology_confirmed":{"description":{"left":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist.","right":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)"}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.tumour_grading_system && $field) {\r\n let codeList = [];\r\n const tieredGradingList = ['gx','g1','g2','g3'];\r\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\r\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\r\n case 'two-tier grading system':\r\n codeList = [\r\n 'low grade',\r\n 'high grade',\r\n ];\r\n break;\r\n case 'three-tier grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'four-tier grading system':\r\n codeList = [\r\n 'gx',\r\n 'g1',\r\n 'g2',\r\n 'g3',\r\n 'g4',\r\n ];\r\n break;\r\n case 'grading system for gists':\r\n codeList = [\r\n 'low',\r\n 'high',\r\n ];\r\n break;\r\n case 'grading system for gnets':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'isup grading system':\r\n codeList = [\r\n 'gx',\r\n 'g1',\r\n 'g2',\r\n 'g3',\r\n 'g4',\r\n ];\r\n break;\r\n case 'who grading system for cns tumours':\r\n codeList = [\r\n 'grade i',\r\n 'grade ii',\r\n 'grade iii',\r\n 'grade iv',\r\n ];\r\n break;\r\n case 'fnclcc grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'gleason grade group system':\r\n codeList = [\r\n 'grade group 1',\r\n 'grade group 2',\r\n 'grade group 3',\r\n 'grade group 4',\r\n 'grade group 5',\r\n ];\r\n break;\r\n case 'scarff-bloom-richardson grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'nuclear grading system for dcis':\r\n codeList = tieredGradingList;\r\n break;\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase())) {\r\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\r\n $row.tumour_grading_system\r\n }', 'tumour_grade' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\r\n result.valid = false;\r\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"percent_tumour_cells":{"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"]}}},"percent_proliferating_cells":{"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}}},"percent_inflammatory_tissue":{"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}}},"percent_stromal_cells":{"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}}},"percent_necrosis":{"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}}}},"created":{"specimen_laterality":{"changeType":"created","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"percent_tumour_cells_measurement_method":{"changeType":"created","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}},"deleted":{}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"number_lymph_nodes_examined":{"meta":{"notes":{"left":null,"right":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'."}},"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n /* checks for a string just consisting of whitespacei */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\r\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\r\n \r\n if ($row.lymph_nodes_examined_status != null) {\r\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\r\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\r\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\r\n if (lymphNodesExaminedStatus === \"yes\") { \r\n if (parseInt($field) <= 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n else if (parseInt($field) > 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n \r\n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\r\n else if ($name === \"number_lymph_nodes_positive\") {\r\n if (lymphNodesExaminedStatus === \"yes\") {\r\n if (checkforEmpty($field) || $field == null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n else if (parseInt($field) < 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n else if ($field || $field != null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n }\r\n return result;\r\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"]}}},"number_lymph_nodes_positive":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n /* checks for a string just consisting of whitespacei */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\r\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\r\n \r\n if ($row.lymph_nodes_examined_status != null) {\r\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\r\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\r\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\r\n if (lymphNodesExaminedStatus === \"yes\") { \r\n if (parseInt($field) <= 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n else if (parseInt($field) > 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n \r\n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\r\n else if ($name === \"number_lymph_nodes_positive\") {\r\n if (lymphNodesExaminedStatus === \"yes\") {\r\n if (checkforEmpty($field) || $field == null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n else if (parseInt($field) < 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n else if ($field || $field != null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n }\r\n return result;\r\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"]}}},"clinical_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\r\n\r\n \r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\r\n if (!($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n /* This is not a required field, so first ensure that it exists */\r\n else if ($field) {\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"clinical_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"clinical_n_category":{"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"clinical_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"clinical_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Cannot be assessed"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_stage_group')[0];\r\n\r\n const stagingSystem = stagingName + `_tumour_staging_system`;\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\r\n result.valid = false;\r\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\r\n result.message = msg;\r\n }\r\n else if (!($row[stagingSystem]) && $field) {\r\n result.valid = false;\r\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\r\n result.message = msg;\r\n }\r\n else if ($row[stagingSystem] && $field) {\r\n let codeList = [];\r\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage ii bulky',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ies',\r\n 'stage iae',\r\n 'stage ias',\r\n 'stage iaes',\r\n 'stage ib',\r\n 'stage ibe',\r\n 'stage ibs',\r\n 'stage ibes',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iies',\r\n 'stage iiae',\r\n 'stage iias',\r\n 'stage iiaes',\r\n 'stage iib',\r\n 'stage iibe',\r\n 'stage iibs',\r\n 'stage iibes',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iiies',\r\n 'stage iiiae',\r\n 'stage iiias',\r\n 'stage iiiaes',\r\n 'stage iiib',\r\n 'stage iiibe',\r\n 'stage iiibs',\r\n 'stage iiibes',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ive',\r\n 'stage ivs',\r\n 'stage ives',\r\n 'stage ivae',\r\n 'stage ivas',\r\n 'stage ivaes',\r\n 'stage ivb',\r\n 'stage ivbe',\r\n 'stage ivbs',\r\n 'stage ivbes'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\r\n $row[stagingSystem]\r\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n \r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"performance_status":{"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}}},"created":{"laterality":{"changeType":"created","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_method":{"changeType":"created","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}},"deleted":{}},"treatment":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":["End of life care"],"deleted":[]}}}},"is_primary_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Yes","No","Unknown"],"right":["Yes","No"],"data":{"added":[],"deleted":["Unknown"]}}}},"line_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\r\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\r\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\r\n if (isPrimaryTreatment === 'yes') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\r\n }\r\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\r\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\r\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\r\n }\r\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\r\n else if (isPrimaryTreatment === 'unknown') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'unknown'.`};\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"]}}},"treatment_start_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":{"exclusiveMin":0},"right":null}}},"treatment_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"days_per_cycle":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"number_of_cycles":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_intent":{"description":{"left":"Indicate the intended disease outcome for which the treatment is given. (Reference: NCIt C124307)","right":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)"},"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Curative","Palliative","Unknown"],"right":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"],"data":{"added":["Diagnostic","Forensic","Guidance","Preventative","Screening","Supportive"],"deleted":["Unknown"]}}}},"treatment_setting":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Adjuvant","Advanced/Metastatic","Neoadjuvant","Not applicable"],"right":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"],"data":{"added":["Conditioning","Induction","Maintenance","Mobilization","Preventative","Radiosensitization","Salvage"],"deleted":["Not applicable"]}}}},"response_to_treatment":{"description":{"left":"The donor's response to the applied treatment regimen. (Source: RECIST)","right":"The donor's response to the applied treatment regimen."},"meta":{"dependsOn":{"left":"treatment.treatment_type","right":"treatment.response_to_treatment_criteria_method"},"notes":{"left":null,"right":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"]},"codeList":{"left":["Complete response","Disease progression","NED","Partial response","Stable disease"],"right":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"],"data":{"added":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease"],"deleted":["Disease progression","NED"]}}}},"outcome_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"toxicity_type":{"restrictions":{"codeList":{"left":["Hematological","Non-hematological"],"right":["Hematological","Non-hematological","Not applicable","Unknown"],"data":{"added":["Not applicable","Unknown"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($field != null && !(checkforEmpty($field))) {\r\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \r\n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\r\n \r\n /* toxicityType should only be submitted if treatment was terminated early due to acute toxicity ('outcome_of_treatment' is 'Treatment stopped due to acute toxicity'). */\r\n if (outcomeOfTreatment != \"treatment stopped due to acute toxicity\") {\r\n result = { valid: false, message: `The 'outcome_of_treatment' field should be 'Treatment stopped due to acute toxicity' if the '${$name}' field is submitted.`};\r\n }\r\n }\r\n else {\r\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"]}}},"hematological_toxicity":{"restrictions":{"codeList":{"left":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5"],"right":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"data":{"added":["Unknown"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($field != null && !(checkforEmpty($field))) {\r\n if (($row.toxicity_type != null && !(checkforEmpty($row.toxicity_type)))) { \r\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\r\n \r\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\r\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\r\n }\r\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\r\n }\r\n }\r\n else {\r\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}},"non-hematological_toxicity":{"restrictions":{"codeList":{"left":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"right":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"data":{"added":["Unknown"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($field != null && !(checkforEmpty($field))) {\r\n if (($row.toxicity_type != null && !(checkforEmpty($row.toxicity_type)))) { \r\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\r\n \r\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\r\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\r\n }\r\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\r\n }\r\n }\r\n else {\r\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}},"adverse_events":{"restrictions":{"codeList":{"left":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"right":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"data":{"added":["None","Unknown"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"clinical_trials_database":{"meta":{"notes":{"left":null,"right":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added."}},"restrictions":{"codeList":{"left":["NCI Clinical Trials","EU Clinical Trials Register"],"right":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"],"data":{"added":["Not applicable","Unknown"],"deleted":[]}}}},"clinical_trial_number":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n //regex check for clinical trial number\r\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\r\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\r\n\r\n // list of valid clinical trial databases\r\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\r\n \r\n if ($row.clinical_trials_database && $field) {\r\n const trialNumber = $field.trim();\r\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\r\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\r\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\r\n }\r\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\r\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\r\n }\r\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\r\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database.`};\r\n }\r\n }\r\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\r\n result = {valid: true, message: \"Ok\"};\r\n }\r\n else if ($row.clinical_trials_database && !$field) {\r\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\r\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\r\n } \r\n }\r\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\r\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"]}}}},"created":{"response_to_treatment_criteria_method":{"changeType":"created","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}}},"deleted":{}},"chemotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"created","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"created","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"created","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"created","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}},"deleted":{"chemotherapy_dosage_units":{"changeType":"deleted","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate the total actual drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true,"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"created","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{"hormone_drug_dosage_units":{"changeType":"deleted","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true,"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"radiation":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"radiation_therapy_dosage":{"valueType":{"left":"integer","right":"number"}},"anatomical_site_irradiated":{"description":{"left":"Indicate localization site where radiation therapy was administered.","right":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)"},"restrictions":{"codeList":{"left":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"right":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"data":{"added":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"],"deleted":["Bone","Extremities","Head-Neck","Peritoneum"]}}}}},"created":{"radiation_boost":{"changeType":"created","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"created","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}},"deleted":{}},"immunotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"immunotherapy_type":{"meta":{"core":{"left":null,"right":true}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"immunotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"displayName":{"left":"Immunotherapy Drug Name","right":"Chemotherapy Drug Name"},"dependsOn":{"left":null,"right":"immunotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"created","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{}},"follow_up":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_follow_up_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"interval_of_followup":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"treatment.submitter_treatment_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"relapse_type":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n if ($row.disease_status_at_followup != null) {\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"relapse_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n if ($row.disease_status_at_followup != null) {\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const intervalOfFollowup = parseInt($row.interval_of_followup);\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n relapseInterval = parseInt($field);\r\n if (relapseInterval > intervalOfFollowup) {\r\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\r\n }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"]},"range":{"left":{"exclusiveMin":0},"right":null}}},"method_of_progression_status":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n if ($row.disease_status_at_followup != null) {\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"anatomic_site_progression_or_recurrence":{"description":{"left":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","right":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344."},"meta":{"examples":{"left":"C50.1,C18","right":"C50.1|C18"},"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}},"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n if ($row.disease_status_at_followup != null) {\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\r\n\r\n \r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\r\n if (!($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n /* This is not a required field, so first ensure that it exists */\r\n else if ($field) {\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })","(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n if ($row.disease_status_at_followup != null) {\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_t_category":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"recurrence_n_category":{"meta":{"core":{"left":true,"right":null}}},"recurrence_m_category":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"recurrence_stage_group":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Cannot be assessed"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_stage_group')[0];\r\n\r\n const stagingSystem = stagingName + `_tumour_staging_system`;\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\r\n result.valid = false;\r\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\r\n result.message = msg;\r\n }\r\n else if (!($row[stagingSystem]) && $field) {\r\n result.valid = false;\r\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\r\n result.message = msg;\r\n }\r\n else if ($row[stagingSystem] && $field) {\r\n let codeList = [];\r\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage ii bulky',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ies',\r\n 'stage iae',\r\n 'stage ias',\r\n 'stage iaes',\r\n 'stage ib',\r\n 'stage ibe',\r\n 'stage ibs',\r\n 'stage ibes',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iies',\r\n 'stage iiae',\r\n 'stage iias',\r\n 'stage iiaes',\r\n 'stage iib',\r\n 'stage iibe',\r\n 'stage iibs',\r\n 'stage iibes',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iiies',\r\n 'stage iiiae',\r\n 'stage iiias',\r\n 'stage iiiaes',\r\n 'stage iiib',\r\n 'stage iiibe',\r\n 'stage iiibs',\r\n 'stage iiibes',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ive',\r\n 'stage ivs',\r\n 'stage ives',\r\n 'stage ivae',\r\n 'stage ivas',\r\n 'stage ivaes',\r\n 'stage ivb',\r\n 'stage ivbe',\r\n 'stage ivbs',\r\n 'stage ivbes'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\r\n $row[stagingSystem]\r\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n \r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"posttherapy_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\r\n\r\n \r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\r\n if (!($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n /* This is not a required field, so first ensure that it exists */\r\n else if ($field) {\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"posttherapy_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"posttherapy_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"posttherapy_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Cannot be assessed"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_stage_group')[0];\r\n\r\n const stagingSystem = stagingName + `_tumour_staging_system`;\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\r\n result.valid = false;\r\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\r\n result.message = msg;\r\n }\r\n else if (!($row[stagingSystem]) && $field) {\r\n result.valid = false;\r\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\r\n result.message = msg;\r\n }\r\n else if ($row[stagingSystem] && $field) {\r\n let codeList = [];\r\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage ii bulky',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ies',\r\n 'stage iae',\r\n 'stage ias',\r\n 'stage iaes',\r\n 'stage ib',\r\n 'stage ibe',\r\n 'stage ibs',\r\n 'stage ibes',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iies',\r\n 'stage iiae',\r\n 'stage iias',\r\n 'stage iiaes',\r\n 'stage iib',\r\n 'stage iibe',\r\n 'stage iibs',\r\n 'stage iibes',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iiies',\r\n 'stage iiiae',\r\n 'stage iiias',\r\n 'stage iiiaes',\r\n 'stage iiib',\r\n 'stage iiibe',\r\n 'stage iiibs',\r\n 'stage iiibes',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ive',\r\n 'stage ivs',\r\n 'stage ives',\r\n 'stage ivae',\r\n 'stage ivas',\r\n 'stage ivaes',\r\n 'stage ivb',\r\n 'stage ivbe',\r\n 'stage ivbs',\r\n 'stage ivbes'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\r\n $row[stagingSystem]\r\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n \r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}}},"created":{},"deleted":{}},"exposure":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"tobacco_smoking_status":{"restrictions":{"codeList":{"left":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Smoking history not documented"],"right":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"],"data":{"added":["Not applicable"],"deleted":[]}}}},"tobacco_type":{"restrictions":{"codeList":{"left":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Roll-ups","Snuff","Unknown","Waterpipe"],"right":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"data":{"added":["Not applicable","Pipe"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n // check tobacco related fields\r\n if ($name === 'tobacco_type') {\r\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\r\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\r\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\r\n }\r\n else if ($row.tobacco_smoking_status.toLowerCase() === 'smoking history not documented') {\r\n result = { valid: false, message: `The 'tobacco_smoking_status' field (smoking status not documented) is inconsistent if donor smoked '${$row.tobacco_type}'.`};\r\n }\r\n else if ($row.tobacco_smoking_status.toLowerCase() === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if donor is a lifelong non-smoker.`}\r\n }\r\n }\r\n else {\r\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\r\n if (smokerCategories.includes($row.tobacco_smoking_status.toLowerCase())) {\r\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\r\n }\r\n }\r\n }\r\n }\r\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\r\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\r\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}}},"pack_years_smoked":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n // check tobacco related fields\r\n if ($name === 'tobacco_type') {\r\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\r\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\r\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\r\n }\r\n else if ($row.tobacco_smoking_status.toLowerCase() === 'smoking history not documented') {\r\n result = { valid: false, message: `The 'tobacco_smoking_status' field (smoking status not documented) is inconsistent if donor smoked '${$row.tobacco_type}'.`};\r\n }\r\n else if ($row.tobacco_smoking_status.toLowerCase() === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if donor is a lifelong non-smoker.`}\r\n }\r\n }\r\n else {\r\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\r\n if (smokerCategories.includes($row.tobacco_smoking_status.toLowerCase())) {\r\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\r\n }\r\n }\r\n }\r\n }\r\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\r\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\r\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}}},"alcohol_history":{"restrictions":{"codeList":{"left":["Yes","No","Unknown"],"right":["Yes","No","Not applicable","Unknown"],"data":{"added":["Not applicable"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\r\n noOrUnknownAllowedCategories = [\"none\", \"occasional drinker (< once a month)\", \"unknown\"];\r\n \r\n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\r\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\r\n if ((!$field || $field == null || checkforEmpty($field)) && alcoholHistoryCategories.includes(alcoholConsumptionCategory)) {\r\n result = {valid:false, message: `If the donor is a '${alcoholConsumptionCategory}', then the 'alcohol_history' field must be submitted as well.`};\r\n }\r\n if ((!$field || $field === null || checkforEmpty($field) || $field.trim().toLowerCase() === 'no') && (!(noOrUnknownAllowedCategories.includes(alcoholConsumptionCategory)))) {\r\n result = {valid:false, message: `If the donor is a '${alcoholConsumptionCategory}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}}},"alcohol_consumption_category":{"restrictions":{"codeList":{"left":["Daily Drinker","None","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"right":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"data":{"added":["Not applicable"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\r\n \r\n if (!$field || $field === null || checkforEmpty($field)) {\r\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\r\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\r\n }\r\n }\r\n else {\r\n alcoholConsumptionCategory = $field.trim().toLowerCase();\r\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\r\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}}},"alcohol_type":{"restrictions":{"codeList":{"left":["Beer","Liquor","Other","Unknown","Wine"],"right":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"data":{"added":["Not applicable"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n exclusionTerms = [\"no\", \"none\", \"unknown\"]; \r\n requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\r\n \r\n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\r\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\r\n if ($field && $field != null && !(checkforEmpty($field))) {\r\n if (exclusionTerms.includes(alcoholConsumptionCategory)) {\r\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field should not be submitted.`};\r\n }\r\n }\r\n else {\r\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\r\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\r\n }\r\n }\r\n }\r\n if ($field && $field != null && !(checkforEmpty($field)) && (!$row.alcohol_consumption_category || $row.alcohol_consumption_category === null || checkforEmpty($row.alcohol_consumption_category))) {\r\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}},"opiate_use":{"restrictions":{"codeList":{"left":["Never","Unknown","Yes, currently","Yes, only in the past"],"right":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"],"data":{"added":["Not applicable"],"deleted":[]}}}},"hot_drinks_consumption":{"restrictions":{"codeList":{"left":["Never","Unknown","Yes, currently","Yes, only in the past"],"right":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"],"data":{"added":["Not applicable"],"deleted":[]}}}},"red_meat_frequency":{"restrictions":{"codeList":{"left":["Never","Less than once a month","1-3 times a month","Once or twice a week","Most days but not every day","Every day","Unknown"],"right":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"],"data":{"added":["Not applicable"],"deleted":[]}}}},"processed_meat_frequency":{"restrictions":{"codeList":{"left":["Never","Less than once a month","1-3 times a month","Once or twice a week","Most days but not every day","Every day","Unknown"],"right":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"],"data":{"added":["Not applicable"],"deleted":[]}}}},"soft_drinks_frequency":{"restrictions":{"codeList":{"left":["Never","Less than once a month","1-3 times a month","Once or twice a week","Most days but not every day","Every day","Unknown"],"right":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"],"data":{"added":["Not applicable"],"deleted":[]}}}},"exercise_frequency":{"restrictions":{"codeList":{"left":["Never","Less than once a month","1-3 times a month","Once or twice a week","Most days but not every day","Every day","Unknown"],"right":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"],"data":{"added":["Not applicable"],"deleted":[]}}}},"exercise_intensity":{"restrictions":{"codeList":{"left":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Vigorous: Increase in the heart beat substantially with heavy perspiration"],"right":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"data":{"added":["Not applicable","Unknown"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($field != null || !(checkforEmpty($field))) {\r\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency)) && $row.exercise_frequency.trim().toLowerCase() === \"never\") {\r\n result = {valid: false, message: `The 'exercise_frequency' field cannot be 'never' if the '${$name}' field is submitted.`};\r\n }\r\n } \r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}}},"created":{},"deleted":{}},"family_history":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"family_relative_id":{"meta":{"primaryId":{"left":null,"right":true}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"relationship_type":{"restrictions":{"codeList":{"left":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Sister","Son","Unknown"],"right":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"],"data":{"added":["Maternal Uncle","Paternal Uncle","Uncle"],"deleted":[]}}}},"age_of_relative_at_diagnosis":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n if ($row.relative_with_cancer_history != null) {\r\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\r\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\r\n };\r\n }\r\n }\r\n else {\r\n if (currField || currField != null) {\r\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}},"cancer_type_code_of_relative":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n if ($row.relative_with_cancer_history != null) {\r\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\r\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\r\n };\r\n }\r\n }\r\n else {\r\n if (currField || currField != null) {\r\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}},"cause_of_death_of_relative":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n if ($row.relative_vital_status && $row.relative_vital_status != null) {\r\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\r\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\r\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\r\n }\r\n }\r\n else {\r\n if ($field || $field != null) {\r\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]}}},"relative_survival_time":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n if ($row.relative_with_cancer_history != null) {\r\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\r\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\r\n };\r\n }\r\n }\r\n else {\r\n if (currField || currField != null) {\r\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}}},"created":{},"deleted":{}},"comorbidity":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"laterality_of_prior_malignancy":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n const invalidTypes = [\"no\", \"unknown\"]\r\n \r\n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\r\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\r\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}},"age_at_comorbidity_diagnosis":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n const invalidTypes = [\"no\", \"unknown\"]\r\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\r\n \r\n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\r\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\r\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\r\n }\r\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\r\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\r\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\r\n }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]}}},"comorbidity_type_code":{"meta":{"notes":{"left":null,"right":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n const invalidTypes = [\"no\", \"unknown\"]\r\n /* check if ICD-10 code is for neoplasms */\r\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\r\n\r\n \r\n if (neoplasmCode($row.comorbidity_type_code)) { \r\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\r\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\r\n }\r\n }\r\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\r\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"]}}},"comorbidity_treatment_status":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n const invalidTypes = [\"no\", \"unknown\"]\r\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\r\n \r\n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\r\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\r\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\r\n }\r\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\r\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\r\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\r\n }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]}}},"comorbidity_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n const invalidTypes = [\"no\", \"unknown\"]\r\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\r\n \r\n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\r\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\r\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\r\n }\r\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\r\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\r\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\r\n }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]}}}},"created":{},"deleted":{}},"surgery":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"created","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"created","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"created","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"created","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"created","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"created","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"created","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"created","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"created","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"created","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"created","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"created","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"created","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"created","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}},"deleted":{}},"biomarker":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"created","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"created","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"created","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"created","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"created","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"created","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"created","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"created","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"created","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"created","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"created","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"created","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"created","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"created","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"created","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"created","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"created","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"created","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"created","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}},"deleted":{}}}} diff --git a/scripts/data/schemas/diffs/1.11/1.11-diff-1.24.json b/scripts/data/schemas/diffs/1.11/1.11-diff-1.24.json new file mode 100644 index 00000000..a16830e0 --- /dev/null +++ b/scripts/data/schemas/diffs/1.11/1.11-diff-1.24.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \r\n const designation = $row.tumour_normal_designation.trim().toLowerCase();\r\n const specimen_type = $field.trim().toLowerCase();\r\n \r\n if (designation === \"normal\") {\r\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\r\n if (!validTypes.includes(specimen_type)) {\r\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\r\n }\r\n }\r\n else if (designation === \"tumour\") {\r\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\r\n if (invalidTypes.includes(specimen_type)) {\r\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\r\n }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"]}}},"submitter_sample_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased","Unknown"],"right":["Alive","Deceased"],"data":{"added":[],"deleted":["Unknown"]}}}},"cause_of_death":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n \r\n if ($row.vital_status != null) {\r\n const vitalStatus = $row.vital_status.trim().toLowerCase();\r\n\r\n if (!currField && vitalStatus === \"deceased\") {\r\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\r\n }\r\n else if (currField && vitalStatus != \"deceased\"){\r\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\r\n }\r\n }\r\n else if (($row.vital_status === null) && (currField)) {\r\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]}}},"survival_time":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n \r\n if ($row.vital_status != null) {\r\n const vitalStatus = $row.vital_status.trim().toLowerCase();\r\n\r\n if (!currField && vitalStatus === \"deceased\") {\r\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\r\n }\r\n else if (currField && vitalStatus != \"deceased\"){\r\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\r\n }\r\n }\r\n else if (($row.vital_status === null) && (currField)) {\r\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]}}},"primary_site":{"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"data":{"added":["Unknown primary site"],"deleted":[]}}}},"genetic_disorders":{"description":{"left":"Indicate presence of any hereditary genetic disorders. (Reference: Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","right":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)"},"restrictions":{"codeList":{"left":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Serrated Polyposis Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"],"right":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"],"data":{"added":["None","Not applicable","Unknown"],"deleted":[]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age at which the first menstruation event occurred. (Reference: NCIt C19666)","right":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)"}},"hrt_type":{"restrictions":{"codeList":{"left":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Other","Patch","Pill","Unknown"],"right":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"],"data":{"added":["Not applicable"],"deleted":[]}}}},"hrt_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n const type = $name.trim().toLowerCase().split('_duration')[0];\r\n const hormoneType = type + `_type`;\r\n \r\n if ($field != null && !(checkforEmpty($field))) {\r\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\r\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\r\n }\r\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\") {\r\n const submittedValue = $row[hormoneType].toLowerCase()\r\n result = {valid: false, message: `If '${$name}' is submitted, then '${hormoneType}' field cannot be '${submittedValue}'.`};\r\n }\r\n\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"]}}},"contraception_type":{"restrictions":{"codeList":{"left":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Other","Progestin-only pill","Unknown","Vaginal ring"],"right":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"],"data":{"added":["Not applicable","Oral contraceptive pill"],"deleted":[]}}}},"contraception_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n const type = $name.trim().toLowerCase().split('_duration')[0];\r\n const hormoneType = type + `_type`;\r\n \r\n if ($field != null && !(checkforEmpty($field))) {\r\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\r\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\r\n }\r\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\") {\r\n const submittedValue = $row[hormoneType].toLowerCase()\r\n result = {valid: false, message: `If '${$name}' is submitted, then '${hormoneType}' field cannot be '${submittedValue}'.`};\r\n }\r\n\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"]}}}},"created":{"lost_to_followup_after_clinical_event_id":{"changeType":"created","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}},"deleted":{}},"specimen":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"pathological_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\r\n\r\n \r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\r\n if (!($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n /* This is not a required field, so first ensure that it exists */\r\n else if ($field) {\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"pathological_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"pathological_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"pathological_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Cannot be assessed"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_stage_group')[0];\r\n\r\n const stagingSystem = stagingName + `_tumour_staging_system`;\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\r\n result.valid = false;\r\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\r\n result.message = msg;\r\n }\r\n else if (!($row[stagingSystem]) && $field) {\r\n result.valid = false;\r\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\r\n result.message = msg;\r\n }\r\n else if ($row[stagingSystem] && $field) {\r\n let codeList = [];\r\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage ii bulky',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ies',\r\n 'stage iae',\r\n 'stage ias',\r\n 'stage iaes',\r\n 'stage ib',\r\n 'stage ibe',\r\n 'stage ibs',\r\n 'stage ibes',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iies',\r\n 'stage iiae',\r\n 'stage iias',\r\n 'stage iiaes',\r\n 'stage iib',\r\n 'stage iibe',\r\n 'stage iibs',\r\n 'stage iibes',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iiies',\r\n 'stage iiiae',\r\n 'stage iiias',\r\n 'stage iiiaes',\r\n 'stage iiib',\r\n 'stage iiibe',\r\n 'stage iiibs',\r\n 'stage iiibes',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ive',\r\n 'stage ivs',\r\n 'stage ives',\r\n 'stage ivae',\r\n 'stage ivas',\r\n 'stage ivaes',\r\n 'stage ivb',\r\n 'stage ivbe',\r\n 'stage ivbs',\r\n 'stage ivbes'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\r\n $row[stagingSystem]\r\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n \r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"specimen_acquisition_interval":{"restrictions":{"range":{"left":{"min":0},"right":null}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"specimen_storage":{"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"reference_pathology_confirmed":{"description":{"left":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist.","right":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)"}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.tumour_grading_system && $field) {\r\n let codeList = [];\r\n const tieredGradingList = ['gx','g1','g2','g3'];\r\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\r\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\r\n case 'two-tier grading system':\r\n codeList = [\r\n 'low grade',\r\n 'high grade',\r\n ];\r\n break;\r\n case 'three-tier grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'four-tier grading system':\r\n codeList = [\r\n 'gx',\r\n 'g1',\r\n 'g2',\r\n 'g3',\r\n 'g4',\r\n ];\r\n break;\r\n case 'grading system for gists':\r\n codeList = [\r\n 'low',\r\n 'high',\r\n ];\r\n break;\r\n case 'grading system for gnets':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'isup grading system':\r\n codeList = [\r\n 'gx',\r\n 'g1',\r\n 'g2',\r\n 'g3',\r\n 'g4',\r\n ];\r\n break;\r\n case 'who grading system for cns tumours':\r\n codeList = [\r\n 'grade i',\r\n 'grade ii',\r\n 'grade iii',\r\n 'grade iv',\r\n ];\r\n break;\r\n case 'fnclcc grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'gleason grade group system':\r\n codeList = [\r\n 'grade group 1',\r\n 'grade group 2',\r\n 'grade group 3',\r\n 'grade group 4',\r\n 'grade group 5',\r\n ];\r\n break;\r\n case 'scarff-bloom-richardson grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'nuclear grading system for dcis':\r\n codeList = tieredGradingList;\r\n break;\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase())) {\r\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\r\n $row.tumour_grading_system\r\n }', 'tumour_grade' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\r\n result.valid = false;\r\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"percent_tumour_cells":{"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"]}}},"percent_proliferating_cells":{"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}}},"percent_inflammatory_tissue":{"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}}},"percent_stromal_cells":{"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}}},"percent_necrosis":{"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}}}},"created":{"specimen_laterality":{"changeType":"created","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"percent_tumour_cells_measurement_method":{"changeType":"created","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}},"deleted":{}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"number_lymph_nodes_examined":{"meta":{"notes":{"left":null,"right":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'."}},"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n /* checks for a string just consisting of whitespacei */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\r\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\r\n \r\n if ($row.lymph_nodes_examined_status != null) {\r\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\r\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\r\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\r\n if (lymphNodesExaminedStatus === \"yes\") { \r\n if (parseInt($field) <= 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n else if (parseInt($field) > 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n \r\n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\r\n else if ($name === \"number_lymph_nodes_positive\") {\r\n if (lymphNodesExaminedStatus === \"yes\") {\r\n if (checkforEmpty($field) || $field == null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n else if (parseInt($field) < 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n else if ($field || $field != null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n }\r\n return result;\r\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"]}}},"number_lymph_nodes_positive":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n /* checks for a string just consisting of whitespacei */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\r\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\r\n \r\n if ($row.lymph_nodes_examined_status != null) {\r\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\r\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\r\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\r\n if (lymphNodesExaminedStatus === \"yes\") { \r\n if (parseInt($field) <= 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n else if (parseInt($field) > 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n \r\n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\r\n else if ($name === \"number_lymph_nodes_positive\") {\r\n if (lymphNodesExaminedStatus === \"yes\") {\r\n if (checkforEmpty($field) || $field == null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n else if (parseInt($field) < 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n else if ($field || $field != null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n }\r\n return result;\r\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"]}}},"clinical_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\r\n\r\n \r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\r\n if (!($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n /* This is not a required field, so first ensure that it exists */\r\n else if ($field) {\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"clinical_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"clinical_n_category":{"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"clinical_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"clinical_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Cannot be assessed"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_stage_group')[0];\r\n\r\n const stagingSystem = stagingName + `_tumour_staging_system`;\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\r\n result.valid = false;\r\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\r\n result.message = msg;\r\n }\r\n else if (!($row[stagingSystem]) && $field) {\r\n result.valid = false;\r\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\r\n result.message = msg;\r\n }\r\n else if ($row[stagingSystem] && $field) {\r\n let codeList = [];\r\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage ii bulky',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ies',\r\n 'stage iae',\r\n 'stage ias',\r\n 'stage iaes',\r\n 'stage ib',\r\n 'stage ibe',\r\n 'stage ibs',\r\n 'stage ibes',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iies',\r\n 'stage iiae',\r\n 'stage iias',\r\n 'stage iiaes',\r\n 'stage iib',\r\n 'stage iibe',\r\n 'stage iibs',\r\n 'stage iibes',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iiies',\r\n 'stage iiiae',\r\n 'stage iiias',\r\n 'stage iiiaes',\r\n 'stage iiib',\r\n 'stage iiibe',\r\n 'stage iiibs',\r\n 'stage iiibes',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ive',\r\n 'stage ivs',\r\n 'stage ives',\r\n 'stage ivae',\r\n 'stage ivas',\r\n 'stage ivaes',\r\n 'stage ivb',\r\n 'stage ivbe',\r\n 'stage ivbs',\r\n 'stage ivbes'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\r\n $row[stagingSystem]\r\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n \r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"performance_status":{"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}}},"created":{"laterality":{"changeType":"created","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_method":{"changeType":"created","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}},"deleted":{}},"treatment":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":["End of life care"],"deleted":[]}}}},"is_primary_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Yes","No","Unknown"],"right":["Yes","No"],"data":{"added":[],"deleted":["Unknown"]}}}},"line_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\r\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\r\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\r\n if (isPrimaryTreatment === 'yes') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\r\n }\r\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\r\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\r\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\r\n }\r\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\r\n else if (isPrimaryTreatment === 'unknown') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'unknown'.`};\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"]}}},"treatment_start_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":{"exclusiveMin":0},"right":null}}},"treatment_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"days_per_cycle":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"number_of_cycles":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_intent":{"description":{"left":"Indicate the intended disease outcome for which the treatment is given. (Reference: NCIt C124307)","right":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)"},"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Curative","Palliative","Unknown"],"right":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"],"data":{"added":["Diagnostic","Forensic","Guidance","Preventative","Screening","Supportive"],"deleted":["Unknown"]}}}},"treatment_setting":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Adjuvant","Advanced/Metastatic","Neoadjuvant","Not applicable"],"right":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"],"data":{"added":["Conditioning","Induction","Maintenance","Mobilization","Preventative","Radiosensitization","Salvage"],"deleted":["Not applicable"]}}}},"response_to_treatment":{"description":{"left":"The donor's response to the applied treatment regimen. (Source: RECIST)","right":"The donor's response to the applied treatment regimen."},"meta":{"dependsOn":{"left":"treatment.treatment_type","right":"treatment.response_to_treatment_criteria_method"},"notes":{"left":null,"right":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"]},"codeList":{"left":["Complete response","Disease progression","NED","Partial response","Stable disease"],"right":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"],"data":{"added":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease"],"deleted":["Disease progression","NED"]}}}},"outcome_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"toxicity_type":{"restrictions":{"codeList":{"left":["Hematological","Non-hematological"],"right":["Hematological","Non-hematological","Not applicable","Unknown"],"data":{"added":["Not applicable","Unknown"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($field != null && !(checkforEmpty($field))) {\r\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \r\n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\r\n \r\n /* toxicityType should only be submitted if treatment was terminated early due to acute toxicity ('outcome_of_treatment' is 'Treatment stopped due to acute toxicity'). */\r\n if (outcomeOfTreatment != \"treatment stopped due to acute toxicity\") {\r\n result = { valid: false, message: `The 'outcome_of_treatment' field should be 'Treatment stopped due to acute toxicity' if the '${$name}' field is submitted.`};\r\n }\r\n }\r\n else {\r\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"]}}},"hematological_toxicity":{"restrictions":{"codeList":{"left":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5"],"right":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"data":{"added":["Unknown"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($field != null && !(checkforEmpty($field))) {\r\n if (($row.toxicity_type != null && !(checkforEmpty($row.toxicity_type)))) { \r\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\r\n \r\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\r\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\r\n }\r\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\r\n }\r\n }\r\n else {\r\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}},"non-hematological_toxicity":{"restrictions":{"codeList":{"left":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"right":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"data":{"added":["Unknown"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($field != null && !(checkforEmpty($field))) {\r\n if (($row.toxicity_type != null && !(checkforEmpty($row.toxicity_type)))) { \r\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\r\n \r\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\r\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\r\n }\r\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\r\n }\r\n }\r\n else {\r\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}},"adverse_events":{"restrictions":{"codeList":{"left":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"right":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"data":{"added":["None","Unknown"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"clinical_trials_database":{"meta":{"notes":{"left":null,"right":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added."}},"restrictions":{"codeList":{"left":["NCI Clinical Trials","EU Clinical Trials Register"],"right":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"],"data":{"added":["Not applicable","Unknown"],"deleted":[]}}}},"clinical_trial_number":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n //regex check for clinical trial number\r\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\r\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\r\n\r\n // list of valid clinical trial databases\r\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\r\n \r\n if ($row.clinical_trials_database && $field) {\r\n const trialNumber = $field.trim();\r\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\r\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\r\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\r\n }\r\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\r\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\r\n }\r\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\r\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database.`};\r\n }\r\n }\r\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\r\n result = {valid: true, message: \"Ok\"};\r\n }\r\n else if ($row.clinical_trials_database && !$field) {\r\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\r\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\r\n } \r\n }\r\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\r\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"]}}}},"created":{"response_to_treatment_criteria_method":{"changeType":"created","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}}},"deleted":{}},"chemotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"created","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"created","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"created","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"created","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}},"deleted":{"chemotherapy_dosage_units":{"changeType":"deleted","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate the total actual drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true,"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"created","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{"hormone_drug_dosage_units":{"changeType":"deleted","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true,"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"radiation":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"radiation_therapy_dosage":{"valueType":{"left":"integer","right":"number"}},"anatomical_site_irradiated":{"description":{"left":"Indicate localization site where radiation therapy was administered.","right":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)"},"restrictions":{"codeList":{"left":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"right":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"data":{"added":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"],"deleted":["Bone","Extremities","Head-Neck","Peritoneum"]}}}}},"created":{"radiation_boost":{"changeType":"created","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"created","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}},"deleted":{}},"immunotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"immunotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"displayName":{"left":"Immunotherapy Drug Name","right":"Chemotherapy Drug Name"},"dependsOn":{"left":null,"right":"immunotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"created","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{}},"follow_up":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_follow_up_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"interval_of_followup":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"treatment.submitter_treatment_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"relapse_type":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n if ($row.disease_status_at_followup != null) {\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"relapse_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n if ($row.disease_status_at_followup != null) {\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const intervalOfFollowup = parseInt($row.interval_of_followup);\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n relapseInterval = parseInt($field);\r\n if (relapseInterval > intervalOfFollowup) {\r\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\r\n }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"]},"range":{"left":{"exclusiveMin":0},"right":null}}},"method_of_progression_status":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n if ($row.disease_status_at_followup != null) {\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"anatomic_site_progression_or_recurrence":{"description":{"left":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","right":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344."},"meta":{"examples":{"left":"C50.1,C18","right":"C50.1|C18"},"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}},"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n if ($row.disease_status_at_followup != null) {\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\r\n\r\n \r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\r\n if (!($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n /* This is not a required field, so first ensure that it exists */\r\n else if ($field) {\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })","(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n if ($row.disease_status_at_followup != null) {\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_t_category":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"recurrence_n_category":{"meta":{"core":{"left":true,"right":null}}},"recurrence_m_category":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"recurrence_stage_group":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Cannot be assessed"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_stage_group')[0];\r\n\r\n const stagingSystem = stagingName + `_tumour_staging_system`;\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\r\n result.valid = false;\r\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\r\n result.message = msg;\r\n }\r\n else if (!($row[stagingSystem]) && $field) {\r\n result.valid = false;\r\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\r\n result.message = msg;\r\n }\r\n else if ($row[stagingSystem] && $field) {\r\n let codeList = [];\r\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage ii bulky',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ies',\r\n 'stage iae',\r\n 'stage ias',\r\n 'stage iaes',\r\n 'stage ib',\r\n 'stage ibe',\r\n 'stage ibs',\r\n 'stage ibes',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iies',\r\n 'stage iiae',\r\n 'stage iias',\r\n 'stage iiaes',\r\n 'stage iib',\r\n 'stage iibe',\r\n 'stage iibs',\r\n 'stage iibes',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iiies',\r\n 'stage iiiae',\r\n 'stage iiias',\r\n 'stage iiiaes',\r\n 'stage iiib',\r\n 'stage iiibe',\r\n 'stage iiibs',\r\n 'stage iiibes',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ive',\r\n 'stage ivs',\r\n 'stage ives',\r\n 'stage ivae',\r\n 'stage ivas',\r\n 'stage ivaes',\r\n 'stage ivb',\r\n 'stage ivbe',\r\n 'stage ivbs',\r\n 'stage ivbes'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\r\n $row[stagingSystem]\r\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n \r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"posttherapy_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\r\n\r\n \r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\r\n if (!($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n /* This is not a required field, so first ensure that it exists */\r\n else if ($field) {\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"posttherapy_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"posttherapy_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"posttherapy_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Cannot be assessed"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_stage_group')[0];\r\n\r\n const stagingSystem = stagingName + `_tumour_staging_system`;\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\r\n result.valid = false;\r\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\r\n result.message = msg;\r\n }\r\n else if (!($row[stagingSystem]) && $field) {\r\n result.valid = false;\r\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\r\n result.message = msg;\r\n }\r\n else if ($row[stagingSystem] && $field) {\r\n let codeList = [];\r\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage ii bulky',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ies',\r\n 'stage iae',\r\n 'stage ias',\r\n 'stage iaes',\r\n 'stage ib',\r\n 'stage ibe',\r\n 'stage ibs',\r\n 'stage ibes',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iies',\r\n 'stage iiae',\r\n 'stage iias',\r\n 'stage iiaes',\r\n 'stage iib',\r\n 'stage iibe',\r\n 'stage iibs',\r\n 'stage iibes',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iiies',\r\n 'stage iiiae',\r\n 'stage iiias',\r\n 'stage iiiaes',\r\n 'stage iiib',\r\n 'stage iiibe',\r\n 'stage iiibs',\r\n 'stage iiibes',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ive',\r\n 'stage ivs',\r\n 'stage ives',\r\n 'stage ivae',\r\n 'stage ivas',\r\n 'stage ivaes',\r\n 'stage ivb',\r\n 'stage ivbe',\r\n 'stage ivbs',\r\n 'stage ivbes'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\r\n $row[stagingSystem]\r\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n \r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}}},"created":{},"deleted":{}},"exposure":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"tobacco_smoking_status":{"restrictions":{"codeList":{"left":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Smoking history not documented"],"right":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"],"data":{"added":["Not applicable"],"deleted":[]}}}},"tobacco_type":{"restrictions":{"codeList":{"left":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Roll-ups","Snuff","Unknown","Waterpipe"],"right":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"data":{"added":["Not applicable","Pipe"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n // check tobacco related fields\r\n if ($name === 'tobacco_type') {\r\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\r\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\r\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\r\n }\r\n else if ($row.tobacco_smoking_status.toLowerCase() === 'smoking history not documented') {\r\n result = { valid: false, message: `The 'tobacco_smoking_status' field (smoking status not documented) is inconsistent if donor smoked '${$row.tobacco_type}'.`};\r\n }\r\n else if ($row.tobacco_smoking_status.toLowerCase() === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if donor is a lifelong non-smoker.`}\r\n }\r\n }\r\n else {\r\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\r\n if (smokerCategories.includes($row.tobacco_smoking_status.toLowerCase())) {\r\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\r\n }\r\n }\r\n }\r\n }\r\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\r\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\r\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}}},"pack_years_smoked":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n // check tobacco related fields\r\n if ($name === 'tobacco_type') {\r\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\r\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\r\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\r\n }\r\n else if ($row.tobacco_smoking_status.toLowerCase() === 'smoking history not documented') {\r\n result = { valid: false, message: `The 'tobacco_smoking_status' field (smoking status not documented) is inconsistent if donor smoked '${$row.tobacco_type}'.`};\r\n }\r\n else if ($row.tobacco_smoking_status.toLowerCase() === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if donor is a lifelong non-smoker.`}\r\n }\r\n }\r\n else {\r\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\r\n if (smokerCategories.includes($row.tobacco_smoking_status.toLowerCase())) {\r\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\r\n }\r\n }\r\n }\r\n }\r\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\r\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\r\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}}},"alcohol_history":{"restrictions":{"codeList":{"left":["Yes","No","Unknown"],"right":["Yes","No","Not applicable","Unknown"],"data":{"added":["Not applicable"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\r\n noOrUnknownAllowedCategories = [\"none\", \"occasional drinker (< once a month)\", \"unknown\"];\r\n \r\n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\r\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\r\n if ((!$field || $field == null || checkforEmpty($field)) && alcoholHistoryCategories.includes(alcoholConsumptionCategory)) {\r\n result = {valid:false, message: `If the donor is a '${alcoholConsumptionCategory}', then the 'alcohol_history' field must be submitted as well.`};\r\n }\r\n if ((!$field || $field === null || checkforEmpty($field) || $field.trim().toLowerCase() === 'no') && (!(noOrUnknownAllowedCategories.includes(alcoholConsumptionCategory)))) {\r\n result = {valid:false, message: `If the donor is a '${alcoholConsumptionCategory}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}}},"alcohol_consumption_category":{"restrictions":{"codeList":{"left":["Daily Drinker","None","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"right":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"data":{"added":["Not applicable"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\r\n \r\n if (!$field || $field === null || checkforEmpty($field)) {\r\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\r\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\r\n }\r\n }\r\n else {\r\n alcoholConsumptionCategory = $field.trim().toLowerCase();\r\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\r\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}}},"alcohol_type":{"restrictions":{"codeList":{"left":["Beer","Liquor","Other","Unknown","Wine"],"right":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"data":{"added":["Not applicable"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n exclusionTerms = [\"no\", \"none\", \"unknown\"]; \r\n requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\r\n \r\n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\r\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\r\n if ($field && $field != null && !(checkforEmpty($field))) {\r\n if (exclusionTerms.includes(alcoholConsumptionCategory)) {\r\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field should not be submitted.`};\r\n }\r\n }\r\n else {\r\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\r\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\r\n }\r\n }\r\n }\r\n if ($field && $field != null && !(checkforEmpty($field)) && (!$row.alcohol_consumption_category || $row.alcohol_consumption_category === null || checkforEmpty($row.alcohol_consumption_category))) {\r\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}},"opiate_use":{"restrictions":{"codeList":{"left":["Never","Unknown","Yes, currently","Yes, only in the past"],"right":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"],"data":{"added":["Not applicable"],"deleted":[]}}}},"hot_drinks_consumption":{"restrictions":{"codeList":{"left":["Never","Unknown","Yes, currently","Yes, only in the past"],"right":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"],"data":{"added":["Not applicable"],"deleted":[]}}}},"red_meat_frequency":{"restrictions":{"codeList":{"left":["Never","Less than once a month","1-3 times a month","Once or twice a week","Most days but not every day","Every day","Unknown"],"right":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"],"data":{"added":["Not applicable"],"deleted":[]}}}},"processed_meat_frequency":{"restrictions":{"codeList":{"left":["Never","Less than once a month","1-3 times a month","Once or twice a week","Most days but not every day","Every day","Unknown"],"right":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"],"data":{"added":["Not applicable"],"deleted":[]}}}},"soft_drinks_frequency":{"restrictions":{"codeList":{"left":["Never","Less than once a month","1-3 times a month","Once or twice a week","Most days but not every day","Every day","Unknown"],"right":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"],"data":{"added":["Not applicable"],"deleted":[]}}}},"exercise_frequency":{"restrictions":{"codeList":{"left":["Never","Less than once a month","1-3 times a month","Once or twice a week","Most days but not every day","Every day","Unknown"],"right":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"],"data":{"added":["Not applicable"],"deleted":[]}}}},"exercise_intensity":{"restrictions":{"codeList":{"left":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Vigorous: Increase in the heart beat substantially with heavy perspiration"],"right":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"data":{"added":["Not applicable","Unknown"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($field != null || !(checkforEmpty($field))) {\r\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency)) && $row.exercise_frequency.trim().toLowerCase() === \"never\") {\r\n result = {valid: false, message: `The 'exercise_frequency' field cannot be 'never' if the '${$name}' field is submitted.`};\r\n }\r\n } \r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}}},"created":{},"deleted":{}},"family_history":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"family_relative_id":{"meta":{"primaryId":{"left":null,"right":true}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"age_of_relative_at_diagnosis":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n if ($row.relative_with_cancer_history != null) {\r\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\r\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\r\n };\r\n }\r\n }\r\n else {\r\n if (currField || currField != null) {\r\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}},"cancer_type_code_of_relative":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n if ($row.relative_with_cancer_history != null) {\r\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\r\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\r\n };\r\n }\r\n }\r\n else {\r\n if (currField || currField != null) {\r\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}},"cause_of_death_of_relative":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n if ($row.relative_vital_status && $row.relative_vital_status != null) {\r\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\r\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\r\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\r\n }\r\n }\r\n else {\r\n if ($field || $field != null) {\r\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]}}},"relative_survival_time":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n if ($row.relative_with_cancer_history != null) {\r\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\r\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\r\n };\r\n }\r\n }\r\n else {\r\n if (currField || currField != null) {\r\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}}},"created":{},"deleted":{}},"biomarker":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"meta":{"notes":{"left":null,"right":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n let missing = true;\r\n\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\r\n \r\n if (!$field || checkforEmpty($field) || $field === null) { \r\n for (let idField of identifierFields) {\r\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\r\n continue;\r\n }\r\n else {\r\n missing = false;\r\n }\r\n }\r\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\r\n result = {\r\n valid: false,\r\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\r\n }\r\n }\r\n else if ($field && !(checkforEmpty($field)) && $field != null) {\r\n for (let idField of identifierFields) {\r\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\r\n result = {\r\n valid: false,\r\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\r\n break;\r\n }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"},"notes":{"left":null,"right":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n let missing = true;\r\n\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\r\n \r\n if (!$field || checkforEmpty($field) || $field === null) { \r\n for (let idField of identifierFields) {\r\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\r\n continue;\r\n }\r\n else {\r\n missing = false;\r\n }\r\n }\r\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\r\n result = {\r\n valid: false,\r\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\r\n }\r\n }\r\n else if ($field && !(checkforEmpty($field)) && $field != null) {\r\n for (let idField of identifierFields) {\r\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\r\n result = {\r\n valid: false,\r\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\r\n break;\r\n }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"treatment.submitter_treatment_id"},"notes":{"left":null,"right":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n let missing = true;\r\n\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\r\n \r\n if (!$field || checkforEmpty($field) || $field === null) { \r\n for (let idField of identifierFields) {\r\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\r\n continue;\r\n }\r\n else {\r\n missing = false;\r\n }\r\n }\r\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\r\n result = {\r\n valid: false,\r\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\r\n }\r\n }\r\n else if ($field && !(checkforEmpty($field)) && $field != null) {\r\n for (let idField of identifierFields) {\r\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\r\n result = {\r\n valid: false,\r\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\r\n break;\r\n }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}}},"submitter_follow_up_id":{"meta":{"foreignKey":{"left":null,"right":"follow_up.submitter_follow_up_id"},"notes":{"left":null,"right":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n let missing = true;\r\n\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\r\n \r\n if (!$field || checkforEmpty($field) || $field === null) { \r\n for (let idField of identifierFields) {\r\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\r\n continue;\r\n }\r\n else {\r\n missing = false;\r\n }\r\n }\r\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\r\n result = {\r\n valid: false,\r\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\r\n }\r\n }\r\n else if ($field && !(checkforEmpty($field)) && $field != null) {\r\n for (let idField of identifierFields) {\r\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\r\n result = {\r\n valid: false,\r\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\r\n break;\r\n }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}}},"test_interval":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n let missing = true;\r\n\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\r\n \r\n if (!$field || checkforEmpty($field) || $field === null) { \r\n for (let idField of identifierFields) {\r\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\r\n continue;\r\n }\r\n else {\r\n missing = false;\r\n }\r\n }\r\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\r\n result = {\r\n valid: false,\r\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\r\n }\r\n }\r\n else if ($field && !(checkforEmpty($field)) && $field != null) {\r\n for (let idField of identifierFields) {\r\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\r\n result = {\r\n valid: false,\r\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\r\n break;\r\n }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}}}},"created":{"ldh_level":{"changeType":"created","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}}},"deleted":{"ldl_level":{"changeType":"deleted","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldl_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}}}},"comorbidity":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"laterality_of_prior_malignancy":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n const invalidTypes = [\"no\", \"unknown\"]\r\n \r\n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\r\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\r\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}},"age_at_comorbidity_diagnosis":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n const invalidTypes = [\"no\", \"unknown\"]\r\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\r\n \r\n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\r\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\r\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\r\n }\r\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\r\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\r\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\r\n }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]}}},"comorbidity_type_code":{"meta":{"notes":{"left":null,"right":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n const invalidTypes = [\"no\", \"unknown\"]\r\n /* check if ICD-10 code is for neoplasms */\r\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\r\n\r\n \r\n if (neoplasmCode($row.comorbidity_type_code)) { \r\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\r\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\r\n }\r\n }\r\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\r\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"]}}},"comorbidity_treatment_status":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n const invalidTypes = [\"no\", \"unknown\"]\r\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\r\n \r\n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\r\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\r\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\r\n }\r\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\r\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\r\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\r\n }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]}}},"comorbidity_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n const invalidTypes = [\"no\", \"unknown\"]\r\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\r\n \r\n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\r\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\r\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\r\n }\r\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\r\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\r\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\r\n }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]}}}},"created":{},"deleted":{}},"surgery":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"created","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"created","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"created","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"created","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"created","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"created","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"created","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"created","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"created","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"created","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"created","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"created","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"created","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"created","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}},"deleted":{}}}} diff --git a/scripts/data/schemas/diffs/1.12/1.12-diff-1.24.json b/scripts/data/schemas/diffs/1.12/1.12-diff-1.24.json new file mode 100644 index 00000000..1afeefb4 --- /dev/null +++ b/scripts/data/schemas/diffs/1.12/1.12-diff-1.24.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \r\n const designation = $row.tumour_normal_designation.trim().toLowerCase();\r\n const specimen_type = $field.trim().toLowerCase();\r\n \r\n if (designation === \"normal\") {\r\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\r\n if (!validTypes.includes(specimen_type)) {\r\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\r\n }\r\n }\r\n else if (designation === \"tumour\") {\r\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\r\n if (invalidTypes.includes(specimen_type)) {\r\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\r\n }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"]}}},"submitter_sample_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased","Unknown"],"right":["Alive","Deceased"],"data":{"added":[],"deleted":["Unknown"]}}}},"cause_of_death":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n \r\n if ($row.vital_status != null) {\r\n const vitalStatus = $row.vital_status.trim().toLowerCase();\r\n\r\n if (!currField && vitalStatus === \"deceased\") {\r\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\r\n }\r\n else if (currField && vitalStatus != \"deceased\"){\r\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\r\n }\r\n }\r\n else if (($row.vital_status === null) && (currField)) {\r\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]}}},"survival_time":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n \r\n if ($row.vital_status != null) {\r\n const vitalStatus = $row.vital_status.trim().toLowerCase();\r\n\r\n if (!currField && vitalStatus === \"deceased\") {\r\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\r\n }\r\n else if (currField && vitalStatus != \"deceased\"){\r\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\r\n }\r\n }\r\n else if (($row.vital_status === null) && (currField)) {\r\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]}}},"primary_site":{"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"data":{"added":["Unknown primary site"],"deleted":[]}}}},"genetic_disorders":{"description":{"left":"Indicate presence of any hereditary genetic disorders. (Reference: Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","right":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)"},"restrictions":{"codeList":{"left":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Serrated Polyposis Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"],"right":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"],"data":{"added":["None","Not applicable","Unknown"],"deleted":[]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age at which the first menstruation event occurred. (Reference: NCIt C19666)","right":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)"}},"hrt_type":{"restrictions":{"codeList":{"left":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Other","Patch","Pill","Unknown"],"right":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"],"data":{"added":["Not applicable"],"deleted":[]}}}},"hrt_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n const type = $name.trim().toLowerCase().split('_duration')[0];\r\n const hormoneType = type + `_type`;\r\n \r\n if ($field != null && !(checkforEmpty($field))) {\r\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\r\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\r\n }\r\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\") {\r\n const submittedValue = $row[hormoneType].toLowerCase()\r\n result = {valid: false, message: `If '${$name}' is submitted, then '${hormoneType}' field cannot be '${submittedValue}'.`};\r\n }\r\n\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"]}}},"contraception_type":{"restrictions":{"codeList":{"left":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Other","Progestin-only pill","Unknown","Vaginal ring"],"right":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"],"data":{"added":["Not applicable","Oral contraceptive pill"],"deleted":[]}}}},"contraception_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n const type = $name.trim().toLowerCase().split('_duration')[0];\r\n const hormoneType = type + `_type`;\r\n \r\n if ($field != null && !(checkforEmpty($field))) {\r\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\r\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\r\n }\r\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\") {\r\n const submittedValue = $row[hormoneType].toLowerCase()\r\n result = {valid: false, message: `If '${$name}' is submitted, then '${hormoneType}' field cannot be '${submittedValue}'.`};\r\n }\r\n\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"]}}}},"created":{"lost_to_followup_after_clinical_event_id":{"changeType":"created","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}},"deleted":{}},"specimen":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"pathological_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\r\n\r\n \r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\r\n if (!($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n /* This is not a required field, so first ensure that it exists */\r\n else if ($field) {\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"pathological_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"pathological_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"pathological_stage_group":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_stage_group')[0];\r\n\r\n const stagingSystem = stagingName + `_tumour_staging_system`;\r\n const tCategory = `${stagingName}_t_category`;\r\n const nCategory = `${stagingName}_n_category`;\r\n const mCategory = `${stagingName}_m_category`;\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\r\n result.valid = false;\r\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\r\n result.message = msg;\r\n }\r\n else if (!($row[stagingSystem]) && $field) {\r\n result.valid = false;\r\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\r\n result.message = msg;\r\n }\r\n else if ($row[stagingSystem] && $field) {\r\n let codeList = [];\r\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage ii bulky',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ies',\r\n 'stage iae',\r\n 'stage ias',\r\n 'stage iaes',\r\n 'stage ib',\r\n 'stage ibe',\r\n 'stage ibs',\r\n 'stage ibes',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iies',\r\n 'stage iiae',\r\n 'stage iias',\r\n 'stage iiaes',\r\n 'stage iib',\r\n 'stage iibe',\r\n 'stage iibs',\r\n 'stage iibes',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iiies',\r\n 'stage iiiae',\r\n 'stage iiias',\r\n 'stage iiiaes',\r\n 'stage iiib',\r\n 'stage iiibe',\r\n 'stage iiibs',\r\n 'stage iiibes',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ive',\r\n 'stage ivs',\r\n 'stage ives',\r\n 'stage ivae',\r\n 'stage ivas',\r\n 'stage ivaes',\r\n 'stage ivb',\r\n 'stage ivbe',\r\n 'stage ivbs',\r\n 'stage ivbes'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\r\n $row[stagingSystem]\r\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\r\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\r\n result = {\r\n valid: false,\r\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\r\n };\r\n }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"specimen_acquisition_interval":{"restrictions":{"range":{"left":{"min":0},"right":null}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"specimen_storage":{"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"reference_pathology_confirmed":{"description":{"left":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist.","right":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)"}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.tumour_grading_system && $field) {\r\n let codeList = [];\r\n const tieredGradingList = ['gx','g1','g2','g3'];\r\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\r\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\r\n case 'two-tier grading system':\r\n codeList = [\r\n 'low grade',\r\n 'high grade',\r\n ];\r\n break;\r\n case 'three-tier grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'four-tier grading system':\r\n codeList = [\r\n 'gx',\r\n 'g1',\r\n 'g2',\r\n 'g3',\r\n 'g4',\r\n ];\r\n break;\r\n case 'grading system for gists':\r\n codeList = [\r\n 'low',\r\n 'high',\r\n ];\r\n break;\r\n case 'grading system for gnets':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'isup grading system':\r\n codeList = [\r\n 'gx',\r\n 'g1',\r\n 'g2',\r\n 'g3',\r\n 'g4',\r\n ];\r\n break;\r\n case 'who grading system for cns tumours':\r\n codeList = [\r\n 'grade i',\r\n 'grade ii',\r\n 'grade iii',\r\n 'grade iv',\r\n ];\r\n break;\r\n case 'fnclcc grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'gleason grade group system':\r\n codeList = [\r\n 'grade group 1',\r\n 'grade group 2',\r\n 'grade group 3',\r\n 'grade group 4',\r\n 'grade group 5',\r\n ];\r\n break;\r\n case 'scarff-bloom-richardson grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'nuclear grading system for dcis':\r\n codeList = tieredGradingList;\r\n break;\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase())) {\r\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\r\n $row.tumour_grading_system\r\n }', 'tumour_grade' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\r\n result.valid = false;\r\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"percent_tumour_cells":{"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"]}}},"percent_proliferating_cells":{"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}}},"percent_inflammatory_tissue":{"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}}},"percent_stromal_cells":{"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}}},"percent_necrosis":{"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}}}},"created":{"specimen_laterality":{"changeType":"created","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"percent_tumour_cells_measurement_method":{"changeType":"created","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}},"deleted":{}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"number_lymph_nodes_examined":{"meta":{"notes":{"left":null,"right":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'."}},"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n /* checks for a string just consisting of whitespacei */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\r\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\r\n \r\n if ($row.lymph_nodes_examined_status != null) {\r\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\r\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\r\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\r\n if (lymphNodesExaminedStatus === \"yes\") { \r\n if (parseInt($field) <= 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n else if (parseInt($field) > 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n \r\n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\r\n else if ($name === \"number_lymph_nodes_positive\") {\r\n if (lymphNodesExaminedStatus === \"yes\") {\r\n if (checkforEmpty($field) || $field == null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n else if (parseInt($field) < 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n else if ($field || $field != null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n }\r\n return result;\r\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"]}}},"number_lymph_nodes_positive":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n /* checks for a string just consisting of whitespacei */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\r\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\r\n \r\n if ($row.lymph_nodes_examined_status != null) {\r\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\r\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\r\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\r\n if (lymphNodesExaminedStatus === \"yes\") { \r\n if (parseInt($field) <= 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n else if (parseInt($field) > 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n \r\n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\r\n else if ($name === \"number_lymph_nodes_positive\") {\r\n if (lymphNodesExaminedStatus === \"yes\") {\r\n if (checkforEmpty($field) || $field == null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n else if (parseInt($field) < 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n else if ($field || $field != null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n }\r\n return result;\r\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"]}}},"clinical_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\r\n\r\n \r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\r\n if (!($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n /* This is not a required field, so first ensure that it exists */\r\n else if ($field) {\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"clinical_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"clinical_n_category":{"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"clinical_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"clinical_stage_group":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_stage_group')[0];\r\n\r\n const stagingSystem = stagingName + `_tumour_staging_system`;\r\n const tCategory = `${stagingName}_t_category`;\r\n const nCategory = `${stagingName}_n_category`;\r\n const mCategory = `${stagingName}_m_category`;\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\r\n result.valid = false;\r\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\r\n result.message = msg;\r\n }\r\n else if (!($row[stagingSystem]) && $field) {\r\n result.valid = false;\r\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\r\n result.message = msg;\r\n }\r\n else if ($row[stagingSystem] && $field) {\r\n let codeList = [];\r\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage ii bulky',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ies',\r\n 'stage iae',\r\n 'stage ias',\r\n 'stage iaes',\r\n 'stage ib',\r\n 'stage ibe',\r\n 'stage ibs',\r\n 'stage ibes',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iies',\r\n 'stage iiae',\r\n 'stage iias',\r\n 'stage iiaes',\r\n 'stage iib',\r\n 'stage iibe',\r\n 'stage iibs',\r\n 'stage iibes',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iiies',\r\n 'stage iiiae',\r\n 'stage iiias',\r\n 'stage iiiaes',\r\n 'stage iiib',\r\n 'stage iiibe',\r\n 'stage iiibs',\r\n 'stage iiibes',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ive',\r\n 'stage ivs',\r\n 'stage ives',\r\n 'stage ivae',\r\n 'stage ivas',\r\n 'stage ivaes',\r\n 'stage ivb',\r\n 'stage ivbe',\r\n 'stage ivbs',\r\n 'stage ivbes'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\r\n $row[stagingSystem]\r\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\r\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\r\n result = {\r\n valid: false,\r\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\r\n };\r\n }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"performance_status":{"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}}},"created":{"laterality":{"changeType":"created","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_method":{"changeType":"created","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}},"deleted":{}},"treatment":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":["End of life care"],"deleted":[]}}}},"is_primary_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Yes","No","Unknown"],"right":["Yes","No"],"data":{"added":[],"deleted":["Unknown"]}}}},"line_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\r\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\r\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\r\n if (isPrimaryTreatment === 'yes') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\r\n }\r\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\r\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\r\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\r\n }\r\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\r\n else if (isPrimaryTreatment === 'unknown') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'unknown'.`};\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"]}}},"treatment_start_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":{"exclusiveMin":0},"right":null}}},"treatment_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"days_per_cycle":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"number_of_cycles":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_intent":{"description":{"left":"Indicate the intended disease outcome for which the treatment is given. (Reference: NCIt C124307)","right":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)"},"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Curative","Palliative","Unknown"],"right":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"],"data":{"added":["Diagnostic","Forensic","Guidance","Preventative","Screening","Supportive"],"deleted":["Unknown"]}}}},"treatment_setting":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Adjuvant","Advanced/Metastatic","Neoadjuvant","Not applicable"],"right":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"],"data":{"added":["Conditioning","Induction","Maintenance","Mobilization","Preventative","Radiosensitization","Salvage"],"deleted":["Not applicable"]}}}},"response_to_treatment":{"description":{"left":"The donor's response to the applied treatment regimen. (Source: RECIST)","right":"The donor's response to the applied treatment regimen."},"meta":{"dependsOn":{"left":"treatment.treatment_type","right":"treatment.response_to_treatment_criteria_method"},"notes":{"left":null,"right":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"]},"codeList":{"left":["Complete response","Disease progression","NED","Partial response","Stable disease"],"right":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"],"data":{"added":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease"],"deleted":["Disease progression","NED"]}}}},"outcome_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"toxicity_type":{"restrictions":{"codeList":{"left":["Hematological","Non-hematological"],"right":["Hematological","Non-hematological","Not applicable","Unknown"],"data":{"added":["Not applicable","Unknown"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($field != null && !(checkforEmpty($field))) {\r\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \r\n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\r\n \r\n /* toxicityType should only be submitted if treatment was terminated early due to acute toxicity ('outcome_of_treatment' is 'Treatment stopped due to acute toxicity'). */\r\n if (outcomeOfTreatment != \"treatment stopped due to acute toxicity\") {\r\n result = { valid: false, message: `The 'outcome_of_treatment' field should be 'Treatment stopped due to acute toxicity' if the '${$name}' field is submitted.`};\r\n }\r\n }\r\n else {\r\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"]}}},"hematological_toxicity":{"restrictions":{"codeList":{"left":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5"],"right":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"data":{"added":["Unknown"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($field != null && !(checkforEmpty($field))) {\r\n if (($row.toxicity_type != null && !(checkforEmpty($row.toxicity_type)))) { \r\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\r\n \r\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\r\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\r\n }\r\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\r\n }\r\n }\r\n else {\r\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}},"non-hematological_toxicity":{"restrictions":{"codeList":{"left":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"right":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"data":{"added":["Unknown"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($field != null && !(checkforEmpty($field))) {\r\n if (($row.toxicity_type != null && !(checkforEmpty($row.toxicity_type)))) { \r\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\r\n \r\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\r\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\r\n }\r\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\r\n }\r\n }\r\n else {\r\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}},"adverse_events":{"restrictions":{"codeList":{"left":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"right":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"data":{"added":["None","Unknown"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"clinical_trials_database":{"meta":{"notes":{"left":null,"right":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added."}},"restrictions":{"codeList":{"left":["NCI Clinical Trials","EU Clinical Trials Register"],"right":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"],"data":{"added":["Not applicable","Unknown"],"deleted":[]}}}},"clinical_trial_number":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n //regex check for clinical trial number\r\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\r\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\r\n\r\n // list of valid clinical trial databases\r\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\r\n \r\n if ($row.clinical_trials_database && $field) {\r\n const trialNumber = $field.trim();\r\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\r\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\r\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\r\n }\r\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\r\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\r\n }\r\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\r\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database.`};\r\n }\r\n }\r\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\r\n result = {valid: true, message: \"Ok\"};\r\n }\r\n else if ($row.clinical_trials_database && !$field) {\r\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\r\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\r\n } \r\n }\r\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\r\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"]}}}},"created":{"response_to_treatment_criteria_method":{"changeType":"created","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}}},"deleted":{}},"chemotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"created","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"created","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"created","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"created","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}},"deleted":{"chemotherapy_dosage_units":{"changeType":"deleted","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate the total actual drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true,"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"created","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{"hormone_drug_dosage_units":{"changeType":"deleted","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true,"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"radiation":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"radiation_therapy_dosage":{"valueType":{"left":"integer","right":"number"}},"anatomical_site_irradiated":{"description":{"left":"Indicate localization site where radiation therapy was administered.","right":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)"},"restrictions":{"codeList":{"left":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"right":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"data":{"added":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"],"deleted":["Bone","Extremities","Head-Neck","Peritoneum"]}}}}},"created":{"radiation_boost":{"changeType":"created","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"created","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}},"deleted":{}},"immunotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"immunotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"displayName":{"left":"Immunotherapy Drug Name","right":"Chemotherapy Drug Name"},"dependsOn":{"left":null,"right":"immunotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"created","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{}},"follow_up":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_follow_up_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"interval_of_followup":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"treatment.submitter_treatment_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"relapse_type":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n if ($row.disease_status_at_followup != null) {\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"relapse_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n if ($row.disease_status_at_followup != null) {\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const intervalOfFollowup = parseInt($row.interval_of_followup);\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n relapseInterval = parseInt($field);\r\n if (relapseInterval > intervalOfFollowup) {\r\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\r\n }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"]},"range":{"left":{"exclusiveMin":0},"right":null}}},"method_of_progression_status":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n if ($row.disease_status_at_followup != null) {\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"anatomic_site_progression_or_recurrence":{"description":{"left":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","right":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344."},"meta":{"examples":{"left":"C50.1,C18","right":"C50.1|C18"},"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}},"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n if ($row.disease_status_at_followup != null) {\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\r\n\r\n \r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\r\n if (!($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n /* This is not a required field, so first ensure that it exists */\r\n else if ($field) {\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })","(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n if ($row.disease_status_at_followup != null) {\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_t_category":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"recurrence_n_category":{"meta":{"core":{"left":true,"right":null}}},"recurrence_m_category":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"recurrence_stage_group":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_stage_group')[0];\r\n\r\n const stagingSystem = stagingName + `_tumour_staging_system`;\r\n const tCategory = `${stagingName}_t_category`;\r\n const nCategory = `${stagingName}_n_category`;\r\n const mCategory = `${stagingName}_m_category`;\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\r\n result.valid = false;\r\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\r\n result.message = msg;\r\n }\r\n else if (!($row[stagingSystem]) && $field) {\r\n result.valid = false;\r\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\r\n result.message = msg;\r\n }\r\n else if ($row[stagingSystem] && $field) {\r\n let codeList = [];\r\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage ii bulky',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ies',\r\n 'stage iae',\r\n 'stage ias',\r\n 'stage iaes',\r\n 'stage ib',\r\n 'stage ibe',\r\n 'stage ibs',\r\n 'stage ibes',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iies',\r\n 'stage iiae',\r\n 'stage iias',\r\n 'stage iiaes',\r\n 'stage iib',\r\n 'stage iibe',\r\n 'stage iibs',\r\n 'stage iibes',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iiies',\r\n 'stage iiiae',\r\n 'stage iiias',\r\n 'stage iiiaes',\r\n 'stage iiib',\r\n 'stage iiibe',\r\n 'stage iiibs',\r\n 'stage iiibes',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ive',\r\n 'stage ivs',\r\n 'stage ives',\r\n 'stage ivae',\r\n 'stage ivas',\r\n 'stage ivaes',\r\n 'stage ivb',\r\n 'stage ivbe',\r\n 'stage ivbs',\r\n 'stage ivbes'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\r\n $row[stagingSystem]\r\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\r\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\r\n result = {\r\n valid: false,\r\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\r\n };\r\n }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"posttherapy_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\r\n\r\n \r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\r\n if (!($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n /* This is not a required field, so first ensure that it exists */\r\n else if ($field) {\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"posttherapy_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"posttherapy_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"posttherapy_stage_group":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_stage_group')[0];\r\n\r\n const stagingSystem = stagingName + `_tumour_staging_system`;\r\n const tCategory = `${stagingName}_t_category`;\r\n const nCategory = `${stagingName}_n_category`;\r\n const mCategory = `${stagingName}_m_category`;\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\r\n result.valid = false;\r\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\r\n result.message = msg;\r\n }\r\n else if (!($row[stagingSystem]) && $field) {\r\n result.valid = false;\r\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\r\n result.message = msg;\r\n }\r\n else if ($row[stagingSystem] && $field) {\r\n let codeList = [];\r\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage ii bulky',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ies',\r\n 'stage iae',\r\n 'stage ias',\r\n 'stage iaes',\r\n 'stage ib',\r\n 'stage ibe',\r\n 'stage ibs',\r\n 'stage ibes',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iies',\r\n 'stage iiae',\r\n 'stage iias',\r\n 'stage iiaes',\r\n 'stage iib',\r\n 'stage iibe',\r\n 'stage iibs',\r\n 'stage iibes',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iiies',\r\n 'stage iiiae',\r\n 'stage iiias',\r\n 'stage iiiaes',\r\n 'stage iiib',\r\n 'stage iiibe',\r\n 'stage iiibs',\r\n 'stage iiibes',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ive',\r\n 'stage ivs',\r\n 'stage ives',\r\n 'stage ivae',\r\n 'stage ivas',\r\n 'stage ivaes',\r\n 'stage ivb',\r\n 'stage ivbe',\r\n 'stage ivbs',\r\n 'stage ivbes'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\r\n $row[stagingSystem]\r\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\r\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\r\n result = {\r\n valid: false,\r\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\r\n };\r\n }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}}},"created":{},"deleted":{}},"exposure":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"tobacco_smoking_status":{"restrictions":{"codeList":{"left":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Smoking history not documented"],"right":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"],"data":{"added":["Not applicable"],"deleted":[]}}}},"tobacco_type":{"restrictions":{"codeList":{"left":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"right":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"data":{"added":["Not applicable"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n // check tobacco related fields\r\n if ($name === 'tobacco_type') {\r\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\r\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\r\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\r\n }\r\n else if ($row.tobacco_smoking_status.toLowerCase() === 'smoking history not documented') {\r\n result = { valid: false, message: `The 'tobacco_smoking_status' field (smoking status not documented) is inconsistent if donor smoked '${$row.tobacco_type}'.`};\r\n }\r\n else if ($row.tobacco_smoking_status.toLowerCase() === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if donor is a lifelong non-smoker.`}\r\n }\r\n }\r\n else {\r\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\r\n if (smokerCategories.includes($row.tobacco_smoking_status.toLowerCase())) {\r\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\r\n }\r\n }\r\n }\r\n }\r\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\r\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\r\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}}},"pack_years_smoked":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n // check tobacco related fields\r\n if ($name === 'tobacco_type') {\r\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\r\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\r\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\r\n }\r\n else if ($row.tobacco_smoking_status.toLowerCase() === 'smoking history not documented') {\r\n result = { valid: false, message: `The 'tobacco_smoking_status' field (smoking status not documented) is inconsistent if donor smoked '${$row.tobacco_type}'.`};\r\n }\r\n else if ($row.tobacco_smoking_status.toLowerCase() === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if donor is a lifelong non-smoker.`}\r\n }\r\n }\r\n else {\r\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\r\n if (smokerCategories.includes($row.tobacco_smoking_status.toLowerCase())) {\r\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\r\n }\r\n }\r\n }\r\n }\r\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\r\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\r\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}}},"alcohol_history":{"restrictions":{"codeList":{"left":["Yes","No","Unknown"],"right":["Yes","No","Not applicable","Unknown"],"data":{"added":["Not applicable"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\r\n noOrUnknownAllowedCategories = [\"none\", \"occasional drinker (< once a month)\", \"unknown\"];\r\n \r\n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\r\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\r\n if ((!$field || $field == null || checkforEmpty($field)) && alcoholHistoryCategories.includes(alcoholConsumptionCategory)) {\r\n result = {valid:false, message: `If the donor is a '${alcoholConsumptionCategory}', then the 'alcohol_history' field must be submitted as well.`};\r\n }\r\n if ((!$field || $field === null || checkforEmpty($field) || $field.trim().toLowerCase() === 'no') && (!(noOrUnknownAllowedCategories.includes(alcoholConsumptionCategory)))) {\r\n result = {valid:false, message: `If the donor is a '${alcoholConsumptionCategory}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}}},"alcohol_consumption_category":{"restrictions":{"codeList":{"left":["Daily Drinker","None","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"right":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"data":{"added":["Not applicable"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\r\n \r\n if (!$field || $field === null || checkforEmpty($field)) {\r\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\r\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\r\n }\r\n }\r\n else {\r\n alcoholConsumptionCategory = $field.trim().toLowerCase();\r\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\r\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}}},"alcohol_type":{"restrictions":{"codeList":{"left":["Beer","Liquor","Other","Unknown","Wine"],"right":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"data":{"added":["Not applicable"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n exclusionTerms = [\"no\", \"none\", \"unknown\"]; \r\n requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\r\n \r\n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\r\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\r\n if ($field && $field != null && !(checkforEmpty($field))) {\r\n if (exclusionTerms.includes(alcoholConsumptionCategory)) {\r\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field should not be submitted.`};\r\n }\r\n }\r\n else {\r\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\r\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\r\n }\r\n }\r\n }\r\n if ($field && $field != null && !(checkforEmpty($field)) && (!$row.alcohol_consumption_category || $row.alcohol_consumption_category === null || checkforEmpty($row.alcohol_consumption_category))) {\r\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}},"opiate_use":{"restrictions":{"codeList":{"left":["Never","Unknown","Yes, currently","Yes, only in the past"],"right":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"],"data":{"added":["Not applicable"],"deleted":[]}}}},"hot_drinks_consumption":{"restrictions":{"codeList":{"left":["Never","Unknown","Yes, currently","Yes, only in the past"],"right":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"],"data":{"added":["Not applicable"],"deleted":[]}}}},"red_meat_frequency":{"restrictions":{"codeList":{"left":["Never","Less than once a month","1-3 times a month","Once or twice a week","Most days but not every day","Every day","Unknown"],"right":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"],"data":{"added":["Not applicable"],"deleted":[]}}}},"processed_meat_frequency":{"restrictions":{"codeList":{"left":["Never","Less than once a month","1-3 times a month","Once or twice a week","Most days but not every day","Every day","Unknown"],"right":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"],"data":{"added":["Not applicable"],"deleted":[]}}}},"soft_drinks_frequency":{"restrictions":{"codeList":{"left":["Never","Less than once a month","1-3 times a month","Once or twice a week","Most days but not every day","Every day","Unknown"],"right":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"],"data":{"added":["Not applicable"],"deleted":[]}}}},"exercise_frequency":{"restrictions":{"codeList":{"left":["Never","Less than once a month","1-3 times a month","Once or twice a week","Most days but not every day","Every day","Unknown"],"right":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"],"data":{"added":["Not applicable"],"deleted":[]}}}},"exercise_intensity":{"restrictions":{"codeList":{"left":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Vigorous: Increase in the heart beat substantially with heavy perspiration"],"right":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"data":{"added":["Not applicable","Unknown"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($field != null || !(checkforEmpty($field))) {\r\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency)) && $row.exercise_frequency.trim().toLowerCase() === \"never\") {\r\n result = {valid: false, message: `The 'exercise_frequency' field cannot be 'never' if the '${$name}' field is submitted.`};\r\n }\r\n } \r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}}},"created":{},"deleted":{}},"family_history":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"family_relative_id":{"meta":{"primaryId":{"left":null,"right":true}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"age_of_relative_at_diagnosis":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n if ($row.relative_with_cancer_history != null) {\r\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\r\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\r\n };\r\n }\r\n }\r\n else {\r\n if (currField || currField != null) {\r\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}},"cancer_type_code_of_relative":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n if ($row.relative_with_cancer_history != null) {\r\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\r\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\r\n };\r\n }\r\n }\r\n else {\r\n if (currField || currField != null) {\r\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}},"cause_of_death_of_relative":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n if ($row.relative_vital_status && $row.relative_vital_status != null) {\r\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\r\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\r\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\r\n }\r\n }\r\n else {\r\n if ($field || $field != null) {\r\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]}}},"relative_survival_time":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n if ($row.relative_with_cancer_history != null) {\r\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\r\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\r\n };\r\n }\r\n }\r\n else {\r\n if (currField || currField != null) {\r\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}}},"created":{},"deleted":{}},"biomarker":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"meta":{"notes":{"left":null,"right":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n let missing = true;\r\n\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\r\n \r\n if (!$field || checkforEmpty($field) || $field === null) { \r\n for (let idField of identifierFields) {\r\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\r\n continue;\r\n }\r\n else {\r\n missing = false;\r\n }\r\n }\r\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\r\n result = {\r\n valid: false,\r\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\r\n }\r\n }\r\n else if ($field && !(checkforEmpty($field)) && $field != null) {\r\n for (let idField of identifierFields) {\r\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\r\n result = {\r\n valid: false,\r\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\r\n break;\r\n }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"},"notes":{"left":null,"right":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n let missing = true;\r\n\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\r\n \r\n if (!$field || checkforEmpty($field) || $field === null) { \r\n for (let idField of identifierFields) {\r\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\r\n continue;\r\n }\r\n else {\r\n missing = false;\r\n }\r\n }\r\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\r\n result = {\r\n valid: false,\r\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\r\n }\r\n }\r\n else if ($field && !(checkforEmpty($field)) && $field != null) {\r\n for (let idField of identifierFields) {\r\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\r\n result = {\r\n valid: false,\r\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\r\n break;\r\n }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"treatment.submitter_treatment_id"},"notes":{"left":null,"right":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n let missing = true;\r\n\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\r\n \r\n if (!$field || checkforEmpty($field) || $field === null) { \r\n for (let idField of identifierFields) {\r\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\r\n continue;\r\n }\r\n else {\r\n missing = false;\r\n }\r\n }\r\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\r\n result = {\r\n valid: false,\r\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\r\n }\r\n }\r\n else if ($field && !(checkforEmpty($field)) && $field != null) {\r\n for (let idField of identifierFields) {\r\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\r\n result = {\r\n valid: false,\r\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\r\n break;\r\n }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}}},"submitter_follow_up_id":{"meta":{"foreignKey":{"left":null,"right":"follow_up.submitter_follow_up_id"},"notes":{"left":null,"right":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n let missing = true;\r\n\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\r\n \r\n if (!$field || checkforEmpty($field) || $field === null) { \r\n for (let idField of identifierFields) {\r\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\r\n continue;\r\n }\r\n else {\r\n missing = false;\r\n }\r\n }\r\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\r\n result = {\r\n valid: false,\r\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\r\n }\r\n }\r\n else if ($field && !(checkforEmpty($field)) && $field != null) {\r\n for (let idField of identifierFields) {\r\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\r\n result = {\r\n valid: false,\r\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\r\n break;\r\n }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}}},"test_interval":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n let missing = true;\r\n\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\r\n \r\n if (!$field || checkforEmpty($field) || $field === null) { \r\n for (let idField of identifierFields) {\r\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\r\n continue;\r\n }\r\n else {\r\n missing = false;\r\n }\r\n }\r\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\r\n result = {\r\n valid: false,\r\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\r\n }\r\n }\r\n else if ($field && !(checkforEmpty($field)) && $field != null) {\r\n for (let idField of identifierFields) {\r\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\r\n result = {\r\n valid: false,\r\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\r\n break;\r\n }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}}}},"created":{},"deleted":{}},"comorbidity":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"laterality_of_prior_malignancy":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n const invalidTypes = [\"no\", \"unknown\"]\r\n \r\n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\r\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\r\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}},"age_at_comorbidity_diagnosis":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n const invalidTypes = [\"no\", \"unknown\"]\r\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\r\n \r\n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\r\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\r\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\r\n }\r\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\r\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\r\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\r\n }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]}}},"comorbidity_type_code":{"meta":{"notes":{"left":null,"right":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n const invalidTypes = [\"no\", \"unknown\"]\r\n /* check if ICD-10 code is for neoplasms */\r\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\r\n\r\n \r\n if (neoplasmCode($row.comorbidity_type_code)) { \r\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\r\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\r\n }\r\n }\r\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\r\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"]}}},"comorbidity_treatment_status":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n const invalidTypes = [\"no\", \"unknown\"]\r\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\r\n \r\n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\r\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\r\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\r\n }\r\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\r\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\r\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\r\n }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]}}},"comorbidity_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n const invalidTypes = [\"no\", \"unknown\"]\r\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\r\n \r\n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\r\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\r\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\r\n }\r\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\r\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\r\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\r\n }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]}}}},"created":{},"deleted":{}},"surgery":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"created","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"created","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"created","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"created","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"created","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"created","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"created","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"created","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"created","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"created","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"created","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"created","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"created","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"created","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}},"deleted":{}}}} diff --git a/scripts/data/schemas/diffs/1.13/1.13-diff-1.24.json b/scripts/data/schemas/diffs/1.13/1.13-diff-1.24.json new file mode 100644 index 00000000..4108e63b --- /dev/null +++ b/scripts/data/schemas/diffs/1.13/1.13-diff-1.24.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"],"deleted":[]}}}},"submitter_sample_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"primary_site":{"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"data":{"added":["Unknown primary site"],"deleted":[]}}}},"genetic_disorders":{"description":{"left":"Indicate presence of any hereditary genetic disorders. (Reference: Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","right":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)"},"restrictions":{"codeList":{"left":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Serrated Polyposis Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"],"right":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"],"data":{"added":["None","Not applicable","Unknown"],"deleted":[]}}}},"hrt_type":{"restrictions":{"codeList":{"left":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Other","Patch","Pill","Unknown"],"right":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"],"data":{"added":["Not applicable"],"deleted":[]}}}},"hrt_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\") {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If '${$name}' is submitted, then '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"]}}},"contraception_type":{"restrictions":{"codeList":{"left":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Other","Progestin-only pill","Unknown","Vaginal ring"],"right":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"],"data":{"added":["Not applicable","Oral contraceptive pill"],"deleted":[]}}}},"contraception_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\") {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If '${$name}' is submitted, then '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"]}}}},"created":{"lost_to_followup_after_clinical_event_id":{"changeType":"created","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}},"deleted":{}},"specimen":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"pathological_tumour_staging_system":{"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"pathological_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["Not applicable"],"deleted":[]}}}},"specimen_acquisition_interval":{"restrictions":{"range":{"left":{"min":0},"right":null}}},"specimen_laterality":{"description":{"left":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR 2007875)","right":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)"},"restrictions":{"codeList":{"left":["Left","Right","Unknown"],"right":["Left","Not applicable","Right","Unknown"],"data":{"added":["Not applicable"],"deleted":[]}}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"specimen_storage":{"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"reference_pathology_confirmed":{"description":{"left":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist.","right":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)"}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"percent_tumour_cells":{"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"]}}}},"created":{"percent_tumour_cells_measurement_method":{"changeType":"created","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}},"deleted":{}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"laterality":{"description":{"left":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR 827)","right":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)"}},"clinical_tumour_staging_system":{"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"clinical_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["Not applicable"],"deleted":[]}}}},"performance_status":{"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}}},"created":{"lymph_nodes_examined_method":{"changeType":"created","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}},"deleted":{}},"treatment":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":["End of life care"],"deleted":[]}}}},"is_primary_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Yes","No","Unknown"],"right":["Yes","No"],"data":{"added":[],"deleted":["Unknown"]}}}},"line_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'unknown') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'unknown'.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"]}}},"treatment_start_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":{"exclusiveMin":0},"right":null}}},"treatment_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"days_per_cycle":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"number_of_cycles":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_intent":{"description":{"left":"Indicate the intended disease outcome for which the treatment is given. (Reference: NCIt C124307)","right":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)"},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Curative","Palliative","Unknown"],"right":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"],"data":{"added":["Diagnostic","Forensic","Guidance","Preventative","Screening","Supportive"],"deleted":["Unknown"]}}}},"treatment_setting":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Adjuvant","Advanced/Metastatic","Neoadjuvant","Not applicable"],"right":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"],"data":{"added":["Conditioning","Induction","Maintenance","Mobilization","Preventative","Radiosensitization","Salvage"],"deleted":["Not applicable"]}}}},"response_to_treatment":{"description":{"left":"The donor's response to the applied treatment regimen. (Source: RECIST)","right":"The donor's response to the applied treatment regimen."},"meta":{"dependsOn":{"left":"treatment.treatment_type","right":"treatment.response_to_treatment_criteria_method"},"notes":{"left":null,"right":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"]},"codeList":{"left":["Complete response","Disease progression","NED","Partial response","Stable disease"],"right":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"],"data":{"added":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease"],"deleted":["Disease progression","NED"]}}}},"outcome_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"toxicity_type":{"restrictions":{"codeList":{"left":["Hematological","Non-hematological"],"right":["Hematological","Non-hematological","Not applicable","Unknown"],"data":{"added":["Not applicable","Unknown"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n \n /* toxicityType should only be submitted if treatment was terminated early due to acute toxicity ('outcome_of_treatment' is 'Treatment stopped due to acute toxicity'). */\n if (outcomeOfTreatment != \"treatment stopped due to acute toxicity\") {\n result = { valid: false, message: `The 'outcome_of_treatment' field should be 'Treatment stopped due to acute toxicity' if the '${$name}' field is submitted.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"]}}},"hematological_toxicity":{"restrictions":{"codeList":{"left":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5"],"right":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"data":{"added":["Unknown"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n if (($row.toxicity_type != null && !(checkforEmpty($row.toxicity_type)))) { \n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n \n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}},"non-hematological_toxicity":{"restrictions":{"codeList":{"left":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"right":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"data":{"added":["Unknown"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n if (($row.toxicity_type != null && !(checkforEmpty($row.toxicity_type)))) { \n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n \n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}},"adverse_events":{"restrictions":{"codeList":{"left":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"right":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"data":{"added":["None","Unknown"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"clinical_trials_database":{"meta":{"notes":{"left":null,"right":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added."}},"restrictions":{"codeList":{"left":["NCI Clinical Trials","EU Clinical Trials Register"],"right":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"],"data":{"added":["Not applicable","Unknown"],"deleted":[]}}}},"clinical_trial_number":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"]}}}},"created":{"response_to_treatment_criteria_method":{"changeType":"created","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}}},"deleted":{}},"chemotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"created","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{"chemotherapy_dosage_units":{"changeType":"deleted","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate the total actual drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true,"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"created","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{"hormone_drug_dosage_units":{"changeType":"deleted","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true,"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"radiation":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{"radiation_boost":{"changeType":"created","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"created","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}},"deleted":{}},"immunotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"immunotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"displayName":{"left":"Immunotherapy Drug Name","right":"Chemotherapy Drug Name"},"dependsOn":{"left":null,"right":"immunotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"created","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{}},"follow_up":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_follow_up_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"interval_of_followup":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"treatment.submitter_treatment_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"relapse_type":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"relapse_interval":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"method_of_progression_status":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"anatomic_site_progression_or_recurrence":{"description":{"left":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","right":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344."},"meta":{"examples":{"left":"C50.1,C18","right":"C50.1|C18"},"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_t_category":{"meta":{"core":{"left":true,"right":null}}},"recurrence_n_category":{"meta":{"core":{"left":true,"right":null}}},"recurrence_m_category":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["Not applicable"],"deleted":[]}}}},"recurrence_stage_group":{"meta":{"core":{"left":true,"right":null}}},"posttherapy_tumour_staging_system":{"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"posttherapy_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["Not applicable"],"deleted":[]}}}}},"created":{},"deleted":{}},"exposure":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"tobacco_smoking_status":{"restrictions":{"codeList":{"left":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Smoking history not documented"],"right":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"],"data":{"added":["Not applicable"],"deleted":[]}}}},"tobacco_type":{"restrictions":{"codeList":{"left":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"right":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"data":{"added":["Not applicable"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else if ($row.tobacco_smoking_status.toLowerCase() === 'smoking history not documented') {\n result = { valid: false, message: `The 'tobacco_smoking_status' field (smoking status not documented) is inconsistent if donor smoked '${$row.tobacco_type}'.`};\n }\n else if ($row.tobacco_smoking_status.toLowerCase() === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if donor is a lifelong non-smoker.`}\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}}},"pack_years_smoked":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else if ($row.tobacco_smoking_status.toLowerCase() === 'smoking history not documented') {\n result = { valid: false, message: `The 'tobacco_smoking_status' field (smoking status not documented) is inconsistent if donor smoked '${$row.tobacco_type}'.`};\n }\n else if ($row.tobacco_smoking_status.toLowerCase() === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if donor is a lifelong non-smoker.`}\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}}},"alcohol_history":{"restrictions":{"codeList":{"left":["Yes","No","Unknown"],"right":["Yes","No","Not applicable","Unknown"],"data":{"added":["Not applicable"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n noOrUnknownAllowedCategories = [\"none\", \"occasional drinker (< once a month)\", \"unknown\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ((!$field || $field == null || checkforEmpty($field)) && alcoholHistoryCategories.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `If the donor is a '${alcoholConsumptionCategory}', then the 'alcohol_history' field must be submitted as well.`};\n }\n if ((!$field || $field === null || checkforEmpty($field) || $field.trim().toLowerCase() === 'no') && (!(noOrUnknownAllowedCategories.includes(alcoholConsumptionCategory)))) {\n result = {valid:false, message: `If the donor is a '${alcoholConsumptionCategory}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}}},"alcohol_consumption_category":{"restrictions":{"codeList":{"left":["Daily Drinker","None","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"right":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"data":{"added":["Not applicable"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}}},"alcohol_type":{"restrictions":{"codeList":{"left":["Beer","Liquor","Other","Unknown","Wine"],"right":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"data":{"added":["Not applicable"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n exclusionTerms = [\"no\", \"none\", \"unknown\"]; \n requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (exclusionTerms.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field should not be submitted.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n if ($field && $field != null && !(checkforEmpty($field)) && (!$row.alcohol_consumption_category || $row.alcohol_consumption_category === null || checkforEmpty($row.alcohol_consumption_category))) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}},"opiate_use":{"restrictions":{"codeList":{"left":["Never","Unknown","Yes, currently","Yes, only in the past"],"right":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"],"data":{"added":["Not applicable"],"deleted":[]}}}},"hot_drinks_consumption":{"restrictions":{"codeList":{"left":["Never","Unknown","Yes, currently","Yes, only in the past"],"right":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"],"data":{"added":["Not applicable"],"deleted":[]}}}},"red_meat_frequency":{"restrictions":{"codeList":{"left":["Never","Less than once a month","1-3 times a month","Once or twice a week","Most days but not every day","Every day","Unknown"],"right":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"],"data":{"added":["Not applicable"],"deleted":[]}}}},"processed_meat_frequency":{"restrictions":{"codeList":{"left":["Never","Less than once a month","1-3 times a month","Once or twice a week","Most days but not every day","Every day","Unknown"],"right":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"],"data":{"added":["Not applicable"],"deleted":[]}}}},"soft_drinks_frequency":{"restrictions":{"codeList":{"left":["Never","Less than once a month","1-3 times a month","Once or twice a week","Most days but not every day","Every day","Unknown"],"right":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"],"data":{"added":["Not applicable"],"deleted":[]}}}},"exercise_frequency":{"restrictions":{"codeList":{"left":["Never","Less than once a month","1-3 times a month","Once or twice a week","Most days but not every day","Every day","Unknown"],"right":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"],"data":{"added":["Not applicable"],"deleted":[]}}}},"exercise_intensity":{"restrictions":{"codeList":{"left":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Vigorous: Increase in the heart beat substantially with heavy perspiration"],"right":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"data":{"added":["Not applicable","Unknown"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null || !(checkforEmpty($field))) {\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency)) && $row.exercise_frequency.trim().toLowerCase() === \"never\") {\n result = {valid: false, message: `The 'exercise_frequency' field cannot be 'never' if the '${$name}' field is submitted.`};\n }\n } \n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}}},"created":{},"deleted":{}},"family_history":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"family_relative_id":{"meta":{"primaryId":{"left":null,"right":true}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"biomarker":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"treatment.submitter_treatment_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_follow_up_id":{"meta":{"foreignKey":{"left":null,"right":"follow_up.submitter_follow_up_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"test_interval":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}}},"created":{},"deleted":{}},"comorbidity":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"surgery":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"created","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"created","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"created","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"created","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"created","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"created","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"created","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"created","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"created","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"created","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"created","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"created","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"created","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"created","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}},"deleted":{}}}} diff --git a/scripts/data/schemas/diffs/1.14/1.14-diff-1.24.json b/scripts/data/schemas/diffs/1.14/1.14-diff-1.24.json new file mode 100644 index 00000000..e967455b --- /dev/null +++ b/scripts/data/schemas/diffs/1.14/1.14-diff-1.24.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"],"deleted":[]}}}},"submitter_sample_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"primary_site":{"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"data":{"added":["Unknown primary site"],"deleted":[]}}}}},"created":{"lost_to_followup_after_clinical_event_id":{"changeType":"created","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}},"deleted":{}},"specimen":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"pathological_tumour_staging_system":{"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"pathological_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["Not applicable"],"deleted":[]}}}},"specimen_acquisition_interval":{"restrictions":{"range":{"left":{"min":0},"right":null}}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"percent_tumour_cells":{"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"]}}}},"created":{"percent_tumour_cells_measurement_method":{"changeType":"created","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}},"deleted":{}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"clinical_tumour_staging_system":{"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"clinical_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["Not applicable"],"deleted":[]}}}}},"created":{"lymph_nodes_examined_method":{"changeType":"created","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}},"deleted":{}},"treatment":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":["End of life care"],"deleted":[]}}}},"is_primary_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Yes","No","Unknown"],"right":["Yes","No"],"data":{"added":[],"deleted":["Unknown"]}}}},"line_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'unknown') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'unknown'.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"]}}},"treatment_start_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":{"exclusiveMin":0},"right":null}}},"treatment_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"days_per_cycle":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"number_of_cycles":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_intent":{"description":{"left":"Indicate the intended disease outcome for which the treatment is given. (Reference: NCIt C124307)","right":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)"},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Curative","Palliative","Unknown"],"right":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"],"data":{"added":["Diagnostic","Forensic","Guidance","Preventative","Screening","Supportive"],"deleted":["Unknown"]}}}},"treatment_setting":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Adjuvant","Advanced/Metastatic","Neoadjuvant","Not applicable"],"right":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"],"data":{"added":["Conditioning","Induction","Maintenance","Mobilization","Preventative","Radiosensitization","Salvage"],"deleted":["Not applicable"]}}}},"response_to_treatment":{"description":{"left":"The donor's response to the applied treatment regimen. (Source: RECIST)","right":"The donor's response to the applied treatment regimen."},"meta":{"dependsOn":{"left":"treatment.treatment_type","right":"treatment.response_to_treatment_criteria_method"},"notes":{"left":null,"right":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"]},"codeList":{"left":["Complete response","Disease progression","NED","Partial response","Stable disease"],"right":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"],"data":{"added":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease"],"deleted":["Disease progression","NED"]}}}},"outcome_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"adverse_events":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}}},"created":{"response_to_treatment_criteria_method":{"changeType":"created","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}}},"deleted":{}},"chemotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"created","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{"chemotherapy_dosage_units":{"changeType":"deleted","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate the total actual drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true,"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"created","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{"hormone_drug_dosage_units":{"changeType":"deleted","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true,"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"radiation":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{"radiation_boost":{"changeType":"created","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"created","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}},"deleted":{}},"immunotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"immunotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"displayName":{"left":"Immunotherapy Drug Name","right":"Chemotherapy Drug Name"},"dependsOn":{"left":null,"right":"immunotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"created","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{}},"surgery":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"surgery_type":{"restrictions":{"codeList":{"left":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"],"right":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"],"data":{"added":["Hemithyroidectomy","Near-total thyroidectomy","Subtotal thyroidectomy","Total thyroidectomy"],"deleted":[]}}}}},"created":{},"deleted":{}},"follow_up":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_follow_up_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"interval_of_followup":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"treatment.submitter_treatment_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"relapse_type":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"relapse_interval":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"method_of_progression_status":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"anatomic_site_progression_or_recurrence":{"description":{"left":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","right":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344."},"meta":{"examples":{"left":"C50.1,C18","right":"C50.1|C18"},"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_t_category":{"meta":{"core":{"left":true,"right":null}}},"recurrence_n_category":{"meta":{"core":{"left":true,"right":null}}},"recurrence_m_category":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["Not applicable"],"deleted":[]}}}},"recurrence_stage_group":{"meta":{"core":{"left":true,"right":null}}},"posttherapy_tumour_staging_system":{"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"posttherapy_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["Not applicable"],"deleted":[]}}}}},"created":{},"deleted":{}},"exposure":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"family_history":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"family_relative_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"biomarker":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"treatment.submitter_treatment_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_follow_up_id":{"meta":{"foreignKey":{"left":null,"right":"follow_up.submitter_follow_up_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"test_interval":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}}},"created":{},"deleted":{}},"comorbidity":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}}}} diff --git a/scripts/data/schemas/diffs/1.15/1.15-diff-1.24.json b/scripts/data/schemas/diffs/1.15/1.15-diff-1.24.json new file mode 100644 index 00000000..df8ffbee --- /dev/null +++ b/scripts/data/schemas/diffs/1.15/1.15-diff-1.24.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"],"deleted":[]}}}},"submitter_sample_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"primary_site":{"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"data":{"added":["Unknown primary site"],"deleted":[]}}}}},"created":{"lost_to_followup_after_clinical_event_id":{"changeType":"created","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}},"deleted":{}},"specimen":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"pathological_tumour_staging_system":{"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"pathological_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["Not applicable"],"deleted":[]}}}},"specimen_acquisition_interval":{"restrictions":{"range":{"left":{"min":0},"right":null}}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"percent_tumour_cells":{"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"]}}}},"created":{"percent_tumour_cells_measurement_method":{"changeType":"created","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}},"deleted":{}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"clinical_tumour_staging_system":{"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"clinical_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["Not applicable"],"deleted":[]}}}}},"created":{"lymph_nodes_examined_method":{"changeType":"created","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}},"deleted":{}},"treatment":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":["End of life care"],"deleted":[]}}}},"is_primary_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Yes","No","Unknown"],"right":["Yes","No"],"data":{"added":[],"deleted":["Unknown"]}}}},"line_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'unknown') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'unknown'.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"]}}},"treatment_start_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":{"exclusiveMin":0},"right":null}}},"treatment_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"days_per_cycle":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"number_of_cycles":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_intent":{"description":{"left":"Indicate the intended disease outcome for which the treatment is given. (Reference: NCIt C124307)","right":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)"},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Curative","Palliative","Unknown"],"right":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"],"data":{"added":["Diagnostic","Forensic","Guidance","Preventative","Screening","Supportive"],"deleted":["Unknown"]}}}},"treatment_setting":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Adjuvant","Advanced/Metastatic","Neoadjuvant","Not applicable"],"right":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"],"data":{"added":["Conditioning","Induction","Maintenance","Mobilization","Preventative","Radiosensitization","Salvage"],"deleted":["Not applicable"]}}}},"response_to_treatment":{"description":{"left":"The donor's response to the applied treatment regimen. (Source: RECIST)","right":"The donor's response to the applied treatment regimen."},"meta":{"dependsOn":{"left":"treatment.treatment_type","right":"treatment.response_to_treatment_criteria_method"},"notes":{"left":null,"right":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"]},"codeList":{"left":["Complete response","Disease progression","NED","Partial response","Stable disease"],"right":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"],"data":{"added":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease"],"deleted":["Disease progression","NED"]}}}},"outcome_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"adverse_events":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}}},"created":{"response_to_treatment_criteria_method":{"changeType":"created","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}}},"deleted":{}},"chemotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"created","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{"chemotherapy_dosage_units":{"changeType":"deleted","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate the total actual drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true,"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"created","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{"hormone_drug_dosage_units":{"changeType":"deleted","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true,"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"radiation":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{"radiation_boost":{"changeType":"created","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"created","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}},"deleted":{}},"immunotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"immunotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"displayName":{"left":"Immunotherapy Drug Name","right":"Chemotherapy Drug Name"},"dependsOn":{"left":null,"right":"immunotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"created","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{}},"surgery":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"follow_up":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_follow_up_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"interval_of_followup":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"treatment.submitter_treatment_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"relapse_type":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"relapse_interval":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"method_of_progression_status":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"anatomic_site_progression_or_recurrence":{"description":{"left":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","right":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344."},"meta":{"examples":{"left":"C50.1,C18","right":"C50.1|C18"},"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_t_category":{"meta":{"core":{"left":true,"right":null}}},"recurrence_n_category":{"meta":{"core":{"left":true,"right":null}}},"recurrence_m_category":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["Not applicable"],"deleted":[]}}}},"recurrence_stage_group":{"meta":{"core":{"left":true,"right":null}}},"posttherapy_tumour_staging_system":{"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"posttherapy_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["Not applicable"],"deleted":[]}}}}},"created":{},"deleted":{}},"exposure":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"family_history":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"family_relative_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"biomarker":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"treatment.submitter_treatment_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_follow_up_id":{"meta":{"foreignKey":{"left":null,"right":"follow_up.submitter_follow_up_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"test_interval":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}}},"created":{},"deleted":{}},"comorbidity":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}}}} diff --git a/scripts/data/schemas/diffs/1.16/1.16-diff-1.24.json b/scripts/data/schemas/diffs/1.16/1.16-diff-1.24.json new file mode 100644 index 00000000..d5870c1b --- /dev/null +++ b/scripts/data/schemas/diffs/1.16/1.16-diff-1.24.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"],"deleted":[]}}}},"submitter_sample_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{"lost_to_followup_after_clinical_event_id":{"changeType":"created","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}},"deleted":{}},"specimen":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"specimen_acquisition_interval":{"restrictions":{"range":{"left":{"min":0},"right":null}}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"percent_tumour_cells":{"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"]}}}},"created":{"percent_tumour_cells_measurement_method":{"changeType":"created","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}},"deleted":{}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"lymph_nodes_examined_method":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable'];\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"]}}}},"created":{},"deleted":{}},"treatment":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":["End of life care"],"deleted":[]}}}},"is_primary_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_start_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":{"exclusiveMin":0},"right":null}}},"treatment_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"days_per_cycle":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"number_of_cycles":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_intent":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_setting":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"response_to_treatment_criteria_method":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"response_to_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"]},"codeList":{"left":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed stable disease","Progressive disease","Stable disease"],"right":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"],"data":{"added":["Physician assessed progressive disease"],"deleted":[]}}}},"outcome_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"adverse_events":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}}},"created":{},"deleted":{}},"chemotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"chemotherapy_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"data":{"added":["mg"],"deleted":[]}}}},"prescribed_cumulative_drug_dose":{"meta":{"validationDependency":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"]}}},"actual_cumulative_drug_dose":{"meta":{"validationDependency":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"deleted":{}},"hormone_therapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"hormone_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"data":{"added":["mg"],"deleted":[]}}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"deleted":{}},"radiation":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{"radiation_boost":{"changeType":"created","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"created","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}},"deleted":{}},"immunotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"immunotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"displayName":{"left":"Immunotherapy Drug Name","right":"Chemotherapy Drug Name"},"dependsOn":{"left":null,"right":"immunotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"immunotherapy_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"data":{"added":["mg"],"deleted":[]}}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"deleted":{}},"surgery":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"follow_up":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_follow_up_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"interval_of_followup":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"relapse_interval":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"anatomic_site_progression_or_recurrence":{"description":{"left":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","right":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344."},"meta":{"examples":{"left":"C50.1,C18","right":"C50.1|C18"},"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"created":{},"deleted":{}},"exposure":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"family_history":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"family_relative_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"biomarker":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_follow_up_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"test_interval":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}}},"created":{},"deleted":{}},"comorbidity":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}}}} diff --git a/scripts/data/schemas/diffs/1.17/1.17-diff-1.24.json b/scripts/data/schemas/diffs/1.17/1.17-diff-1.24.json new file mode 100644 index 00000000..8ce7ba5e --- /dev/null +++ b/scripts/data/schemas/diffs/1.17/1.17-diff-1.24.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":["Cell line - derived from metastatic tumour","Xenograft - derived from metastatic tumour"],"deleted":[]}}}},"submitter_sample_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{"lost_to_followup_after_clinical_event_id":{"changeType":"created","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}},"deleted":{}},"specimen":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"specimen_acquisition_interval":{"restrictions":{"range":{"left":{"min":0},"right":null}}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"percent_tumour_cells":{"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"]}}}},"created":{},"deleted":{}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"lymph_nodes_examined_method":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"]}}}},"created":{},"deleted":{}},"treatment":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":["End of life care"],"deleted":[]}}}},"is_primary_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_start_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":{"exclusiveMin":0},"right":null}}},"treatment_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"days_per_cycle":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"number_of_cycles":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_intent":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_setting":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"response_to_treatment_criteria_method":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"response_to_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"]},"codeList":{"left":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed stable disease","Progressive disease","Stable disease"],"right":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"],"data":{"added":["Physician assessed progressive disease"],"deleted":[]}}}},"outcome_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"adverse_events":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}}},"created":{},"deleted":{}},"chemotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"chemotherapy_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"data":{"added":["mg"],"deleted":[]}}}},"prescribed_cumulative_drug_dose":{"meta":{"validationDependency":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"]}}},"actual_cumulative_drug_dose":{"meta":{"validationDependency":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"deleted":{}},"hormone_therapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"hormone_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"data":{"added":["mg"],"deleted":[]}}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"deleted":{}},"radiation":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{"radiation_boost":{"changeType":"created","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"created","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}},"deleted":{}},"immunotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"immunotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"displayName":{"left":"Immunotherapy Drug Name","right":"Chemotherapy Drug Name"},"dependsOn":{"left":null,"right":"immunotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"immunotherapy_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"data":{"added":["mg"],"deleted":[]}}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"deleted":{}},"surgery":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"follow_up":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_follow_up_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"interval_of_followup":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"relapse_interval":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}}},"created":{},"deleted":{}},"exposure":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"family_history":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"family_relative_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"biomarker":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_follow_up_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"test_interval":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}}},"created":{},"deleted":{}},"comorbidity":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}}}} diff --git a/scripts/data/schemas/diffs/1.18/1.18-diff-1.24.json b/scripts/data/schemas/diffs/1.18/1.18-diff-1.24.json new file mode 100644 index 00000000..88e2936e --- /dev/null +++ b/scripts/data/schemas/diffs/1.18/1.18-diff-1.24.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":["Cell line - derived from metastatic tumour","Xenograft - derived from metastatic tumour"],"deleted":[]}}}},"submitter_sample_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{"lost_to_followup_after_clinical_event_id":{"changeType":"created","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}},"deleted":{}},"specimen":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"specimen_acquisition_interval":{"restrictions":{"range":{"left":{"min":0},"right":null}}},"percent_tumour_cells":{"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"]}}}},"created":{},"deleted":{}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"treatment":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":["End of life care"],"deleted":[]}}}},"is_primary_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_start_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":{"exclusiveMin":0},"right":null}}},"treatment_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"days_per_cycle":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"number_of_cycles":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_intent":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_setting":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"response_to_treatment_criteria_method":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"response_to_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"]},"codeList":{"left":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed stable disease","Progressive disease","Stable disease"],"right":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"],"data":{"added":["Physician assessed progressive disease"],"deleted":[]}}}},"outcome_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"adverse_events":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}}},"created":{},"deleted":{}},"chemotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"chemotherapy_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"data":{"added":["mg"],"deleted":[]}}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"deleted":{}},"hormone_therapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"hormone_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"data":{"added":["mg"],"deleted":[]}}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"deleted":{}},"radiation":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{"radiation_boost":{"changeType":"created","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"created","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}},"deleted":{}},"immunotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"immunotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"displayName":{"left":"Immunotherapy Drug Name","right":"Chemotherapy Drug Name"},"dependsOn":{"left":null,"right":"immunotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"immunotherapy_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"data":{"added":["mg"],"deleted":[]}}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"deleted":{}},"surgery":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"follow_up":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_follow_up_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"interval_of_followup":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"relapse_interval":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}}},"created":{},"deleted":{}},"exposure":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"family_history":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"family_relative_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"biomarker":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_follow_up_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"test_interval":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}}},"created":{},"deleted":{}},"comorbidity":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}}}} diff --git a/scripts/data/schemas/diffs/1.19/1.19-diff-1.24.json b/scripts/data/schemas/diffs/1.19/1.19-diff-1.24.json new file mode 100644 index 00000000..5d29b1d9 --- /dev/null +++ b/scripts/data/schemas/diffs/1.19/1.19-diff-1.24.json @@ -0,0 +1 @@ +{"schemas":{"specimen":{"updated":{"specimen_acquisition_interval":{"restrictions":{"range":{"left":{"min":0},"right":null}}},"percent_tumour_cells":{"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"]}}}},"created":{},"deleted":{}},"treatment":{"updated":{"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":["End of life care"],"deleted":[]}}}},"is_primary_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_start_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":{"exclusiveMin":0},"right":null}}},"treatment_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"days_per_cycle":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"number_of_cycles":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_intent":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_setting":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"response_to_treatment_criteria_method":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"response_to_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"]}}},"outcome_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"adverse_events":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}}},"created":{},"deleted":{}},"chemotherapy":{"updated":{"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"chemotherapy_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"data":{"added":["mg"],"deleted":[]}}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"deleted":{}},"hormone_therapy":{"updated":{"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"hormone_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"data":{"added":["mg"],"deleted":[]}}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"deleted":{}},"immunotherapy":{"updated":{"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"immunotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"displayName":{"left":"Immunotherapy Drug Name","right":"Chemotherapy Drug Name"},"dependsOn":{"left":null,"right":"immunotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"immunotherapy_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"data":{"added":["mg"],"deleted":[]}}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"deleted":{}},"follow_up":{"updated":{"interval_of_followup":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"relapse_interval":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}}},"created":{},"deleted":{}},"biomarker":{"updated":{"test_interval":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}}},"created":{},"deleted":{}},"radiation":{"updated":{},"created":{"radiation_boost":{"changeType":"created","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"created","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}},"deleted":{}}}} diff --git a/scripts/data/schemas/diffs/1.2/1.2-diff-1.24.json b/scripts/data/schemas/diffs/1.2/1.2-diff-1.24.json new file mode 100644 index 00000000..04d704d8 --- /dev/null +++ b/scripts/data/schemas/diffs/1.2/1.2-diff-1.24.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n const row = $row;\n let result = {valid: true, message: \"Ok\"};\n \n const designation = row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\"){\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when tumour_normal_designation is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when tumour_normal_designation is set to Tumour.\"};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"]}}},"submitter_sample_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased","Unknown"],"right":["Alive","Deceased"],"data":{"added":[],"deleted":["Unknown"]}}}},"cause_of_death":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]}}},"survival_time":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"primary_site":{"meta":{"notes":{"left":null,"right":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"examples":{"left":null,"right":"Breast|Ovary"}},"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Not Reported","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva","Unknown"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"data":{"added":["Unknown primary site"],"deleted":["Not Reported","Unknown"]}}}},"height":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"weight":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"bmi":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"menopause_status":{"description":{"left":"Indicate the donor's menopause status at the time of primary diagnosis. (Codelist reference: NCI CDE ID: 2434914)","right":"Indicate the donor's menopause status at the time of primary diagnosis. (Reference: caDSR CDE ID 2434914)"},"restrictions":{"codeList":{"left":["Indeterminate or unknown","Not applicable","Perimenopausal","Postmenopausal","Premenopausal"],"right":["Not applicable","Perimenopausal","Postmenopausal","Premenopausal","Unknown"],"data":{"added":["Unknown"],"deleted":["Indeterminate or unknown"]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age of menarche, the first occurrence of menstruation.","right":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)"},"restrictions":{}},"number_of_pregnancies":{"description":{"left":"Indicate the number of pregnancies a donor has had.","right":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)"},"restrictions":{}},"number_of_children":{"description":{"left":"Indicate the number of children the donor has birthed.","right":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)"},"restrictions":{}}},"created":{"genetic_disorders":{"changeType":"created","description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},"hrt_type":{"changeType":"created","description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},"hrt_duration":{"changeType":"created","description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},"contraception_type":{"changeType":"created","description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},"contraception_duration":{"changeType":"created","description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},"lost_to_followup_after_clinical_event_id":{"changeType":"created","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}},"deleted":{"prior_malignancy":{"changeType":"deleted","description":"Prior malignancy affecting donor.","name":"prior_malignancy","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy","examples":"C41.1, C16.9, C00.5, D46.9"}},"cancer_type_prior_malignancy":{"changeType":"deleted","description":"The code to represent the cancer type of a prior malignancy using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","name":"cancer_type_prior_malignancy","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"valueType":"string","meta":{"displayName":"Cancer Type Prior Malignancy"}},"age_at_prior_malignancy":{"changeType":"deleted","description":"If donor has history of prior malignancy, indicate age at previous diagnosis, in years.","name":"age_at_prior_malignancy","valueType":"integer","meta":{"displayName":"Age at Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"deleted","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Codelist reference: NCI CDE: 4122391)","name":"laterality_of_prior_malignancy","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality at Prior Malignancy"}}}},"specimen":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null},"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"pathological_tumour_staging_system":{"meta":{"validationDependency":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"pathological_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"pathological_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"pathological_stage_group":{"restrictions":{"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.pathological_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.pathological_tumour_staging_system && $row.pathological_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'pathological_tumour_staging_system' is set to '${\n $row.pathological_tumour_staging_system\n }', 'pathological_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"specimen_storage":{"description":{"left":"Indicate the method of specimen storage for specimens that were not extracted freshly or immediately cultured.","right":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured."},"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"reference_pathology_confirmed":{"description":{"left":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist.","right":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)"}},"tumour_grading_system":{"meta":{"validationDependency":{"left":null,"right":true}}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = \"'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.\";\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"percent_tumour_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of infiltration by tumour cells in a specimen.","right":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)"},"restrictions":{}},"percent_proliferating_cells":{"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_inflammatory_tissue":{"description":{"left":"Indicate a value, in decimals, that represents local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue.","right":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_stromal_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a malignant tumour specimen but are not malignant such as fibroblasts, vascular structures, etc.","right":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_necrosis":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of cell death in a malignant tumour specimen.","right":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}}},"created":{"specimen_laterality":{"changeType":"created","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"percent_tumour_cells_measurement_method":{"changeType":"created","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}},"deleted":{}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"age_at_diagnosis":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0,"max":90}}}},"number_lymph_nodes_positive":{"description":{"left":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: NCI CDE ID: 6113694)","right":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: caDSR CDE ID 6113694)"},"meta":{"dependsOn":{"left":null,"right":"primary_diagnosis.lymph_nodes_examined_status"},"notes":{"left":null,"right":"This field is only required if 'lymph_nodes_examined_status' is 'Yes'."}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"]},"range":{"left":null,"right":{"min":0}}}},"number_lymph_nodes_examined":{"description":{"left":"The total number of lymph nodes tested for the presence of cancer. (Reference: NCI CDE ID: 3)","right":"The total number of lymph nodes tested for the presence of cancer. (Reference: caDSR CDE ID 3)"},"meta":{"dependsOn":{"left":null,"right":"primary_diagnosis.lymph_nodes_examined_status"},"notes":{"left":null,"right":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'."}},"restrictions":{}},"clinical_tumour_staging_system":{"meta":{"validationDependency":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"required":{"left":true,"right":null},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"clinical_stage_group":{"description":{"left":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.).","right":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage."},"meta":{"examples":{"left":null,"right":"Stage I, Stage IIB"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.clinical_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'clinical_tumour_staging_system' is set to '${\n $row.clinical_tumour_staging_system\n }', 'clinical_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"clinical_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"clinical_n_category":{"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"clinical_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"presenting_symptoms":{"restrictions":{"codeList":{"left":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Loss of Appetite","Nausea","None","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Unknown","Vomiting","Weight Loss"],"right":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Loss of Appetite","Nausea","None","Not Reported","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Swelling in the Neck","Unknown","Vomiting","Weight Loss"],"data":{"added":["Not Reported","Swelling in the Neck"],"deleted":[]}}}},"performance_status":{"description":{"left":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference source: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status).","right":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status)."},"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}}},"created":{"laterality":{"changeType":"created","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_status":{"changeType":"created","name":"lymph_nodes_examined_status","description":"Indicate if lymph nodes were examined for metastases.","valueType":"string","restrictions":{"required":true,"codeList":["Cannot be determined","No","No lymph nodes found in resected specimen","Not applicable","Yes"]},"meta":{"core":true,"displayName":"Lymph Nodes Examined Status"}},"lymph_nodes_examined_method":{"changeType":"created","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}},"deleted":{}},"treatment":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null},"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":["End of life care"],"deleted":[]}}}},"is_primary_treatment":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Yes","No","Unknown"],"right":["Yes","No"],"data":{"added":[],"deleted":["Unknown"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"line_of_treatment":{"meta":{"dependsOn":{"left":null,"right":"treatment.is_primary_treatment"}},"restrictions":{}},"treatment_start_interval":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_duration":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"days_per_cycle":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{}},"number_of_cycles":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{}},"treatment_intent":{"description":{"left":"Indicate the intended disease outcome for which the treatment is given. (Reference: CDISC [NCIt code: C124307])","right":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)"},"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Curative","Palliative","Unknown"],"right":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"],"data":{"added":["Diagnostic","Forensic","Guidance","Preventative","Screening","Supportive"],"deleted":["Unknown"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_setting":{"description":{"left":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: CDISC [NCIt code: C124308])","right":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: NCIt C124308)"},"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Adjuvant","Advanced/Metastatic","Neoadjuvant","Not applicable"],"right":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"],"data":{"added":["Conditioning","Induction","Maintenance","Mobilization","Preventative","Radiosensitization","Salvage"],"deleted":["Not applicable"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"response_to_treatment":{"description":{"left":"The donor's response to the applied treatment regimen. (Source: RECIST)","right":"The donor's response to the applied treatment regimen."},"meta":{"dependsOn":{"left":null,"right":"treatment.response_to_treatment_criteria_method"},"notes":{"left":null,"right":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Complete response","Disease progression","NED","Partial response","Stable disease"],"right":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"],"data":{"added":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease"],"deleted":["Disease progression","NED"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"]}}},"outcome_of_treatment":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"toxicity_type":{"description":{"left":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hemotological toxicity or non-hemotological toxicity.","right":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity."},"meta":{"dependsOn":{"left":null,"right":"treatment.outcome_of_treatment"}},"restrictions":{"codeList":{"left":["Hemotological","Non-hemotological"],"right":["Hematological","Non-hematological","Not applicable","Unknown"],"data":{"added":["Hematological","Non-hematological","Not applicable","Unknown"],"deleted":["Hemotological","Non-hemotological"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"]}}},"adverse_events":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"codeList":{"left":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"right":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"data":{"added":["None","Unknown"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"clinical_trials_database":{"meta":{"notes":{"left":null,"right":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added."}},"restrictions":{"codeList":{"left":["NCI Clinical Trials","EU Clinical Trials Register"],"right":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"],"data":{"added":["Not applicable","Unknown"],"deleted":[]}}}},"clinical_trial_number":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: 'The submitted NCI clinical trial number is in incorrect format.'};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: \"The submitted EudraCT clinical trial number is in incorrect format.\"};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: \"The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database.\"};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: \"'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.\"};\n } \n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"]}}}},"created":{"response_to_treatment_criteria_method":{"changeType":"created","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},"hematological_toxicity":{"changeType":"created","name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"non-hematological_toxicity":{"changeType":"created","name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"age_at_consent_for_treatment":{"changeType":"deleted","name":"age_at_consent_for_treatment","description":"Indicate the age of donor when consent was given for treatment.","valueType":"integer","meta":{"displayName":"Age At Consent For Treatment"}},"hemotological_toxicity":{"changeType":"deleted","name":"hemotological_toxicity","description":"Indicate the hemotological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5"]},"meta":{"displayName":"Hemotological Toxicity","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"chemotherapy":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"description":{"left":"Name of agent or drug administered to patient as part of the treatment regimen.","right":"Name of agent or drug administered to donor as part of the treatment regimen."},"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"created","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"created","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"created","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"created","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}},"deleted":{"chemotherapy_dosage_units":{"changeType":"deleted","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate the total drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"description":{"left":"Name of agent or drug administered to patient as part of the treatment regimen.","right":"Name of agent or drug administered to donor as part of the treatment regimen."},"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"created","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{"hormone_drug_dosage_units":{"changeType":"deleted","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"radiation":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"radiation_therapy_fractions":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"radiation_therapy_dosage":{"valueType":{"left":"integer","right":"number"},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"anatomical_site_irradiated":{"description":{"left":"Indicate localization site where radiation therapy was administered.","right":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)"},"restrictions":{"codeList":{"left":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"right":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"data":{"added":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"],"deleted":["Bone","Extremities","Head-Neck","Peritoneum"]}}}}},"created":{"radiation_boost":{"changeType":"created","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"created","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}},"deleted":{}},"follow_up":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_follow_up_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null},"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null},"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"treatment.submitter_treatment_id"}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"weight_at_followup":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"relapse_type":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"relapse_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `'${$name}' cannot be greater than the 'interval_of_followup'.` }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"]}}},"method_of_progression_status":{"description":{"left":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Codelist reference: NCI CDE ID: 6161031)","right":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Reference: caDSR CDE ID 6161031)"},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_t_category":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"recurrence_n_category":{"meta":{"core":{"left":true,"right":null}}},"recurrence_m_category":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"recurrence_stage_group":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.recurrence_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.recurrence_tumour_staging_system && $row.recurrence_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'recurrence_tumour_staging_system' is set to '${\n $row.recurrence_tumour_staging_system\n }', 'recurrence_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"posttherapy_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"posttherapy_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"posttherapy_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"posttherapy_stage_group":{"restrictions":{"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.posttherapy_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.posttherapy_tumour_staging_system && $row.posttherapy_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'posttherapy_tumour_staging_system' is set to '${\n $row.posttherapy_tumour_staging_system\n }', 'posttherapy_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}}},"created":{"anatomic_site_progression_or_recurrence":{"changeType":"created","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"anatomic_site_progression_or_recurrences":{"changeType":"deleted","description":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1,C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}}}},"immunotherapy":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"immunotherapy_type":{"changeType":"created","name":"immunotherapy_type","valueType":"string","description":"Indicate the type of immunotherapy administered to donor.","meta":{"displayName":"Immunotherapy Type","core":true},"restrictions":{"required":true,"codeList":["Cell-based","Immune checkpoint inhibitors","Monoclonal antibodies other than immune checkpoint inhibitors","Other immunomodulatory substances"]}},"drug_rxnormcui":{"changeType":"created","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"created","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"created","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{}},"surgery":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"created","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"created","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"created","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"created","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"created","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"created","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"created","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"created","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"created","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"created","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"created","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"created","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"created","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"created","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}},"deleted":{}},"exposure":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"created","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"created","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"created","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"created","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"created","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"created","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"created","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"created","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"created","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"created","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"created","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"created","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"created","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}},"deleted":{}},"family_history":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"family_relative_id":{"changeType":"created","description":"Unique identifier of the relative, assigned by the data provider.","name":"family_relative_id","valueType":"string","meta":{"displayName":"Family Relative ID","primaryId":true,"notes":"This field is required to ensure that family members are identified in unique records. Ids can be as simple as an incremented numeral to ensure uniqueness."},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"relative_with_cancer_history":{"changeType":"created","description":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","name":"relative_with_cancer_history","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Relative with Cancer History"}},"relationship_type":{"changeType":"created","description":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","name":"relationship_type","restrictions":{"codeList":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"]},"valueType":"string","meta":{"displayName":"Relationship Type"}},"gender_of_relative":{"changeType":"created","description":"The self-reported gender of related individual.","name":"gender_of_relative","restrictions":{"codeList":["Female","Male","Other","Unknown"]},"valueType":"string","meta":{"displayName":"Gender of Relative"}},"age_of_relative_at_diagnosis":{"changeType":"created","description":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","name":"age_of_relative_at_diagnosis","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","displayName":"Age Of Relative At Diagnosis"}},"cancer_type_code_of_relative":{"changeType":"created","name":"cancer_type_code_of_relative","valueType":"string","description":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"examples":"C41.1,C16.9,C00.5,D46.9","dependsOn":"family_history.relative_with_cancer_history","displayName":"Cancer Type Code (ICD-10) of Relative"}},"relative_vital_status":{"changeType":"created","description":"Relative's last known state of living or deceased.","name":"relative_vital_status","restrictions":{"codeList":["Alive","Deceased","Unknown"]},"valueType":"string","meta":{"displayName":"Vital Status of Relative"}},"cause_of_death_of_relative":{"changeType":"created","description":"Indicate the cause of the death of the relative.","name":"cause_of_death_of_relative","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]},"valueType":"string","meta":{"dependsOn":"family_history.relative_vital_status","displayName":"Cause of Death of Relative"}},"relative_survival_time":{"changeType":"created","description":"Indicate how long, in days, the relative survived from the time they were diagnosed with cancer.","name":"relative_survival_time","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","units":"days","displayName":"Survival Time Of Relative"}}},"deleted":{}},"biomarker":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"created","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"created","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"created","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"created","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"created","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"created","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"created","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"created","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"created","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"created","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"created","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"created","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"created","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"created","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"created","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"created","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"created","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"created","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"created","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}},"deleted":{}},"comorbidity":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"created","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"created","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"created","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"created","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"created","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"created","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}},"deleted":{}}}} diff --git a/scripts/data/schemas/diffs/1.20/1.20-diff-1.24.json b/scripts/data/schemas/diffs/1.20/1.20-diff-1.24.json new file mode 100644 index 00000000..8c3530cf --- /dev/null +++ b/scripts/data/schemas/diffs/1.20/1.20-diff-1.24.json @@ -0,0 +1 @@ +{"schemas":{"specimen":{"updated":{"specimen_acquisition_interval":{"restrictions":{"range":{"left":{"min":0},"right":null}}},"percent_tumour_cells":{"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"]}}}},"created":{},"deleted":{}},"treatment":{"updated":{"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":["End of life care"],"deleted":[]}}}},"treatment_start_interval":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}}},"created":{},"deleted":{}},"chemotherapy":{"updated":{"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"chemotherapy_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"data":{"added":["mg"],"deleted":[]}}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"deleted":{}},"hormone_therapy":{"updated":{"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"hormone_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"data":{"added":["mg"],"deleted":[]}}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"deleted":{}},"immunotherapy":{"updated":{"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"immunotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"displayName":{"left":"Immunotherapy Drug Name","right":"Chemotherapy Drug Name"},"dependsOn":{"left":null,"right":"immunotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"immunotherapy_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"data":{"added":["mg"],"deleted":[]}}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"deleted":{}},"follow_up":{"updated":{"interval_of_followup":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"relapse_interval":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}}},"created":{},"deleted":{}},"biomarker":{"updated":{"test_interval":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}}},"created":{},"deleted":{}},"radiation":{"updated":{},"created":{"radiation_boost":{"changeType":"created","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"created","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}},"deleted":{}}}} diff --git a/scripts/data/schemas/diffs/1.21/1.21-diff-1.24.json b/scripts/data/schemas/diffs/1.21/1.21-diff-1.24.json new file mode 100644 index 00000000..cfff678d --- /dev/null +++ b/scripts/data/schemas/diffs/1.21/1.21-diff-1.24.json @@ -0,0 +1 @@ +{"schemas":{"specimen":{"updated":{"specimen_acquisition_interval":{"restrictions":{"range":{"left":{"min":0},"right":null}}}},"created":{},"deleted":{}},"treatment":{"updated":{"treatment_start_interval":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}}},"created":{},"deleted":{}},"chemotherapy":{"updated":{"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"chemotherapy_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"data":{"added":["mg"],"deleted":[]}}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"deleted":{}},"hormone_therapy":{"updated":{"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"hormone_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"data":{"added":["mg"],"deleted":[]}}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"deleted":{}},"immunotherapy":{"updated":{"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"immunotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"displayName":{"left":"Immunotherapy Drug Name","right":"Chemotherapy Drug Name"},"dependsOn":{"left":null,"right":"immunotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"immunotherapy_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"data":{"added":["mg"],"deleted":[]}}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"deleted":{}},"follow_up":{"updated":{"interval_of_followup":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"relapse_interval":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}}},"created":{},"deleted":{}},"biomarker":{"updated":{"test_interval":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}}},"created":{},"deleted":{}},"radiation":{"updated":{},"created":{"radiation_boost":{"changeType":"created","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"created","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}},"deleted":{}}}} diff --git a/scripts/data/schemas/diffs/1.22/1.22-diff-1.24.json b/scripts/data/schemas/diffs/1.22/1.22-diff-1.24.json new file mode 100644 index 00000000..0713fa33 --- /dev/null +++ b/scripts/data/schemas/diffs/1.22/1.22-diff-1.24.json @@ -0,0 +1 @@ +{"schemas":{"specimen":{"updated":{"specimen_acquisition_interval":{"restrictions":{"range":{"left":{"min":0},"right":null}}}},"created":{},"deleted":{}},"treatment":{"updated":{"treatment_start_interval":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}}},"created":{},"deleted":{}},"chemotherapy":{"updated":{"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"deleted":{}},"hormone_therapy":{"updated":{"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"deleted":{}},"immunotherapy":{"updated":{"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"immunotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"displayName":{"left":"Immunotherapy Drug Name","right":"Chemotherapy Drug Name"},"dependsOn":{"left":null,"right":"immunotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"deleted":{}},"follow_up":{"updated":{"interval_of_followup":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"relapse_interval":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}}},"created":{},"deleted":{}},"biomarker":{"updated":{"test_interval":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}}},"created":{},"deleted":{}},"radiation":{"updated":{},"created":{"radiation_boost":{"changeType":"created","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"created","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}},"deleted":{}}}} diff --git a/scripts/data/schemas/diffs/1.23/1.23-diff-1.24.json b/scripts/data/schemas/diffs/1.23/1.23-diff-1.24.json new file mode 100644 index 00000000..b3d6942a --- /dev/null +++ b/scripts/data/schemas/diffs/1.23/1.23-diff-1.24.json @@ -0,0 +1 @@ +{"schemas":{"treatment":{"updated":{"treatment_start_interval":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}}},"created":{},"deleted":{}},"chemotherapy":{"updated":{"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"deleted":{}},"hormone_therapy":{"updated":{"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"deleted":{}},"immunotherapy":{"updated":{"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"immunotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"displayName":{"left":"Immunotherapy Drug Name","right":"Chemotherapy Drug Name"},"dependsOn":{"left":null,"right":"immunotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"deleted":{}},"follow_up":{"updated":{"interval_of_followup":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"relapse_interval":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}}},"created":{},"deleted":{}},"biomarker":{"updated":{"test_interval":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}}},"created":{},"deleted":{}}}} diff --git a/scripts/data/schemas/diffs/1.24/1.24-diff-0.10.json b/scripts/data/schemas/diffs/1.24/1.24-diff-0.10.json new file mode 100644 index 00000000..a3630428 --- /dev/null +++ b/scripts/data/schemas/diffs/1.24/1.24-diff-0.10.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"program_id":{"meta":{"examples":{"left":"TEST-CA","right":"PACA-AU,BR-CA"},"notes":{"left":"This is the unique id that is assigned to your program. If you have logged into the platform, this is the Program Id that you see in the Program Services area. For example, TEST-CA is a Program ID.","right":"This is the unique id that is assigned to your program. If you have logged into the platform, this is the Program Id that you see in the Submiission area."}}},"gender":{},"specimen_tissue_source":{},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Normal","Normal - tissue adjacent to primary tumour","Primary tumour","Primary tumour - adjacent to normal","Primary tumour - additional new primary","Recurrent tumour","Metastatic tumour","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour - additional metastatic","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line","Cell line - derived from xenograft tumour","Cell line - derived from tumour","Cell line - derived from normal"],"data":{"added":[],"deleted":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n\n const row = $row;\n let result = {valid: true, message: \"Ok\"};\n \n const designation = row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\"){\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when tumour_normal_designation is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when tumour_normal_designation is set to Tumour.\"};\n }\n }\n return result;\n })()"]}}},"sample_type":{}},"created":{},"deleted":{}},"donor":{"updated":{"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased"],"right":["Alive","Deceased","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"cause_of_death":{"restrictions":{"codeList":{"left":["Died of cancer","Died of other reasons","Unknown"],"right":["Died of cancer","Died of other reasons"],"data":{"added":[],"deleted":["Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })()"]}}},"survival_time":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })()"]},"range":{"left":{"exclusiveMin":0},"right":null}}},"height":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"weight":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"bmi":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"menopause_status":{"description":{"left":"Indicate the donor's menopause status at the time of primary diagnosis. (Reference: caDSR CDE ID 2434914)","right":"Indicate the donor's menopause status at the time of primary diagnosis. (Codelist reference: NCI CDE ID: 2434914)"},"restrictions":{"codeList":{"left":["Not applicable","Perimenopausal","Postmenopausal","Premenopausal","Unknown"],"right":["Premenopausal","Perimenopausal","Postmenopausal","Indeterminate or unknown","Not applicable"],"data":{"added":["Indeterminate or unknown"],"deleted":["Unknown"]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)","right":"Indicate the donor's age of menarche, the first occurrence of menstruation."},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"number_of_pregnancies":{"description":{"left":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)","right":"Indicate the number of pregnancies a donor has had."},"restrictions":{"range":{"left":{"min":0},"right":null}}},"number_of_children":{"description":{"left":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)","right":"Indicate the number of children the donor has birthed."},"restrictions":{"range":{"left":{"min":0},"right":null}}}},"created":{"prior_malignancy":{"changeType":"created","description":"Prior malignancy affecting donor.","name":"prior_malignancy","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"cancer_type_prior_malignancy":{"changeType":"created","description":"ICD-10 diagnostic code for type of cancer in a prior malignancy.","name":"cancer_type_prior_malignancy","restrictions":{"regex":"[A-Z]{1}[0-9]{2}.[0-9]{0,3}[A-Z]{0,1}$"},"valueType":"string","meta":{"displayName":"Cancer Type Prior Malignancy"}},"age_at_prior_malignancy":{"changeType":"created","description":"If donor has history of prior malignancy, indicate age at previous diagnosis, in years.","name":"age_at_prior_malignancy","valueType":"integer"},"laterality_of_prior_malignancy":{"changeType":"created","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis.","name":"laterality_of_prior_malignancy","valueType":"string","meta":{"displayName":"Age at Prior Malignancy"}}},"deleted":{"primary_site":{"changeType":"deleted","name":"primary_site","valueType":"string","isArray":true,"description":"The text term used to describe the primary site of disease, as categorized by the World Health Organization's (WHO) International Classification of Diseases for Oncology (ICD-O). This categorization groups cases into general categories.","meta":{"displayName":"Primary Site","core":true,"notes":"To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Breast|Ovary"},"restrictions":{"required":true,"codeList":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"]}},"genetic_disorders":{"changeType":"deleted","description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},"hrt_type":{"changeType":"deleted","description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},"hrt_duration":{"changeType":"deleted","description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},"contraception_type":{"changeType":"deleted","description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},"contraception_duration":{"changeType":"deleted","description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},"lost_to_followup_after_clinical_event_id":{"changeType":"deleted","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}}},"specimen":{"updated":{"pathological_tumour_staging_system":{"meta":{"validationDependency":{"left":true,"right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(\n field =>\n Object.keys(convertedRow).includes(field) &&\n (!convertedRow[field] || checkforEmpty(convertedRow[field])),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"data":{"added":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"deleted":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"]}}}},"pathological_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":null,"data":{"added":[],"deleted":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"]}}}},"pathological_n_category":{"restrictions":{"codeList":{"left":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"],"right":null,"data":{"added":[],"deleted":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"]}}}},"pathological_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":null,"data":{"added":[],"deleted":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"]}}}},"pathological_stage_group":{"description":{"left":"Specify the tumour stage, based on pathological_tumour_staging_system, used to assess the cancer at the time the tumour specimen was resected.","right":"Specify the tumour stage, based on tumour_staging_system, used to assess the cancer at the time the tumour specimen was resected."},"meta":{"notes":{"left":"This field depends on the selected pathological_tumour_staging_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","right":"This field depends on the selected pathological staging system, and is only required if the specimen is a tumour."}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":null,"data":{"added":[],"deleted":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":null}}},"specimen_acquisition_interval":{"meta":{"notes":{"left":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":null},"displayName":{"left":"Specimen Acquisition Interval","right":"Specimen Aquisition Interval"}},"restrictions":{"notes":{"left":null,"right":"The associated Primary Diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}}},"tumour_histological_type":{"description":{"left":"The code to represent the histology (morphology) of neoplasms that is usually obtained from a pathology report, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","right":"The code to represent the histology (morphology) of neoplasms that is usually obtained from a pathology report, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Please refer to the guidelines provided in the ICD-O-3 manual at https://apps.who.int/iris/handle/10665/42344."},"meta":{"validationDependency":{"left":true,"right":null}}},"specimen_anatomic_location":{"description":{"left":"Indicate the ICD-O-3 topography code for the anatomic location of a specimen when it was collected. Refer to the guidelines provided in the ICD-O-3 manual at https://apps.who.int/iris/handle/10665/42344.","right":"Anatomic location of a specimen when it was collected."},"meta":{"examples":{"left":"C50.1,C18","right":null}},"restrictions":{"regex":{"left":"^[C][0-9]{2}(.[0-9]{1})?$","right":null},"codeList":{"right":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear, pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal; distal","Esophageal; mid","Esophageal; proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck, NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es), maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"],"data":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear, pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal; distal","Esophageal; mid","Esophageal; proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck, NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es), maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"]}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation, other","Formalin fixed & paraffin embedded","Formalin fixed, buffered","Formalin fixed, unbuffered","Fresh","Other"],"data":{"added":["Cryopreservation, other","Formalin fixed, buffered","Formalin fixed, unbuffered"],"deleted":["Cryopreservation - other","Formalin fixed - buffered","Formalin fixed - unbuffered","Unknown"]}}}},"specimen_storage":{"description":{"left":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured.","right":"Indicate the method of specimen storage for specimens that were not extracted freshly or immediately cultured."},"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"right":["Cut slide","Frozen, -70 freezer","Frozen, liquid nitrogen","Frozen, vapor phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"data":{"added":["Frozen, -70 freezer","Frozen, liquid nitrogen","Frozen, vapor phase"],"deleted":["Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Unknown"]}}}},"tumour_grading_system":{"meta":{"validationDependency":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["FNCLCC grading system","Four-tier grading system","Gleason grade group system","Grading system for GISTs","Grading system for GNETs","ISUP grading system","Nuclear grading system for DCIS","Scarff-Bloom-Richardson grading system","Three-tier grading system","Two-tier grading system","WHO grading system for CNS tumours"],"right":["Default","Gleason","Nottingham","Brain cancer","ISUP","Lymphoid neoplasms"],"data":{"added":["Default","Gleason","Nottingham","Brain cancer","ISUP","Lymphoid neoplasms"],"deleted":["FNCLCC grading system","Four-tier grading system","Gleason grade group system","Grading system for GISTs","Grading system for GNETs","ISUP grading system","Nuclear grading system for DCIS","Scarff-Bloom-Richardson grading system","Three-tier grading system","Two-tier grading system","WHO grading system for CNS tumours"]}}}},"tumour_grade":{"meta":{"notes":{"left":"This field depends on the selected tumour_grading_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Grading Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-grading-classifications","right":"This field depends on the selected tumour grading system, and is only required if the specimen is a tumour."}},"restrictions":{"codeList":{"left":["Low grade","High grade","GX","G1","G2","G3","G4","Low","High","Grade I","Grade II","Grade III","Grade IV","Grade Group 1","Grade Group 2","Grade Group 3","Grade Group 4","Grade Group 5"],"data":["Low grade","High grade","GX","G1","G2","G3","G4","Low","High","Grade I","Grade II","Grade III","Grade IV","Grade Group 1","Grade Group 2","Grade Group 3","Grade Group 4","Grade Group 5"]},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'default':\n codeList = [\n 'gx - cannot be assessed',\n 'g1 well differentiated/low grade',\n 'g2 moderately differentiated/intermediated grade',\n 'g3 poorly differentiated/high grade',\n 'g4 undifferentiated/high grade',\n ];\n break;\n case 'gleason':\n codeList = [\n 'gleason x: gleason score cannot be determined',\n 'gleason 2–6: the tumor tissue is well differentiated',\n 'gleason 7: the tumor tissue is moderately differentiated',\n 'gleason 8–10: the tumor tissue is poorly differentiated or undifferentiated',\n ];\n break;\n case 'nottingham':\n codeList = [\n 'g1 (low grade or well differentiated)',\n 'g2 (intermediate grade or moderately differentiated)',\n 'g3 (high grade or poorly differentiated)',\n ];\n break;\n case 'brain cancer':\n codeList = ['grade i', 'grade ii', 'grade iii', 'grade iv'];\n break;\n case 'isup for renal cell carcinoma':\n codeList = [\n 'grade 1: tumor cell nucleoli invisible or small and basophilic at 400 x magnification',\n 'grade 2: tumor cell nucleoli conspicuous at 400 x magnification but inconspicuous at 100 x magnification',\n 'grade 3: tumor cell nucleoli eosinophilic and clearly visible at 100 x magnification',\n 'grade 4: tumors showing extreme nuclear pleomorphism and/or containing tumor giant cells and/or the presence of any proportion of tumor showing sarcomatoid and/or rhabdoid dedifferentiation',\n ];\n break;\n case 'lymphoid neoplasms':\n codeList = ['low grade or indolent nhl', 'high grade or aggressive nhl'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })()"]}}},"percent_tumour_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)","right":"Indicate a value, in decimals, that represents the percentage of infiltration by tumour cells in a specimen."},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null},"script":{"left":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"],"right":null}}},"percent_proliferating_cells":{"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_inflammatory_tissue":{"description":{"left":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)","right":"Indicate a value, in decimals, that represents local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_stromal_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)","right":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a malignant tumour specimen but are not malignant such as fibroblasts, vascular structures, etc."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_necrosis":{"description":{"left":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)","right":"Indicate a value, in decimals, that represents the percentage of cell death in a malignant tumour specimen."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}}},"created":{"central_pathology_confirmed":{"changeType":"created","name":"central_pathology_confirmed","description":"Indicate whether the histologic description of tissue or cells was confirmed by a pathology review of frozen or formalin fixed slide(s) completed after the diagnostic pathology review of the tumour sample used to extract analyte(s).","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Central Pathology Confirmed"},"restrictions":{"codeList":["Yes","No","Unknown"]}}},"deleted":{"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate the primary diagnosis event in the clinical timeline that this specimen acquisition was related to.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"specimen_laterality":{"changeType":"deleted","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"reference_pathology_confirmed":{"changeType":"deleted","name":"reference_pathology_confirmed","description":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)","valueType":"string","meta":{"validationDependency":true,"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Reference Pathology Confirmed"},"restrictions":{"codeList":["Yes","No","Unknown"]}},"percent_tumour_cells_measurement_method":{"changeType":"deleted","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}}},"primary_diagnosis":{"updated":{"age_at_diagnosis":{"description":{"left":"Age that the donor was first diagnosed with cancer, in years. This should be based on the earliest diagnosis of cancer.","right":"Age that the donor was first diagnosed with cancer, in years."},"restrictions":{"range":{"left":{"exclusiveMin":0,"max":90},"right":null}}},"cancer_type_code":{"meta":{"examples":{"left":"C41.1,C16.9,C00.5,D46.9","right":"C41.1,C16.9,C00.543A"}},"restrictions":{"regex":{"left":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","right":"^[C][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"}}},"basis_of_diagnosis":{},"number_lymph_nodes_examined":{"description":{"left":"The total number of lymph nodes tested for the presence of cancer. (Reference: caDSR CDE ID 3)","right":"The total number of lymph nodes tested for the presence of cancer. (Reference: NCI CDE ID: 3)"},"meta":{"dependsOn":{"left":"primary_diagnosis.lymph_nodes_examined_status","right":null},"notes":{"left":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":null},"range":{"left":{"min":0},"right":null}}},"number_lymph_nodes_positive":{"description":{"left":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: caDSR CDE ID 6113694)","right":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: NCI CDE ID: 6113694)"},"meta":{"dependsOn":{"left":"primary_diagnosis.lymph_nodes_examined_status","right":null},"notes":{"left":"This field is only required if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":null},"range":{"left":{"min":0},"right":null},"required":{"left":null,"right":true}}},"clinical_tumour_staging_system":{"meta":{"validationDependency":{"left":true,"right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(\n field =>\n Object.keys(convertedRow).includes(field) &&\n (!convertedRow[field] || checkforEmpty(convertedRow[field])),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"data":{"added":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"deleted":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"]}},"required":{"left":null,"right":true}}},"clinical_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":null,"data":{"added":[],"deleted":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"]}}}},"clinical_n_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"],"right":null,"data":{"added":[],"deleted":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"]}}}},"clinical_m_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned.","right":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned."},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":null,"data":{"added":[],"deleted":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"]}}}},"clinical_stage_group":{"description":{"left":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage.","right":"Stage group of the tumour, as assigned by the reporting tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.)."},"meta":{"notes":{"left":"This field is dependent on the selected clinical_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","right":null},"examples":{"left":"Stage I, Stage IIB","right":null}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"presenting_symptoms":{"meta":{"notes":{"left":"To include multiple values, separate values with a pipe delimiter '|' within your file.","right":null},"examples":{"left":"Anemia|Bloating|Diabetes","right":null}},"restrictions":{"codeList":{"left":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Loss of Appetite","Nausea","None","Not Reported","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Swelling in the Neck","Unknown","Vomiting","Weight Loss"],"right":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Nausea","None","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Unknown","Vomiting","Weight Loss"],"data":{"added":[],"deleted":["Loss of Appetite","Not Reported","Swelling in the Neck"]}}}},"performance_status":{"description":{"left":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status).","right":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference source: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status)."},"meta":{"notes":{"left":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction.\nGrade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work).\nGrade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours.\nGrade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours.\nGrade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair","right":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction \n Grade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work) \n Grade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours \n Grade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours \n Grade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair"}},"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"data":{"added":[],"deleted":["Unknown"]}}}}},"created":{"stage_suffix":{"changeType":"created","name":"stage_suffix","description":"If necessary, use this field to add any applicable stage suffixes. Stage suffixes may apply to certain staging systems such as Ann Arbour staging system where the four stages are divided into 4 categories (A, B, X and E).","valueType":"string","meta":{"core":true,"dependsOn":"primary_diagnosis.clinical_tumour_staging_system","displayName":"Stage Suffix"}}},"deleted":{"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Unique identifier of the primary diagnosis event, assigned by the data provider.","meta":{"primaryId":true,"displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"cancer_type_additional_information":{"changeType":"deleted","name":"cancer_type_additional_information","valueType":"string","description":"Additional details related to the cancer type that are not covered by the ICD-10 code provided in the cancer_type field.","meta":{"displayName":"Cancer Type Additional Information"}},"laterality":{"changeType":"deleted","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_status":{"changeType":"deleted","name":"lymph_nodes_examined_status","description":"Indicate if lymph nodes were examined for metastases.","valueType":"string","restrictions":{"required":true,"codeList":["Cannot be determined","No","No lymph nodes found in resected specimen","Not applicable","Yes"]},"meta":{"core":true,"displayName":"Lymph Nodes Examined Status"}},"lymph_nodes_examined_method":{"changeType":"deleted","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}}},"treatment":{"updated":{"treatment_type":{"meta":{"notes":{"left":"Depending on the treatment_type(s) selected, additional treatment details may be required to be submitted. For example, if treatment_type includes 'Chemotherapy', the supplemental Chemotherapy treatment type file is required.\nTo include multiple values, separate values with a pipe delimiter '|' within your file.","right":"Depending on the treatment_type selected, additional treament details may be required to be submitted."},"examples":{"left":"Chemotherapy|Hormonal therapy","right":null}},"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Chemotherapy","Ablation","Bone marrow transplant","Combined chemo+immunotherapy","Combined chemo+radiation therapy","Combined chemo-radiotherapy and surgery","Endoscopic therapy","Hormonal therapy","Immunotherapy","Monoclonal antibodies (for liquid tumours)","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgical resection"],"data":{"added":["Combined chemo+immunotherapy","Combined chemo+radiation therapy","Combined chemo-radiotherapy and surgery","Monoclonal antibodies (for liquid tumours)","Surgical resection"],"deleted":["End of life care","Surgery"]}}}},"is_primary_treatment":{"description":{"left":"Indicate if the treatment was the primary treatment following the initial diagnosis.","right":"Indicate if the treamtment was the primary treatment following the initial diagnosis."},"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"codeList":{"left":["Yes","No"],"right":["Yes","No","Unknown"],"data":{"added":["Unknown"],"deleted":[]}},"required":{"left":null,"right":true}}},"treatment_start_interval":{"description":{"left":"The interval between the primary diagnosis and initiation of treatment, in days.","right":"The interval between primary diagnosis and initiation of treatment, in days."},"meta":{"notes":{"left":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":"The associated Primary Diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis"},"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"treatment_duration":{"description":{"left":"The duration of treatment regimen, in days.","right":"The duration of treatment regimen, in days"},"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null},"required":{"left":null,"right":true}}}},"created":{"age_at_consent_for_treatment":{"changeType":"created","name":"age_at_consent_for_treatment","description":"Indicate the age of donor when consent was given for treatment.","valueType":"integer","meta":{"displayName":"Age At Consent For Treatment"}},"therapeutic_intent":{"changeType":"created","name":"therapeutic_intent","description":"The therapeutic intent, the reason behind the choice of a therapy, of the treatment.","valueType":"string","restrictions":{"required":true,"codeList":["Adjuvant","Concurrent","Curative","Neoadjuvant","Not applicable","Palliative","Unknown"]},"meta":{"core":true,"displayName":"Therapeutic Intent"}},"response_to_therapy":{"changeType":"created","name":"response_to_therapy","description":"The donors's response to the applied treatment regimen. (Source: RECIST)","valueType":"string","restrictions":{"required":true,"codeList":["Complete response","Disease progression","NED","Partial response","Stable disease"]},"meta":{"core":true,"displayName":"Response to Therapy"}}},"deleted":{"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate the primary diagnosis event in the clinical timeline that this treatment was related to.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"line_of_treatment":{"changeType":"deleted","name":"line_of_treatment","description":"Indicate the line of treatment if it is not the primary treatment.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Line Of treatment","dependsOn":"treatment.is_primary_treatment","examples":"2,3,4"}},"days_per_cycle":{"changeType":"deleted","name":"days_per_cycle","description":"Indicate the number of days in a treatment cycle.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Days Per Cycle","dependsOn":"treatment.treatment_type"}},"number_of_cycles":{"changeType":"deleted","name":"number_of_cycles","description":"Indicate the number of treatment cycles.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Number Of Cycles","dependsOn":"treatment.treatment_type"}},"treatment_intent":{"changeType":"deleted","name":"treatment_intent","description":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"]},"meta":{"core":true,"displayName":"Treatment Intent","dependsOn":"treatment.treatment_type"}},"treatment_setting":{"changeType":"deleted","name":"treatment_setting","description":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: NCIt C124308)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"]},"meta":{"core":true,"displayName":"Treatment Setting","dependsOn":"treatment.treatment_type"}},"response_to_treatment_criteria_method":{"changeType":"deleted","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},"response_to_treatment":{"changeType":"deleted","name":"response_to_treatment","description":"The donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"codeList":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"]},"meta":{"core":true,"displayName":"Response To Treatment","dependsOn":"treatment.response_to_treatment_criteria_method","notes":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"outcome_of_treatment":{"changeType":"deleted","name":"outcome_of_treatment","description":"Indicate the donor's outcome of the prescribed treatment.","valueType":"string","restrictions":{"codeList":["Treatment completed as prescribed","Treatment incomplete due to technical or organizational problems","Treatment incomplete because patient died","Patient choice (stopped or interrupted treatment)","Physician decision (stopped or interrupted treatment)","Treatment stopped due to lack of efficacy (disease progression)","Treatment stopped due to acute toxicity","Other","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Outcome Of Treatment","dependsOn":"treatment.treatment_type"}},"toxicity_type":{"changeType":"deleted","name":"toxicity_type","description":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity.","valueType":"string","restrictions":{"codeList":["Hematological","Non-hematological","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Toxicity Type","dependsOn":"treatment.outcome_of_treatment"}},"hematological_toxicity":{"changeType":"deleted","name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"non-hematological_toxicity":{"changeType":"deleted","name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"adverse_events":{"changeType":"deleted","name":"adverse_events","description":"Report any treatment related adverse events. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Adverse Events","dependsOn":"treatment.treatment_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"clinical_trials_database":{"changeType":"deleted","name":"clinical_trials_database","description":"If the donor is a participant in a clinical trial, indicate the clinical trial database where the clinical trial is registered.","valueType":"string","meta":{"display name":"Clinical Trials Database","notes":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added."},"restrictions":{"codeList":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"]}},"clinical_trial_number":{"changeType":"deleted","name":"clinical_trial_number","description":"Based on the clinical_trial_database, indicate the unique NCT or EudraCT clinical trial identifier of which the donor is a participant.","valueType":"string","meta":{"display name":"Clinical Trial Number","dependsOn":"treatment.clinical_trials_database","examples":"2016-002120-83,NCT02465060"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"]}}}},"chemotherapy":{"updated":{},"created":{"chemotherapy_drug_name":{"changeType":"created","name":"chemotherapy_drug_name","description":"Name of agent or drug administered to patient as part of the chemotherapy treatment regimen.","valueType":"string","restrictions":{"required":true,"codeList":["Placeholder list 1","Need list","Still need it"]},"meta":{"validationDependency":true,"core":true,"notes":"This field uses a controlled vocabulary gathered from the DrugBank database of drug names.","examples":"Allopurinol, Dronabinol, Sucralfate, Lapatinib","displayName":"Chemotherapy Drug Name"}},"chemotherapy_dosage_units":{"changeType":"created","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","µg/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate the total drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"integer","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_rxnormcui":{"changeType":"deleted","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"deleted","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"deleted","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"deleted","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"deleted","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"deleted","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}}},"hormone_therapy":{"updated":{},"created":{"hormone_therapy_drug_name":{"changeType":"created","name":"hormone_therapy_drug_name","description":"Name of agent or drug administered to patient as part of the hormone therapy treatment regimen.","valueType":"string","restrictions":{"required":true,"codeList":["Placeholder list 1","Need list","Still need it"]},"meta":{"validationDependency":true,"core":true,"notes":"This field uses a controlled vocabulary gathered from the DrugBank database of drug names.","displayName":"Hormone Therapy Drug Name"}},"hormone_drug_dosage_units":{"changeType":"created","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","µg/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"integer","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dose"}}},"deleted":{"drug_rxnormcui":{"changeType":"deleted","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"deleted","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Hormone Therapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"deleted","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"radiation":{"updated":{"radiation_therapy_fractions":{"description":{"left":"Indicate the total number of fractions delivered as part of treatment.","right":"Indicate the number of total fractions delivered as part of treatment."},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"radiation_therapy_dosage":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"anatomical_site_irradiated":{"description":{"left":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)","right":"Indicate localization site where radiation therapy was administered."},"restrictions":{"codeList":{"left":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"right":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"data":{"added":["Bone","Extremities","Head-Neck","Peritoneum"],"deleted":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"]}}}}},"created":{"application_form":{"changeType":"created","name":"application_form","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal (including Brachytherapy)"]},"meta":{"core":true,"displayName":"Application Form"}}},"deleted":{"radiation_therapy_type":{"changeType":"deleted","name":"radiation_therapy_type","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal"]},"meta":{"core":true,"displayName":"Type of Radiation Therapy","notes":"Internal application includes Brachytherapy."}},"radiation_boost":{"changeType":"deleted","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"deleted","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}}},"immunotherapy":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"immunotherapy_type":{"changeType":"deleted","name":"immunotherapy_type","valueType":"string","description":"Indicate the type of immunotherapy administered to donor.","meta":{"displayName":"Immunotherapy Type","core":true},"restrictions":{"required":true,"codeList":["Cell-based","Immune checkpoint inhibitors","Monoclonal antibodies other than immune checkpoint inhibitors","Other immunomodulatory substances"]}},"drug_rxnormcui":{"changeType":"deleted","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"deleted","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"deleted","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"surgery":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"deleted","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"deleted","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"deleted","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"deleted","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"deleted","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"deleted","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"deleted","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"deleted","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"deleted","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"deleted","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"deleted","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"deleted","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"deleted","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"deleted","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}}},"follow_up":{"updated":{"submitter_follow_up_id":{"description":{"left":"Unique identifier for a follow-up event in a donor's clinical record, assigned by the data provider.","right":"Unique identifier for a follow-up event in a donors clincal record, assigned by the data provider."}},"interval_of_followup":{"meta":{"notes":{"left":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":"The associated Primary Diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}}},"disease_status_at_followup":{"description":{"left":"Indicate the donor's disease status at time of follow-up. (Reference: RECIST)","right":"Indicate the donor's disease status at time of follow-up."},"restrictions":{"codeList":{"left":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Progression NOS","Relapse or recurrence","Stable"],"right":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Relapse","Stable"],"data":{"added":["Relapse"],"deleted":["Progression NOS","Relapse or recurrence"]}}}},"weight_at_followup":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"relapse_type":{"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.","right":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse."}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":null}}},"relapse_interval":{"description":{"left":"If the donor was clinically disease free following primary treatment and then relapse or recurrence or progression (for liquid tumours) occurred afterwards, then this field will indicate the length of disease free interval, in days.","right":"If the donor was clinically disease free following primary treatment and then relapse or progression (for liquid tumours) occurred afterwards, then this field will indicate the length of disease free interval, in days."},"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.","right":"This field is required to be submitted if disease_status_at_followup indicates a progression or relapse value."}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"]}}},"method_of_progression_status":{"description":{"left":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Reference: caDSR CDE ID 6161031)","right":"Indicate the method(s) used to confirm the donor's progression disease status. (Codelist reference: NCI CDE ID: 6161031)"},"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file.","right":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"]},"codeList":{"left":["Biomarker in liquid biopsy (e.g. tumour marker in blood or urine)","Biopsy","Blood draw","Bone marrow aspirate","Core biopsy","Cystoscopy","Cytology","Debulking","Diagnostic imaging","Dilation and curettage procedure","Enucleation","Excisional biopsy","Fine needle aspiration","Imaging","Incisional biopsy","Laparoscopy","Laparotomy","Other","Pap Smear","Pathologic review","Physical exam","Surgical resection","Thoracentesis","Ultrasound guided biopsy"],"right":["Autopsy","Biomarker in liquid biopsy (e.g. tumour marker in blood or urine)","Biopsy","Blood draw","Bone marrow aspirate","Core biopsy","Cystoscopy","Cytology","Debulking","Diagnostic imaging","Dilation and curettage procedure","Enucleation","Excisional biopsy","Fine needle aspiration","Imaging","Incisional biopsy","Laparoscopy","Laparotomy","Other","Pap Smear","Pathologic review","Physical exam","Surgical resection","Thoracentesis","Ultrasound guided biopsy"],"data":{"added":["Autopsy"],"deleted":[]}}}},"recurrence_tumour_staging_system":{"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.","right":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse."},"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"data":{"added":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"deleted":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(\n field =>\n Object.keys(convertedRow).includes(field) &&\n (!convertedRow[field] || checkforEmpty(convertedRow[field])),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"]}}},"recurrence_t_category":{"description":{"left":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":null,"data":{"added":[],"deleted":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"]}}}},"recurrence_n_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"],"right":null,"data":{"added":[],"deleted":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"]}}}},"recurrence_m_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":null,"data":{"added":[],"deleted":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"]}}}},"recurrence_stage_group":{"description":{"left":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) at the time of retreatment for a recurrence or disease progression.","right":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery."},"meta":{"notes":{"left":"This field is dependent on the selected recurrence_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","right":null},"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":null,"data":{"added":[],"deleted":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":null}}},"posttherapy_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(\n field =>\n Object.keys(convertedRow).includes(field) &&\n (!convertedRow[field] || checkforEmpty(convertedRow[field])),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"data":{"added":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"deleted":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"]}}}},"posttherapy_t_category":{"meta":{"dependsOn":{"left":"follow_up.posttherapy_tumour_staging_system","right":"follow_up.post_therapy_tumour_staging_system"}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":null,"data":{"added":[],"deleted":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"]}}}},"posttherapy_n_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"dependsOn":{"left":"follow_up.posttherapy_tumour_staging_system","right":"follow_up.post_therapy_tumour_staging_system"}},"restrictions":{"codeList":{"left":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"],"right":null,"data":{"added":[],"deleted":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"]}}}},"posttherapy_m_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"dependsOn":{"left":"follow_up.posttherapy_tumour_staging_system","right":"follow_up.post_therapy_tumour_staging_system"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":null,"data":{"added":[],"deleted":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"]}}}},"posttherapy_stage_group":{"meta":{"dependsOn":{"left":"follow_up.posttherapy_tumour_staging_system","right":"follow_up.post_therapy_tumour_staging_system"},"notes":{"left":"This field is dependent on the selected posttherapy_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","right":"This field value is dependent on the selected posttherapy_tumour_staging_system."}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":null,"data":{"added":[],"deleted":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":null}}}},"created":{"anatomic_site_progression_or_recurrences":{"changeType":"created","description":"Indicate the anatomic site where disease progression or recurrence occurred. (Codelist reference: NCI CDE ID: 4742851)","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"],"codeList":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear, pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal; distal","Esophageal; mid","Esophageal; proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck, NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es), maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"]},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","notes":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse.","displayName":"Anatomic Site Progression or Recurrences"}}},"deleted":{"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate if the follow-up is related to a specific primary diagnosis event in the clinical timeline.","meta":{"validationDependency":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID","primaryId":true},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"Indicate if the follow-up is related to a specific treatment event in the clinical timeline.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"anatomic_site_progression_or_recurrence":{"changeType":"deleted","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"exposure":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"deleted","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"deleted","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"deleted","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"deleted","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"deleted","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"deleted","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"deleted","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"deleted","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"deleted","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"deleted","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"deleted","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}}},"family_history":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"family_relative_id":{"changeType":"deleted","description":"Unique identifier of the relative, assigned by the data provider.","name":"family_relative_id","valueType":"string","meta":{"displayName":"Family Relative ID","primaryId":true,"notes":"This field is required to ensure that family members are identified in unique records. Ids can be as simple as an incremented numeral to ensure uniqueness."},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"relative_with_cancer_history":{"changeType":"deleted","description":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","name":"relative_with_cancer_history","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Relative with Cancer History"}},"relationship_type":{"changeType":"deleted","description":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","name":"relationship_type","restrictions":{"codeList":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"]},"valueType":"string","meta":{"displayName":"Relationship Type"}},"gender_of_relative":{"changeType":"deleted","description":"The self-reported gender of related individual.","name":"gender_of_relative","restrictions":{"codeList":["Female","Male","Other","Unknown"]},"valueType":"string","meta":{"displayName":"Gender of Relative"}},"age_of_relative_at_diagnosis":{"changeType":"deleted","description":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","name":"age_of_relative_at_diagnosis","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","displayName":"Age Of Relative At Diagnosis"}},"cancer_type_code_of_relative":{"changeType":"deleted","name":"cancer_type_code_of_relative","valueType":"string","description":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"examples":"C41.1,C16.9,C00.5,D46.9","dependsOn":"family_history.relative_with_cancer_history","displayName":"Cancer Type Code (ICD-10) of Relative"}},"relative_vital_status":{"changeType":"deleted","description":"Relative's last known state of living or deceased.","name":"relative_vital_status","restrictions":{"codeList":["Alive","Deceased","Unknown"]},"valueType":"string","meta":{"displayName":"Vital Status of Relative"}},"cause_of_death_of_relative":{"changeType":"deleted","description":"Indicate the cause of the death of the relative.","name":"cause_of_death_of_relative","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]},"valueType":"string","meta":{"dependsOn":"family_history.relative_vital_status","displayName":"Cause of Death of Relative"}},"relative_survival_time":{"changeType":"deleted","description":"Indicate how long, in days, the relative survived from the time they were diagnosed with cancer.","name":"relative_survival_time","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","units":"days","displayName":"Survival Time Of Relative"}}}},"biomarker":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"deleted","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"deleted","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"deleted","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"deleted","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"deleted","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"deleted","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"deleted","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"deleted","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"deleted","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"deleted","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"deleted","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"deleted","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"deleted","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"deleted","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"deleted","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"deleted","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}}},"comorbidity":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"deleted","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"deleted","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"deleted","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"deleted","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"deleted","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"deleted","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}}}}} diff --git a/scripts/data/schemas/diffs/1.24/1.24-diff-0.11.json b/scripts/data/schemas/diffs/1.24/1.24-diff-0.11.json new file mode 100644 index 00000000..aee1ea0d --- /dev/null +++ b/scripts/data/schemas/diffs/1.24/1.24-diff-0.11.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"program_id":{"meta":{"examples":{"left":"TEST-CA","right":"PACA-AU,BR-CA"},"notes":{"left":"This is the unique id that is assigned to your program. If you have logged into the platform, this is the Program Id that you see in the Program Services area. For example, TEST-CA is a Program ID.","right":"This is the unique id that is assigned to your program. If you have logged into the platform, this is the Program Id that you see in the Submiission area."}}},"gender":{},"specimen_tissue_source":{},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Normal","Normal - tissue adjacent to primary tumour","Primary tumour","Primary tumour - adjacent to normal","Primary tumour - additional new primary","Recurrent tumour","Metastatic tumour","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour - additional metastatic","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line","Cell line - derived from xenograft tumour","Cell line - derived from tumour","Cell line - derived from normal"],"data":{"added":[],"deleted":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n\n const row = $row;\n let result = {valid: true, message: \"Ok\"};\n \n const designation = row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\"){\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when tumour_normal_designation is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when tumour_normal_designation is set to Tumour.\"};\n }\n }\n return result;\n })()"]}}},"sample_type":{}},"created":{},"deleted":{}},"donor":{"updated":{"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased"],"right":["Alive","Deceased","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"cause_of_death":{"restrictions":{"codeList":{"left":["Died of cancer","Died of other reasons","Unknown"],"right":["Died of cancer","Died of other reasons"],"data":{"added":[],"deleted":["Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })()"]}}},"survival_time":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })()"]},"range":{"left":{"exclusiveMin":0},"right":null}}},"primary_site":{"meta":{"notes":{"left":"To include multiple values, separate values with a pipe delimiter '|' within your file.","right":null},"examples":{"left":"Breast|Ovary","right":null}},"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva","Unknown","Not Reported"],"data":{"added":["Unknown","Not Reported"],"deleted":["Unknown primary site"]}}}},"height":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"weight":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"bmi":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"menopause_status":{"description":{"left":"Indicate the donor's menopause status at the time of primary diagnosis. (Reference: caDSR CDE ID 2434914)","right":"Indicate the donor's menopause status at the time of primary diagnosis. (Codelist reference: NCI CDE ID: 2434914)"},"restrictions":{"codeList":{"left":["Not applicable","Perimenopausal","Postmenopausal","Premenopausal","Unknown"],"right":["Indeterminate or unknown","Not applicable","Perimenopausal","Postmenopausal","Premenopausal"],"data":{"added":["Indeterminate or unknown"],"deleted":["Unknown"]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)","right":"Indicate the donor's age of menarche, the first occurrence of menstruation."},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"number_of_pregnancies":{"description":{"left":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)","right":"Indicate the number of pregnancies a donor has had."},"restrictions":{"range":{"left":{"min":0},"right":null}}},"number_of_children":{"description":{"left":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)","right":"Indicate the number of children the donor has birthed."},"restrictions":{"range":{"left":{"min":0},"right":null}}}},"created":{"prior_malignancy":{"changeType":"created","description":"Prior malignancy affecting donor.","name":"prior_malignancy","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"cancer_type_prior_malignancy":{"changeType":"created","description":"The ICD-10 diagnostic code (https://icd.who.int/browse10/2019/en) for the type of cancer in a prior malignancy.","name":"cancer_type_prior_malignancy","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"valueType":"string","meta":{"displayName":"Cancer Type Prior Malignancy"}},"age_at_prior_malignancy":{"changeType":"created","description":"If donor has history of prior malignancy, indicate age at previous diagnosis, in years.","name":"age_at_prior_malignancy","valueType":"integer","meta":{"displayName":"Age at Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"created","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis.","name":"laterality_of_prior_malignancy","valueType":"string","meta":{"displayName":"Laterality at Prior Malignancy"}}},"deleted":{"genetic_disorders":{"changeType":"deleted","description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},"hrt_type":{"changeType":"deleted","description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},"hrt_duration":{"changeType":"deleted","description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},"contraception_type":{"changeType":"deleted","description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},"contraception_duration":{"changeType":"deleted","description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},"lost_to_followup_after_clinical_event_id":{"changeType":"deleted","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}}},"specimen":{"updated":{"pathological_tumour_staging_system":{"meta":{"validationDependency":{"left":true,"right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(\n field =>\n Object.keys(convertedRow).includes(field) &&\n (!convertedRow[field] || checkforEmpty(convertedRow[field])),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"data":{"added":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"deleted":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"]}}}},"pathological_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":null,"data":{"added":[],"deleted":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"]}}}},"pathological_n_category":{"restrictions":{"codeList":{"left":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"],"right":null,"data":{"added":[],"deleted":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"]}}}},"pathological_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":null,"data":{"added":[],"deleted":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"]}}}},"pathological_stage_group":{"description":{"left":"Specify the tumour stage, based on pathological_tumour_staging_system, used to assess the cancer at the time the tumour specimen was resected.","right":"Specify the tumour stage, based on tumour_staging_system, used to assess the cancer at the time the tumour specimen was resected."},"meta":{"notes":{"left":"This field depends on the selected pathological_tumour_staging_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","right":"This field depends on the selected pathological staging system, and is only required if the specimen is a tumour."}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":null,"data":{"added":[],"deleted":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":null}}},"specimen_acquisition_interval":{"meta":{"notes":{"left":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":"The associated Primary Diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."},"displayName":{"left":"Specimen Acquisition Interval","right":"Specimen Aquisition Interval"}}},"tumour_histological_type":{"description":{"left":"The code to represent the histology (morphology) of neoplasms that is usually obtained from a pathology report, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","right":"The code to represent the histology (morphology) of neoplasms that is usually obtained from a pathology report, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Please refer to the guidelines provided in the ICD-O-3 manual at https://apps.who.int/iris/handle/10665/42344."},"meta":{"validationDependency":{"left":true,"right":null}}},"specimen_anatomic_location":{"description":{"left":"Indicate the ICD-O-3 topography code for the anatomic location of a specimen when it was collected. Refer to the guidelines provided in the ICD-O-3 manual at https://apps.who.int/iris/handle/10665/42344.","right":"Anatomic location of a specimen when it was collected."},"meta":{"examples":{"left":"C50.1,C18","right":null}},"restrictions":{"regex":{"left":"^[C][0-9]{2}(.[0-9]{1})?$","right":null},"codeList":{"right":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear - pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal - distal","Esophageal - mid","Esophageal - proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es) - maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"],"data":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear - pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal - distal","Esophageal - mid","Esophageal - proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es) - maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"]}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"data":{"added":[],"deleted":["Unknown"]}}}},"specimen_storage":{"description":{"left":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured.","right":"Indicate the method of specimen storage for specimens that were not extracted freshly or immediately cultured."},"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"data":{"added":[],"deleted":["Unknown"]}}}},"tumour_grading_system":{"meta":{"validationDependency":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["FNCLCC grading system","Four-tier grading system","Gleason grade group system","Grading system for GISTs","Grading system for GNETs","ISUP grading system","Nuclear grading system for DCIS","Scarff-Bloom-Richardson grading system","Three-tier grading system","Two-tier grading system","WHO grading system for CNS tumours"],"right":["Default","Gleason","Nottingham","Brain cancer","ISUP","Lymphoid neoplasms"],"data":{"added":["Default","Gleason","Nottingham","Brain cancer","ISUP","Lymphoid neoplasms"],"deleted":["FNCLCC grading system","Four-tier grading system","Gleason grade group system","Grading system for GISTs","Grading system for GNETs","ISUP grading system","Nuclear grading system for DCIS","Scarff-Bloom-Richardson grading system","Three-tier grading system","Two-tier grading system","WHO grading system for CNS tumours"]}}}},"tumour_grade":{"meta":{"notes":{"left":"This field depends on the selected tumour_grading_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Grading Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-grading-classifications","right":"This field depends on the selected tumour grading system, and is only required if the specimen is a tumour."}},"restrictions":{"codeList":{"left":["Low grade","High grade","GX","G1","G2","G3","G4","Low","High","Grade I","Grade II","Grade III","Grade IV","Grade Group 1","Grade Group 2","Grade Group 3","Grade Group 4","Grade Group 5"],"data":["Low grade","High grade","GX","G1","G2","G3","G4","Low","High","Grade I","Grade II","Grade III","Grade IV","Grade Group 1","Grade Group 2","Grade Group 3","Grade Group 4","Grade Group 5"]},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'default':\n codeList = [\n 'gx - cannot be assessed',\n 'g1 well differentiated/low grade',\n 'g2 moderately differentiated/intermediated grade',\n 'g3 poorly differentiated/high grade',\n 'g4 undifferentiated/high grade',\n ];\n break;\n case 'gleason':\n codeList = [\n 'gleason x: gleason score cannot be determined',\n 'gleason 2–6: the tumor tissue is well differentiated',\n 'gleason 7: the tumor tissue is moderately differentiated',\n 'gleason 8–10: the tumor tissue is poorly differentiated or undifferentiated',\n ];\n break;\n case 'nottingham':\n codeList = [\n 'g1 (low grade or well differentiated)',\n 'g2 (intermediate grade or moderately differentiated)',\n 'g3 (high grade or poorly differentiated)',\n ];\n break;\n case 'brain cancer':\n codeList = ['grade i', 'grade ii', 'grade iii', 'grade iv'];\n break;\n case 'isup for renal cell carcinoma':\n codeList = [\n 'grade 1: tumor cell nucleoli invisible or small and basophilic at 400 x magnification',\n 'grade 2: tumor cell nucleoli conspicuous at 400 x magnification but inconspicuous at 100 x magnification',\n 'grade 3: tumor cell nucleoli eosinophilic and clearly visible at 100 x magnification',\n 'grade 4: tumors showing extreme nuclear pleomorphism and/or containing tumor giant cells and/or the presence of any proportion of tumor showing sarcomatoid and/or rhabdoid dedifferentiation',\n ];\n break;\n case 'lymphoid neoplasms':\n codeList = ['low grade or indolent nhl', 'high grade or aggressive nhl'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })()"]}}},"percent_tumour_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)","right":"Indicate a value, in decimals, that represents the percentage of infiltration by tumour cells in a specimen."},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null},"script":{"left":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"],"right":null}}},"percent_proliferating_cells":{"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_inflammatory_tissue":{"description":{"left":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)","right":"Indicate a value, in decimals, that represents local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_stromal_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)","right":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a malignant tumour specimen but are not malignant such as fibroblasts, vascular structures, etc."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_necrosis":{"description":{"left":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)","right":"Indicate a value, in decimals, that represents the percentage of cell death in a malignant tumour specimen."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}}},"created":{"central_pathology_confirmed":{"changeType":"created","name":"central_pathology_confirmed","description":"Indicate whether the histologic description of tissue or cells was confirmed by a pathology review of frozen or formalin fixed slide(s) completed after the diagnostic pathology review of the tumour sample used to extract analyte(s).","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Central Pathology Confirmed"},"restrictions":{"codeList":["Yes","No","Unknown"]}}},"deleted":{"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate the primary diagnosis event in the clinical timeline that this specimen acquisition was related to.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"specimen_laterality":{"changeType":"deleted","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"reference_pathology_confirmed":{"changeType":"deleted","name":"reference_pathology_confirmed","description":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)","valueType":"string","meta":{"validationDependency":true,"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Reference Pathology Confirmed"},"restrictions":{"codeList":["Yes","No","Unknown"]}},"percent_tumour_cells_measurement_method":{"changeType":"deleted","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}}},"primary_diagnosis":{"updated":{"age_at_diagnosis":{"description":{"left":"Age that the donor was first diagnosed with cancer, in years. This should be based on the earliest diagnosis of cancer.","right":"Age that the donor was first diagnosed with cancer, in years."},"restrictions":{"range":{"left":{"exclusiveMin":0,"max":90},"right":null}}},"basis_of_diagnosis":{},"number_lymph_nodes_examined":{"description":{"left":"The total number of lymph nodes tested for the presence of cancer. (Reference: caDSR CDE ID 3)","right":"The total number of lymph nodes tested for the presence of cancer. (Reference: NCI CDE ID: 3)"},"meta":{"dependsOn":{"left":"primary_diagnosis.lymph_nodes_examined_status","right":null},"notes":{"left":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":null},"range":{"left":{"min":0},"right":null}}},"number_lymph_nodes_positive":{"description":{"left":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: caDSR CDE ID 6113694)","right":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: NCI CDE ID: 6113694)"},"meta":{"dependsOn":{"left":"primary_diagnosis.lymph_nodes_examined_status","right":null},"notes":{"left":"This field is only required if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":null},"range":{"left":{"min":0},"right":null},"required":{"left":null,"right":true}}},"clinical_tumour_staging_system":{"meta":{"validationDependency":{"left":true,"right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(\n field =>\n Object.keys(convertedRow).includes(field) &&\n (!convertedRow[field] || checkforEmpty(convertedRow[field])),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"data":{"added":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"deleted":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"]}},"required":{"left":null,"right":true}}},"clinical_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":null,"data":{"added":[],"deleted":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"]}}}},"clinical_n_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"],"right":null,"data":{"added":[],"deleted":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"]}}}},"clinical_m_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned.","right":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned."},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":null,"data":{"added":[],"deleted":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"]}}}},"clinical_stage_group":{"description":{"left":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage.","right":"Stage group of the tumour, as assigned by the reporting tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.)."},"meta":{"notes":{"left":"This field is dependent on the selected clinical_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","right":null},"examples":{"left":"Stage I, Stage IIB","right":null}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"presenting_symptoms":{"meta":{"notes":{"left":"To include multiple values, separate values with a pipe delimiter '|' within your file.","right":null},"examples":{"left":"Anemia|Bloating|Diabetes","right":null}},"restrictions":{"codeList":{"left":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Loss of Appetite","Nausea","None","Not Reported","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Swelling in the Neck","Unknown","Vomiting","Weight Loss"],"right":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Nausea","None","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Unknown","Vomiting","Weight Loss"],"data":{"added":[],"deleted":["Loss of Appetite","Not Reported","Swelling in the Neck"]}}}},"performance_status":{"description":{"left":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status).","right":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference source: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status)."},"meta":{"notes":{"left":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction.\nGrade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work).\nGrade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours.\nGrade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours.\nGrade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair","right":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction \n Grade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work) \n Grade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours \n Grade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours \n Grade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair"}},"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"data":{"added":[],"deleted":["Unknown"]}}}}},"created":{"stage_suffix":{"changeType":"created","name":"stage_suffix","description":"If necessary, use this field to add any applicable stage suffixes. Stage suffixes may apply to certain staging systems such as Ann Arbour staging system where the four stages are divided into 4 categories (A, B, X and E).","valueType":"string","meta":{"core":true,"dependsOn":"primary_diagnosis.clinical_tumour_staging_system","displayName":"Stage Suffix"}}},"deleted":{"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Unique identifier of the primary diagnosis event, assigned by the data provider.","meta":{"primaryId":true,"displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"cancer_type_additional_information":{"changeType":"deleted","name":"cancer_type_additional_information","valueType":"string","description":"Additional details related to the cancer type that are not covered by the ICD-10 code provided in the cancer_type field.","meta":{"displayName":"Cancer Type Additional Information"}},"laterality":{"changeType":"deleted","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_status":{"changeType":"deleted","name":"lymph_nodes_examined_status","description":"Indicate if lymph nodes were examined for metastases.","valueType":"string","restrictions":{"required":true,"codeList":["Cannot be determined","No","No lymph nodes found in resected specimen","Not applicable","Yes"]},"meta":{"core":true,"displayName":"Lymph Nodes Examined Status"}},"lymph_nodes_examined_method":{"changeType":"deleted","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}}},"treatment":{"updated":{"treatment_type":{"meta":{"notes":{"left":"Depending on the treatment_type(s) selected, additional treatment details may be required to be submitted. For example, if treatment_type includes 'Chemotherapy', the supplemental Chemotherapy treatment type file is required.\nTo include multiple values, separate values with a pipe delimiter '|' within your file.","right":"Depending on the treatment_type selected, additional treament details may be required to be submitted."},"examples":{"left":"Chemotherapy|Hormonal therapy","right":null}},"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Chemotherapy","Ablation","Bone marrow transplant","Combined chemo+immunotherapy","Combined chemo+radiation therapy","Combined chemo-radiotherapy and surgery","Endoscopic therapy","Hormonal therapy","Immunotherapy","Monoclonal antibodies (for liquid tumours)","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgical resection"],"data":{"added":["Combined chemo+immunotherapy","Combined chemo+radiation therapy","Combined chemo-radiotherapy and surgery","Monoclonal antibodies (for liquid tumours)","Surgical resection"],"deleted":["End of life care","Surgery"]}}}},"is_primary_treatment":{"description":{"left":"Indicate if the treatment was the primary treatment following the initial diagnosis.","right":"Indicate if the treamtment was the primary treatment following the initial diagnosis."},"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"codeList":{"left":["Yes","No"],"right":["Yes","No","Unknown"],"data":{"added":["Unknown"],"deleted":[]}},"required":{"left":null,"right":true}}},"treatment_start_interval":{"description":{"left":"The interval between the primary diagnosis and initiation of treatment, in days.","right":"The interval between primary diagnosis and initiation of treatment, in days."},"meta":{"notes":{"left":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":"The associated Primary Diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis"},"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"treatment_duration":{"description":{"left":"The duration of treatment regimen, in days.","right":"The duration of treatment regimen, in days"},"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null},"required":{"left":null,"right":true}}}},"created":{"age_at_consent_for_treatment":{"changeType":"created","name":"age_at_consent_for_treatment","description":"Indicate the age of donor when consent was given for treatment.","valueType":"integer","meta":{"displayName":"Age At Consent For Treatment"}},"therapeutic_intent":{"changeType":"created","name":"therapeutic_intent","description":"The therapeutic intent, the reason behind the choice of a therapy, of the treatment.","valueType":"string","restrictions":{"required":true,"codeList":["Adjuvant","Concurrent","Curative","Neoadjuvant","Not applicable","Palliative","Unknown"]},"meta":{"core":true,"displayName":"Therapeutic Intent"}},"response_to_therapy":{"changeType":"created","name":"response_to_therapy","description":"The donors's response to the applied treatment regimen. (Source: RECIST)","valueType":"string","restrictions":{"required":true,"codeList":["Complete response","Disease progression","NED","Partial response","Stable disease"]},"meta":{"core":true,"displayName":"Response to Therapy"}}},"deleted":{"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate the primary diagnosis event in the clinical timeline that this treatment was related to.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"line_of_treatment":{"changeType":"deleted","name":"line_of_treatment","description":"Indicate the line of treatment if it is not the primary treatment.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Line Of treatment","dependsOn":"treatment.is_primary_treatment","examples":"2,3,4"}},"days_per_cycle":{"changeType":"deleted","name":"days_per_cycle","description":"Indicate the number of days in a treatment cycle.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Days Per Cycle","dependsOn":"treatment.treatment_type"}},"number_of_cycles":{"changeType":"deleted","name":"number_of_cycles","description":"Indicate the number of treatment cycles.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Number Of Cycles","dependsOn":"treatment.treatment_type"}},"treatment_intent":{"changeType":"deleted","name":"treatment_intent","description":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"]},"meta":{"core":true,"displayName":"Treatment Intent","dependsOn":"treatment.treatment_type"}},"treatment_setting":{"changeType":"deleted","name":"treatment_setting","description":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: NCIt C124308)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"]},"meta":{"core":true,"displayName":"Treatment Setting","dependsOn":"treatment.treatment_type"}},"response_to_treatment_criteria_method":{"changeType":"deleted","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},"response_to_treatment":{"changeType":"deleted","name":"response_to_treatment","description":"The donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"codeList":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"]},"meta":{"core":true,"displayName":"Response To Treatment","dependsOn":"treatment.response_to_treatment_criteria_method","notes":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"outcome_of_treatment":{"changeType":"deleted","name":"outcome_of_treatment","description":"Indicate the donor's outcome of the prescribed treatment.","valueType":"string","restrictions":{"codeList":["Treatment completed as prescribed","Treatment incomplete due to technical or organizational problems","Treatment incomplete because patient died","Patient choice (stopped or interrupted treatment)","Physician decision (stopped or interrupted treatment)","Treatment stopped due to lack of efficacy (disease progression)","Treatment stopped due to acute toxicity","Other","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Outcome Of Treatment","dependsOn":"treatment.treatment_type"}},"toxicity_type":{"changeType":"deleted","name":"toxicity_type","description":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity.","valueType":"string","restrictions":{"codeList":["Hematological","Non-hematological","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Toxicity Type","dependsOn":"treatment.outcome_of_treatment"}},"hematological_toxicity":{"changeType":"deleted","name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"non-hematological_toxicity":{"changeType":"deleted","name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"adverse_events":{"changeType":"deleted","name":"adverse_events","description":"Report any treatment related adverse events. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Adverse Events","dependsOn":"treatment.treatment_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"clinical_trials_database":{"changeType":"deleted","name":"clinical_trials_database","description":"If the donor is a participant in a clinical trial, indicate the clinical trial database where the clinical trial is registered.","valueType":"string","meta":{"display name":"Clinical Trials Database","notes":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added."},"restrictions":{"codeList":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"]}},"clinical_trial_number":{"changeType":"deleted","name":"clinical_trial_number","description":"Based on the clinical_trial_database, indicate the unique NCT or EudraCT clinical trial identifier of which the donor is a participant.","valueType":"string","meta":{"display name":"Clinical Trial Number","dependsOn":"treatment.clinical_trials_database","examples":"2016-002120-83,NCT02465060"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"]}}}},"chemotherapy":{"updated":{"drug_rxnormcui":{"meta":{"dependsOn":{"left":"chemotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses a controlled vocabulary gathered from the RxNorm database of drug names provided by the NIH (https://www.nlm.nih.gov/research/umls/rxnorm)."}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"description":{"left":"Name of agent or drug administered to donor as part of the treatment regimen.","right":"Name of agent or drug administered to patient as part of the treatment regimen."},"meta":{"dependsOn":{"left":"chemotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses a controlled vocabulary gathered from the RxNorm database of drug names provided by the NIH (https://www.nlm.nih.gov/research/umls/rxnorm)."}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"chemotherapy_dosage_units":{"changeType":"created","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","µg/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate the total drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"integer","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"deleted","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"deleted","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"deleted","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"deleted","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}}},"hormone_therapy":{"updated":{"drug_rxnormcui":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses a controlled vocabulary gathered from the RxNorm database of drug names provided by the NIH (https://www.nlm.nih.gov/research/umls/rxnorm)."}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"description":{"left":"Name of agent or drug administered to donor as part of the treatment regimen.","right":"Name of agent or drug administered to patient as part of the treatment regimen."},"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses a controlled vocabulary gathered from the RxNorm database of drug names provided by the NIH (https://www.nlm.nih.gov/research/umls/rxnorm)."}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"hormone_drug_dosage_units":{"changeType":"created","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","µg/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"integer","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dose"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"deleted","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"radiation":{"updated":{"radiation_therapy_fractions":{"description":{"left":"Indicate the total number of fractions delivered as part of treatment.","right":"Indicate the number of total fractions delivered as part of treatment."},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"radiation_therapy_dosage":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"anatomical_site_irradiated":{"description":{"left":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)","right":"Indicate localization site where radiation therapy was administered."},"restrictions":{"codeList":{"left":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"right":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"data":{"added":["Bone","Extremities","Head-Neck","Peritoneum"],"deleted":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"]}}}}},"created":{"application_form":{"changeType":"created","name":"application_form","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal (including Brachytherapy)"]},"meta":{"core":true,"displayName":"Application Form"}}},"deleted":{"radiation_therapy_type":{"changeType":"deleted","name":"radiation_therapy_type","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal"]},"meta":{"core":true,"displayName":"Type of Radiation Therapy","notes":"Internal application includes Brachytherapy."}},"radiation_boost":{"changeType":"deleted","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"deleted","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}}},"immunotherapy":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"immunotherapy_type":{"changeType":"deleted","name":"immunotherapy_type","valueType":"string","description":"Indicate the type of immunotherapy administered to donor.","meta":{"displayName":"Immunotherapy Type","core":true},"restrictions":{"required":true,"codeList":["Cell-based","Immune checkpoint inhibitors","Monoclonal antibodies other than immune checkpoint inhibitors","Other immunomodulatory substances"]}},"drug_rxnormcui":{"changeType":"deleted","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"deleted","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"deleted","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"surgery":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"deleted","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"deleted","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"deleted","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"deleted","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"deleted","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"deleted","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"deleted","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"deleted","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"deleted","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"deleted","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"deleted","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"deleted","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"deleted","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"deleted","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}}},"follow_up":{"updated":{"submitter_follow_up_id":{"description":{"left":"Unique identifier for a follow-up event in a donor's clinical record, assigned by the data provider.","right":"Unique identifier for a follow-up event in a donors clincal record, assigned by the data provider."}},"interval_of_followup":{"meta":{"notes":{"left":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":"The associated Primary Diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}}},"disease_status_at_followup":{"description":{"left":"Indicate the donor's disease status at time of follow-up. (Reference: RECIST)","right":"Indicate the donor's disease status at time of follow-up."},"restrictions":{"codeList":{"left":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Progression NOS","Relapse or recurrence","Stable"],"right":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Relapse","Stable"],"data":{"added":["Relapse"],"deleted":["Progression NOS","Relapse or recurrence"]}}}},"weight_at_followup":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"relapse_type":{"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.","right":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse."}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":null}}},"relapse_interval":{"description":{"left":"If the donor was clinically disease free following primary treatment and then relapse or recurrence or progression (for liquid tumours) occurred afterwards, then this field will indicate the length of disease free interval, in days.","right":"If the donor was clinically disease free following primary treatment and then relapse or progression (for liquid tumours) occurred afterwards, then this field will indicate the length of disease free interval, in days."},"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.","right":"This field is required to be submitted if disease_status_at_followup indicates a progression or relapse value."}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"]}}},"method_of_progression_status":{"description":{"left":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Reference: caDSR CDE ID 6161031)","right":"Indicate the method(s) used to confirm the donor's progression disease status. (Codelist reference: NCI CDE ID: 6161031)"},"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file.","right":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"]},"codeList":{"left":["Biomarker in liquid biopsy (e.g. tumour marker in blood or urine)","Biopsy","Blood draw","Bone marrow aspirate","Core biopsy","Cystoscopy","Cytology","Debulking","Diagnostic imaging","Dilation and curettage procedure","Enucleation","Excisional biopsy","Fine needle aspiration","Imaging","Incisional biopsy","Laparoscopy","Laparotomy","Other","Pap Smear","Pathologic review","Physical exam","Surgical resection","Thoracentesis","Ultrasound guided biopsy"],"right":["Autopsy","Biomarker in liquid biopsy (e.g. tumour marker in blood or urine)","Biopsy","Blood draw","Bone marrow aspirate","Core biopsy","Cystoscopy","Cytology","Debulking","Diagnostic imaging","Dilation and curettage procedure","Enucleation","Excisional biopsy","Fine needle aspiration","Imaging","Incisional biopsy","Laparoscopy","Laparotomy","Other","Pap Smear","Pathologic review","Physical exam","Surgical resection","Thoracentesis","Ultrasound guided biopsy"],"data":{"added":["Autopsy"],"deleted":[]}}}},"recurrence_tumour_staging_system":{"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.","right":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse."},"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"data":{"added":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"deleted":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(\n field =>\n Object.keys(convertedRow).includes(field) &&\n (!convertedRow[field] || checkforEmpty(convertedRow[field])),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"]}}},"recurrence_t_category":{"description":{"left":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":null,"data":{"added":[],"deleted":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"]}}}},"recurrence_n_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"],"right":null,"data":{"added":[],"deleted":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"]}}}},"recurrence_m_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":null,"data":{"added":[],"deleted":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"]}}}},"recurrence_stage_group":{"description":{"left":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) at the time of retreatment for a recurrence or disease progression.","right":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery."},"meta":{"notes":{"left":"This field is dependent on the selected recurrence_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","right":null},"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":null,"data":{"added":[],"deleted":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":null}}},"posttherapy_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(\n field =>\n Object.keys(convertedRow).includes(field) &&\n (!convertedRow[field] || checkforEmpty(convertedRow[field])),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"data":{"added":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"deleted":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"]}}}},"posttherapy_t_category":{"meta":{"dependsOn":{"left":"follow_up.posttherapy_tumour_staging_system","right":"follow_up.post_therapy_tumour_staging_system"}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":null,"data":{"added":[],"deleted":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"]}}}},"posttherapy_n_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"dependsOn":{"left":"follow_up.posttherapy_tumour_staging_system","right":"follow_up.post_therapy_tumour_staging_system"}},"restrictions":{"codeList":{"left":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"],"right":null,"data":{"added":[],"deleted":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"]}}}},"posttherapy_m_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"dependsOn":{"left":"follow_up.posttherapy_tumour_staging_system","right":"follow_up.post_therapy_tumour_staging_system"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":null,"data":{"added":[],"deleted":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"]}}}},"posttherapy_stage_group":{"meta":{"dependsOn":{"left":"follow_up.posttherapy_tumour_staging_system","right":"follow_up.post_therapy_tumour_staging_system"},"notes":{"left":"This field is dependent on the selected posttherapy_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","right":"This field value is dependent on the selected posttherapy_tumour_staging_system."}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":null,"data":{"added":[],"deleted":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":null}}}},"created":{"anatomic_site_progression_or_recurrences":{"changeType":"created","description":"Indicate the anatomic site where disease progression or recurrence occurred. (Codelist reference: NCI CDE ID: 4742851)","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"],"codeList":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear - pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal - distal","Esophageal - mid","Esophageal - proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es) - maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"]},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","notes":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse.","displayName":"Anatomic Site Progression or Recurrences"}}},"deleted":{"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate if the follow-up is related to a specific primary diagnosis event in the clinical timeline.","meta":{"validationDependency":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID","primaryId":true},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"Indicate if the follow-up is related to a specific treatment event in the clinical timeline.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"anatomic_site_progression_or_recurrence":{"changeType":"deleted","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"exposure":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"deleted","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"deleted","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"deleted","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"deleted","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"deleted","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"deleted","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"deleted","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"deleted","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"deleted","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"deleted","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"deleted","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}}},"family_history":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"family_relative_id":{"changeType":"deleted","description":"Unique identifier of the relative, assigned by the data provider.","name":"family_relative_id","valueType":"string","meta":{"displayName":"Family Relative ID","primaryId":true,"notes":"This field is required to ensure that family members are identified in unique records. Ids can be as simple as an incremented numeral to ensure uniqueness."},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"relative_with_cancer_history":{"changeType":"deleted","description":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","name":"relative_with_cancer_history","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Relative with Cancer History"}},"relationship_type":{"changeType":"deleted","description":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","name":"relationship_type","restrictions":{"codeList":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"]},"valueType":"string","meta":{"displayName":"Relationship Type"}},"gender_of_relative":{"changeType":"deleted","description":"The self-reported gender of related individual.","name":"gender_of_relative","restrictions":{"codeList":["Female","Male","Other","Unknown"]},"valueType":"string","meta":{"displayName":"Gender of Relative"}},"age_of_relative_at_diagnosis":{"changeType":"deleted","description":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","name":"age_of_relative_at_diagnosis","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","displayName":"Age Of Relative At Diagnosis"}},"cancer_type_code_of_relative":{"changeType":"deleted","name":"cancer_type_code_of_relative","valueType":"string","description":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"examples":"C41.1,C16.9,C00.5,D46.9","dependsOn":"family_history.relative_with_cancer_history","displayName":"Cancer Type Code (ICD-10) of Relative"}},"relative_vital_status":{"changeType":"deleted","description":"Relative's last known state of living or deceased.","name":"relative_vital_status","restrictions":{"codeList":["Alive","Deceased","Unknown"]},"valueType":"string","meta":{"displayName":"Vital Status of Relative"}},"cause_of_death_of_relative":{"changeType":"deleted","description":"Indicate the cause of the death of the relative.","name":"cause_of_death_of_relative","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]},"valueType":"string","meta":{"dependsOn":"family_history.relative_vital_status","displayName":"Cause of Death of Relative"}},"relative_survival_time":{"changeType":"deleted","description":"Indicate how long, in days, the relative survived from the time they were diagnosed with cancer.","name":"relative_survival_time","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","units":"days","displayName":"Survival Time Of Relative"}}}},"biomarker":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"deleted","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"deleted","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"deleted","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"deleted","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"deleted","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"deleted","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"deleted","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"deleted","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"deleted","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"deleted","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"deleted","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"deleted","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"deleted","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"deleted","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"deleted","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"deleted","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}}},"comorbidity":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"deleted","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"deleted","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"deleted","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"deleted","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"deleted","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"deleted","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}}}}} diff --git a/scripts/data/schemas/diffs/1.24/1.24-diff-0.12.json b/scripts/data/schemas/diffs/1.24/1.24-diff-0.12.json new file mode 100644 index 00000000..38d60143 --- /dev/null +++ b/scripts/data/schemas/diffs/1.24/1.24-diff-0.12.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"program_id":{"meta":{"examples":{"left":"TEST-CA","right":"PACA-AU,BR-CA"},"notes":{"left":"This is the unique id that is assigned to your program. If you have logged into the platform, this is the Program Id that you see in the Program Services area. For example, TEST-CA is a Program ID.","right":"This is the unique id that is assigned to your program. If you have logged into the platform, this is the Program Id that you see in the Submission area. For example, PACA-CA is a Program ID."}}},"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"gender":{},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"specimen_tissue_source":{},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Normal","Normal - tissue adjacent to primary tumour","Primary tumour","Primary tumour - adjacent to normal","Primary tumour - additional new primary","Recurrent tumour","Metastatic tumour","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour - additional metastatic","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line","Cell line - derived from xenograft tumour","Cell line - derived from tumour","Cell line - derived from normal"],"data":{"added":[],"deleted":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n\n const row = $row;\n let result = {valid: true, message: \"Ok\"};\n \n const designation = row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\"){\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when tumour_normal_designation is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when tumour_normal_designation is set to Tumour.\"};\n }\n }\n return result;\n })()"]}}},"submitter_sample_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"sample_type":{}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased"],"right":["Alive","Deceased","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"cause_of_death":{"restrictions":{"codeList":{"left":["Died of cancer","Died of other reasons","Unknown"],"right":["Died of cancer","Died of other reasons"],"data":{"added":[],"deleted":["Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })()"]}}},"survival_time":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })()"]},"range":{"left":{"exclusiveMin":0},"right":null}}},"primary_site":{"meta":{"notes":{"left":"To include multiple values, separate values with a pipe delimiter '|' within your file.","right":null},"examples":{"left":"Breast|Ovary","right":null}},"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva","Unknown","Not Reported"],"data":{"added":["Unknown","Not Reported"],"deleted":["Unknown primary site"]}}}},"height":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"weight":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"bmi":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"menopause_status":{"description":{"left":"Indicate the donor's menopause status at the time of primary diagnosis. (Reference: caDSR CDE ID 2434914)","right":"Indicate the donor's menopause status at the time of primary diagnosis. (Codelist reference: NCI CDE ID: 2434914)"},"restrictions":{"codeList":{"left":["Not applicable","Perimenopausal","Postmenopausal","Premenopausal","Unknown"],"right":["Indeterminate or unknown","Not applicable","Perimenopausal","Postmenopausal","Premenopausal"],"data":{"added":["Indeterminate or unknown"],"deleted":["Unknown"]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)","right":"Indicate the donor's age of menarche, the first occurrence of menstruation."},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"number_of_pregnancies":{"description":{"left":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)","right":"Indicate the number of pregnancies a donor has had."},"restrictions":{"range":{"left":{"min":0},"right":null}}},"number_of_children":{"description":{"left":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)","right":"Indicate the number of children the donor has birthed."},"restrictions":{"range":{"left":{"min":0},"right":null}}}},"created":{"prior_malignancy":{"changeType":"created","description":"Prior malignancy affecting donor.","name":"prior_malignancy","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy","examples":"C41.1, C16.9, C00.5, D46.9"}},"cancer_type_prior_malignancy":{"changeType":"created","description":"The code to represent the cancer type of a prior malignancy using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","name":"cancer_type_prior_malignancy","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"valueType":"string","meta":{"displayName":"Cancer Type Prior Malignancy"}},"age_at_prior_malignancy":{"changeType":"created","description":"If donor has history of prior malignancy, indicate age at previous diagnosis, in years.","name":"age_at_prior_malignancy","valueType":"integer","meta":{"displayName":"Age at Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"created","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis.","name":"laterality_of_prior_malignancy","valueType":"string","meta":{"displayName":"Laterality at Prior Malignancy"}}},"deleted":{"genetic_disorders":{"changeType":"deleted","description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},"hrt_type":{"changeType":"deleted","description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},"hrt_duration":{"changeType":"deleted","description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},"contraception_type":{"changeType":"deleted","description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},"contraception_duration":{"changeType":"deleted","description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},"lost_to_followup_after_clinical_event_id":{"changeType":"deleted","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}}},"specimen":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"description":{"left":"Indicate the primary diagnosis event in the clinical timeline that this specimen acquisition was related to.","right":"Indicate the primary diagnosis event in the clinical timeline that this specimen aquisition was related to."},"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"pathological_tumour_staging_system":{"meta":{"validationDependency":{"left":true,"right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"data":{"added":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"deleted":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"]}}}},"pathological_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":null,"data":{"added":[],"deleted":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"]}}}},"pathological_n_category":{"restrictions":{"codeList":{"left":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"],"right":null,"data":{"added":[],"deleted":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"]}}}},"pathological_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":null,"data":{"added":[],"deleted":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"]}}}},"pathological_stage_group":{"description":{"left":"Specify the tumour stage, based on pathological_tumour_staging_system, used to assess the cancer at the time the tumour specimen was resected.","right":"Specify the tumour stage, based on tumour_staging_system, used to assess the cancer at the time the tumour specimen was resected."},"meta":{"notes":{"left":"This field depends on the selected pathological_tumour_staging_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","right":"This field depends on the selected pathological staging system, and is only required if the specimen is a tumour."}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":null,"data":{"added":[],"deleted":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":null}}},"specimen_acquisition_interval":{"meta":{"notes":{"left":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":"The associated Primary Diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."},"displayName":{"left":"Specimen Acquisition Interval","right":"Specimen Aquisition Interval"}}},"tumour_histological_type":{"description":{"left":"The code to represent the histology (morphology) of neoplasms that is usually obtained from a pathology report, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","right":"The code to represent the histology (morphology) of neoplasms that is usually obtained from a pathology report, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Please refer to the guidelines provided in the ICD-O-3 manual at https://apps.who.int/iris/handle/10665/42344."},"meta":{"validationDependency":{"left":true,"right":null}}},"specimen_anatomic_location":{"description":{"left":"Indicate the ICD-O-3 topography code for the anatomic location of a specimen when it was collected. Refer to the guidelines provided in the ICD-O-3 manual at https://apps.who.int/iris/handle/10665/42344.","right":"Anatomic location of a specimen when it was collected."},"meta":{"examples":{"left":"C50.1,C18","right":null}},"restrictions":{"regex":{"left":"^[C][0-9]{2}(.[0-9]{1})?$","right":null},"codeList":{"right":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear - pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal - distal","Esophageal - mid","Esophageal - proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es) - maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"],"data":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear - pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal - distal","Esophageal - mid","Esophageal - proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es) - maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"]}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"data":{"added":[],"deleted":["Unknown"]}}}},"specimen_storage":{"description":{"left":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured.","right":"Indicate the method of specimen storage for specimens that were not extracted freshly or immediately cultured."},"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"data":{"added":[],"deleted":["Unknown"]}}}},"tumour_grading_system":{"meta":{"validationDependency":{"left":true,"right":null}}},"tumour_grade":{"meta":{"notes":{"left":"This field depends on the selected tumour_grading_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Grading Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-grading-classifications","right":"This field depends on the selected tumour grading system, and is only required if the specimen is a tumour."}},"restrictions":{"codeList":{"left":["Low grade","High grade","GX","G1","G2","G3","G4","Low","High","Grade I","Grade II","Grade III","Grade IV","Grade Group 1","Grade Group 2","Grade Group 3","Grade Group 4","Grade Group 5"],"right":["Low grade","High grade","GX","G1","G2","G3","G4","Low","High","I","II","III","IV","1","2","3","4","5"],"data":{"added":["I","II","III","IV","1","2","3","4","5"],"deleted":["Grade I","Grade II","Grade III","Grade IV","Grade Group 1","Grade Group 2","Grade Group 3","Grade Group 4","Grade Group 5"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'i',\n 'ii',\n 'iii',\n 'iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n '1',\n '2',\n '3',\n '4',\n '5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })()"]}}},"percent_tumour_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)","right":"Indicate a value, in decimals, that represents the percentage of infiltration by tumour cells in a specimen."},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null},"script":{"left":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"],"right":null}}},"percent_proliferating_cells":{"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_inflammatory_tissue":{"description":{"left":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)","right":"Indicate a value, in decimals, that represents local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_stromal_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)","right":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a malignant tumour specimen but are not malignant such as fibroblasts, vascular structures, etc."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_necrosis":{"description":{"left":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)","right":"Indicate a value, in decimals, that represents the percentage of cell death in a malignant tumour specimen."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}}},"created":{"central_pathology_confirmed":{"changeType":"created","name":"central_pathology_confirmed","description":"Indicate whether the histologic description of tissue or cells was confirmed by a pathology review of frozen or formalin fixed slide(s) completed after the diagnostic pathology review of the tumour sample used to extract analyte(s).","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Central Pathology Confirmed"},"restrictions":{"codeList":["Yes","No","Unknown"]}}},"deleted":{"specimen_laterality":{"changeType":"deleted","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"reference_pathology_confirmed":{"changeType":"deleted","name":"reference_pathology_confirmed","description":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)","valueType":"string","meta":{"validationDependency":true,"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Reference Pathology Confirmed"},"restrictions":{"codeList":["Yes","No","Unknown"]}},"percent_tumour_cells_measurement_method":{"changeType":"deleted","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"age_at_diagnosis":{"description":{"left":"Age that the donor was first diagnosed with cancer, in years. This should be based on the earliest diagnosis of cancer.","right":"Age that the donor was first diagnosed with cancer, in years."},"restrictions":{"range":{"left":{"exclusiveMin":0,"max":90},"right":null}}},"basis_of_diagnosis":{},"number_lymph_nodes_examined":{"description":{"left":"The total number of lymph nodes tested for the presence of cancer. (Reference: caDSR CDE ID 3)","right":"The total number of lymph nodes tested for the presence of cancer. (Reference: NCI CDE ID: 3)"},"meta":{"dependsOn":{"left":"primary_diagnosis.lymph_nodes_examined_status","right":null},"notes":{"left":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":null},"range":{"left":{"min":0},"right":null}}},"number_lymph_nodes_positive":{"description":{"left":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: caDSR CDE ID 6113694)","right":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: NCI CDE ID: 6113694)"},"meta":{"dependsOn":{"left":"primary_diagnosis.lymph_nodes_examined_status","right":null},"notes":{"left":"This field is only required if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":null},"range":{"left":{"min":0},"right":null},"required":{"left":null,"right":true}}},"clinical_tumour_staging_system":{"meta":{"validationDependency":{"left":true,"right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"data":{"added":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"deleted":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"]}},"required":{"left":null,"right":true}}},"clinical_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":null,"data":{"added":[],"deleted":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"]}}}},"clinical_n_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"],"right":null,"data":{"added":[],"deleted":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"]}}}},"clinical_m_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned.","right":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned."},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":null,"data":{"added":[],"deleted":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"]}}}},"clinical_stage_group":{"description":{"left":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage.","right":"Stage group of the tumour, as assigned by the reporting tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.)."},"meta":{"notes":{"left":"This field is dependent on the selected clinical_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","right":null},"examples":{"left":"Stage I, Stage IIB","right":null}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"presenting_symptoms":{"meta":{"notes":{"left":"To include multiple values, separate values with a pipe delimiter '|' within your file.","right":"To include multiple values, separate values with a comma ',' within your file."},"examples":{"left":"Anemia|Bloating|Diabetes","right":"Anemia,Bloating,Diabetes"}},"restrictions":{"codeList":{"left":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Loss of Appetite","Nausea","None","Not Reported","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Swelling in the Neck","Unknown","Vomiting","Weight Loss"],"right":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Nausea","None","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Unknown","Vomiting","Weight Loss"],"data":{"added":[],"deleted":["Loss of Appetite","Not Reported","Swelling in the Neck"]}}}},"performance_status":{"description":{"left":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status).","right":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference source: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status)."},"meta":{"notes":{"left":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction.\nGrade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work).\nGrade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours.\nGrade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours.\nGrade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair","right":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction \n Grade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work) \n Grade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours \n Grade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours \n Grade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair"}},"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"data":{"added":[],"deleted":["Unknown"]}}}}},"created":{"stage_suffix":{"changeType":"created","name":"stage_suffix","description":"If necessary, use this field to add any applicable stage suffixes. Stage suffixes may apply to certain staging systems such as Ann Arbour staging system where the four stages are divided into 4 categories (A, B, X and E).","valueType":"string","meta":{"core":true,"dependsOn":"primary_diagnosis.clinical_tumour_staging_system","displayName":"Stage Suffix"}}},"deleted":{"cancer_type_additional_information":{"changeType":"deleted","name":"cancer_type_additional_information","valueType":"string","description":"Additional details related to the cancer type that are not covered by the ICD-10 code provided in the cancer_type field.","meta":{"displayName":"Cancer Type Additional Information"}},"laterality":{"changeType":"deleted","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_status":{"changeType":"deleted","name":"lymph_nodes_examined_status","description":"Indicate if lymph nodes were examined for metastases.","valueType":"string","restrictions":{"required":true,"codeList":["Cannot be determined","No","No lymph nodes found in resected specimen","Not applicable","Yes"]},"meta":{"core":true,"displayName":"Lymph Nodes Examined Status"}},"lymph_nodes_examined_method":{"changeType":"deleted","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}}},"treatment":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"treatment_type":{"meta":{"notes":{"left":"Depending on the treatment_type(s) selected, additional treatment details may be required to be submitted. For example, if treatment_type includes 'Chemotherapy', the supplemental Chemotherapy treatment type file is required.\nTo include multiple values, separate values with a pipe delimiter '|' within your file.","right":"Depending on the treatment_type selected, additional treament details may be required to be submitted. Depending on the treatment_type selected, additional treatment details may be required to be submitted. For example, if treatment_type includes 'Chemotherapy', the supplemental Chemotherapy treatment type file is required."},"examples":{"left":"Chemotherapy|Hormonal therapy","right":null}},"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Chemotherapy","Ablation","Bone marrow transplant","Combined chemo+immunotherapy","Combined chemo+radiation therapy","Combined chemo-radiotherapy and surgery","Endoscopic therapy","Hormonal therapy","Immunotherapy","Monoclonal antibodies (for liquid tumours)","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgical resection"],"data":{"added":["Combined chemo+immunotherapy","Combined chemo+radiation therapy","Combined chemo-radiotherapy and surgery","Monoclonal antibodies (for liquid tumours)","Surgical resection"],"deleted":["End of life care","Surgery"]}}}},"is_primary_treatment":{"description":{"left":"Indicate if the treatment was the primary treatment following the initial diagnosis.","right":"Indicate if the treamtment was the primary treatment following the initial diagnosis."},"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"codeList":{"left":["Yes","No"],"right":["Yes","No","Unknown"],"data":{"added":["Unknown"],"deleted":[]}},"required":{"left":null,"right":true}}},"treatment_start_interval":{"description":{"left":"The interval between the primary diagnosis and initiation of treatment, in days.","right":"The interval between primary diagnosis and initiation of treatment, in days."},"meta":{"notes":{"left":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":"The associated Primary Diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."},"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"treatment_duration":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null},"required":{"left":null,"right":true}}}},"created":{"age_at_consent_for_treatment":{"changeType":"created","name":"age_at_consent_for_treatment","description":"Indicate the age of donor when consent was given for treatment.","valueType":"integer","meta":{"displayName":"Age At Consent For Treatment"}},"therapeutic_intent":{"changeType":"created","name":"therapeutic_intent","description":"The therapeutic intent, the reason behind the choice of a therapy, of the treatment.","valueType":"string","restrictions":{"required":true,"codeList":["Adjuvant","Concurrent","Curative","Neoadjuvant","Not applicable","Palliative","Unknown"]},"meta":{"core":true,"displayName":"Therapeutic Intent"}},"response_to_therapy":{"changeType":"created","name":"response_to_therapy","description":"The donors's response to the applied treatment regimen. (Source: RECIST)","valueType":"string","restrictions":{"required":true,"codeList":["Complete response","Disease progression","NED","Partial response","Stable disease"]},"meta":{"core":true,"displayName":"Response to Therapy"}}},"deleted":{"line_of_treatment":{"changeType":"deleted","name":"line_of_treatment","description":"Indicate the line of treatment if it is not the primary treatment.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Line Of treatment","dependsOn":"treatment.is_primary_treatment","examples":"2,3,4"}},"days_per_cycle":{"changeType":"deleted","name":"days_per_cycle","description":"Indicate the number of days in a treatment cycle.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Days Per Cycle","dependsOn":"treatment.treatment_type"}},"number_of_cycles":{"changeType":"deleted","name":"number_of_cycles","description":"Indicate the number of treatment cycles.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Number Of Cycles","dependsOn":"treatment.treatment_type"}},"treatment_intent":{"changeType":"deleted","name":"treatment_intent","description":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"]},"meta":{"core":true,"displayName":"Treatment Intent","dependsOn":"treatment.treatment_type"}},"treatment_setting":{"changeType":"deleted","name":"treatment_setting","description":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: NCIt C124308)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"]},"meta":{"core":true,"displayName":"Treatment Setting","dependsOn":"treatment.treatment_type"}},"response_to_treatment_criteria_method":{"changeType":"deleted","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},"response_to_treatment":{"changeType":"deleted","name":"response_to_treatment","description":"The donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"codeList":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"]},"meta":{"core":true,"displayName":"Response To Treatment","dependsOn":"treatment.response_to_treatment_criteria_method","notes":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"outcome_of_treatment":{"changeType":"deleted","name":"outcome_of_treatment","description":"Indicate the donor's outcome of the prescribed treatment.","valueType":"string","restrictions":{"codeList":["Treatment completed as prescribed","Treatment incomplete due to technical or organizational problems","Treatment incomplete because patient died","Patient choice (stopped or interrupted treatment)","Physician decision (stopped or interrupted treatment)","Treatment stopped due to lack of efficacy (disease progression)","Treatment stopped due to acute toxicity","Other","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Outcome Of Treatment","dependsOn":"treatment.treatment_type"}},"toxicity_type":{"changeType":"deleted","name":"toxicity_type","description":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity.","valueType":"string","restrictions":{"codeList":["Hematological","Non-hematological","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Toxicity Type","dependsOn":"treatment.outcome_of_treatment"}},"hematological_toxicity":{"changeType":"deleted","name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"non-hematological_toxicity":{"changeType":"deleted","name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"adverse_events":{"changeType":"deleted","name":"adverse_events","description":"Report any treatment related adverse events. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Adverse Events","dependsOn":"treatment.treatment_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"clinical_trials_database":{"changeType":"deleted","name":"clinical_trials_database","description":"If the donor is a participant in a clinical trial, indicate the clinical trial database where the clinical trial is registered.","valueType":"string","meta":{"display name":"Clinical Trials Database","notes":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added."},"restrictions":{"codeList":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"]}},"clinical_trial_number":{"changeType":"deleted","name":"clinical_trial_number","description":"Based on the clinical_trial_database, indicate the unique NCT or EudraCT clinical trial identifier of which the donor is a participant.","valueType":"string","meta":{"display name":"Clinical Trial Number","dependsOn":"treatment.clinical_trials_database","examples":"2016-002120-83,NCT02465060"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"]}}}},"chemotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"dependsOn":{"left":"chemotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses a controlled vocabulary gathered from the RxNorm database of drug names provided by the NIH (https://www.nlm.nih.gov/research/umls/rxnorm)."}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"description":{"left":"Name of agent or drug administered to donor as part of the treatment regimen.","right":"Name of agent or drug administered to patient as part of the treatment regimen."},"meta":{"dependsOn":{"left":"chemotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses a controlled vocabulary gathered from the RxNorm database of drug names provided by the NIH (https://www.nlm.nih.gov/research/umls/rxnorm)."}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"chemotherapy_dosage_units":{"changeType":"created","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate the total drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"deleted","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"deleted","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"deleted","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"deleted","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses a controlled vocabulary gathered from the RxNorm database of drug names provided by the NIH (https://www.nlm.nih.gov/research/umls/rxnorm)."}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"description":{"left":"Name of agent or drug administered to donor as part of the treatment regimen.","right":"Name of agent or drug administered to patient as part of the treatment regimen."},"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses a controlled vocabulary gathered from the RxNorm database of drug names provided by the NIH (https://www.nlm.nih.gov/research/umls/rxnorm)."}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"hormone_drug_dosage_units":{"changeType":"created","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"deleted","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"radiation":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"radiation_therapy_fractions":{"description":{"left":"Indicate the total number of fractions delivered as part of treatment.","right":"Indicate the number of total fractions delivered as part of treatment."},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"radiation_therapy_dosage":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"anatomical_site_irradiated":{"description":{"left":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)","right":"Indicate localization site where radiation therapy was administered."},"restrictions":{"codeList":{"left":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"right":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"data":{"added":["Bone","Extremities","Head-Neck","Peritoneum"],"deleted":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"]}}}}},"created":{"application_form":{"changeType":"created","name":"application_form","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal"]},"meta":{"core":true,"displayName":"Application Form","notes":"Internal application includes Brachytherapy."}}},"deleted":{"radiation_therapy_type":{"changeType":"deleted","name":"radiation_therapy_type","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal"]},"meta":{"core":true,"displayName":"Type of Radiation Therapy","notes":"Internal application includes Brachytherapy."}},"radiation_boost":{"changeType":"deleted","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"deleted","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}}},"immunotherapy":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"immunotherapy_type":{"changeType":"deleted","name":"immunotherapy_type","valueType":"string","description":"Indicate the type of immunotherapy administered to donor.","meta":{"displayName":"Immunotherapy Type","core":true},"restrictions":{"required":true,"codeList":["Cell-based","Immune checkpoint inhibitors","Monoclonal antibodies other than immune checkpoint inhibitors","Other immunomodulatory substances"]}},"drug_rxnormcui":{"changeType":"deleted","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"deleted","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"deleted","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"surgery":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"deleted","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"deleted","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"deleted","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"deleted","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"deleted","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"deleted","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"deleted","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"deleted","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"deleted","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"deleted","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"deleted","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"deleted","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"deleted","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"deleted","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}}},"follow_up":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_follow_up_id":{"description":{"left":"Unique identifier for a follow-up event in a donor's clinical record, assigned by the data provider.","right":"Unique identifier for a follow-up event in a donors clincal record, assigned by the data provider."},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"interval_of_followup":{"meta":{"notes":{"left":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":"The associated Primary Diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}}},"disease_status_at_followup":{"description":{"left":"Indicate the donor's disease status at time of follow-up. (Reference: RECIST)","right":"Indicate the donor's disease status at time of follow-up."},"restrictions":{"codeList":{"left":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Progression NOS","Relapse or recurrence","Stable"],"right":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Relapse","Stable"],"data":{"added":["Relapse"],"deleted":["Progression NOS","Relapse or recurrence"]}}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"treatment.submitter_treatment_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"weight_at_followup":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"relapse_type":{"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.","right":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse."}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":null}}},"relapse_interval":{"description":{"left":"If the donor was clinically disease free following primary treatment and then relapse or recurrence or progression (for liquid tumours) occurred afterwards, then this field will indicate the length of disease free interval, in days.","right":"If the donor was clinically disease free following primary treatment and then relapse or progression (for liquid tumours) occurred afterwards, then this field will indicate the length of disease free interval, in days."},"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.","right":"This field is required to be submitted if disease_status_at_followup indicates a progression or relapse value."}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"]}}},"method_of_progression_status":{"description":{"left":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Reference: caDSR CDE ID 6161031)","right":"Indicate the method(s) used to confirm the donor's progression disease status. (Codelist reference: NCI CDE ID: 6161031)"},"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file.","right":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"]}}},"recurrence_tumour_staging_system":{"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.","right":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse."},"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"data":{"added":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"deleted":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"]}}},"recurrence_t_category":{"description":{"left":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":null,"data":{"added":[],"deleted":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"]}}}},"recurrence_n_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"],"right":null,"data":{"added":[],"deleted":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"]}}}},"recurrence_m_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":null,"data":{"added":[],"deleted":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"]}}}},"recurrence_stage_group":{"description":{"left":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) at the time of retreatment for a recurrence or disease progression.","right":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery."},"meta":{"notes":{"left":"This field is dependent on the selected recurrence_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","right":null},"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":null,"data":{"added":[],"deleted":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":null}}},"posttherapy_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"data":{"added":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"deleted":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"]}}}},"posttherapy_t_category":{"meta":{"dependsOn":{"left":"follow_up.posttherapy_tumour_staging_system","right":"follow_up.post_therapy_tumour_staging_system"}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":null,"data":{"added":[],"deleted":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"]}}}},"posttherapy_n_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"dependsOn":{"left":"follow_up.posttherapy_tumour_staging_system","right":"follow_up.post_therapy_tumour_staging_system"}},"restrictions":{"codeList":{"left":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"],"right":null,"data":{"added":[],"deleted":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"]}}}},"posttherapy_m_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"dependsOn":{"left":"follow_up.posttherapy_tumour_staging_system","right":"follow_up.post_therapy_tumour_staging_system"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":null,"data":{"added":[],"deleted":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"]}}}},"posttherapy_stage_group":{"meta":{"dependsOn":{"left":"follow_up.posttherapy_tumour_staging_system","right":"follow_up.post_therapy_tumour_staging_system"},"notes":{"left":"This field is dependent on the selected posttherapy_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","right":"This field is required only if the selected posttherapy_tumour_staging_system is any edition of the AJCC cancer staging system."}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":null,"data":{"added":[],"deleted":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":null}}}},"created":{"anatomic_site_progression_or_recurrences":{"changeType":"created","description":"Indicate the anatomic site where disease progression or recurrence occurred. (Codelist reference: NCI CDE ID: 4742851)","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"],"codeList":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear - pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal - distal","Esophageal - mid","Esophageal - proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es) - maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"]},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","notes":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse.","displayName":"Anatomic Site Progression or Recurrences"}}},"deleted":{"anatomic_site_progression_or_recurrence":{"changeType":"deleted","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"exposure":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"deleted","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"deleted","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"deleted","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"deleted","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"deleted","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"deleted","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"deleted","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"deleted","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"deleted","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"deleted","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"deleted","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}}},"family_history":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"family_relative_id":{"changeType":"deleted","description":"Unique identifier of the relative, assigned by the data provider.","name":"family_relative_id","valueType":"string","meta":{"displayName":"Family Relative ID","primaryId":true,"notes":"This field is required to ensure that family members are identified in unique records. Ids can be as simple as an incremented numeral to ensure uniqueness."},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"relative_with_cancer_history":{"changeType":"deleted","description":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","name":"relative_with_cancer_history","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Relative with Cancer History"}},"relationship_type":{"changeType":"deleted","description":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","name":"relationship_type","restrictions":{"codeList":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"]},"valueType":"string","meta":{"displayName":"Relationship Type"}},"gender_of_relative":{"changeType":"deleted","description":"The self-reported gender of related individual.","name":"gender_of_relative","restrictions":{"codeList":["Female","Male","Other","Unknown"]},"valueType":"string","meta":{"displayName":"Gender of Relative"}},"age_of_relative_at_diagnosis":{"changeType":"deleted","description":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","name":"age_of_relative_at_diagnosis","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","displayName":"Age Of Relative At Diagnosis"}},"cancer_type_code_of_relative":{"changeType":"deleted","name":"cancer_type_code_of_relative","valueType":"string","description":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"examples":"C41.1,C16.9,C00.5,D46.9","dependsOn":"family_history.relative_with_cancer_history","displayName":"Cancer Type Code (ICD-10) of Relative"}},"relative_vital_status":{"changeType":"deleted","description":"Relative's last known state of living or deceased.","name":"relative_vital_status","restrictions":{"codeList":["Alive","Deceased","Unknown"]},"valueType":"string","meta":{"displayName":"Vital Status of Relative"}},"cause_of_death_of_relative":{"changeType":"deleted","description":"Indicate the cause of the death of the relative.","name":"cause_of_death_of_relative","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]},"valueType":"string","meta":{"dependsOn":"family_history.relative_vital_status","displayName":"Cause of Death of Relative"}},"relative_survival_time":{"changeType":"deleted","description":"Indicate how long, in days, the relative survived from the time they were diagnosed with cancer.","name":"relative_survival_time","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","units":"days","displayName":"Survival Time Of Relative"}}}},"biomarker":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"deleted","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"deleted","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"deleted","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"deleted","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"deleted","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"deleted","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"deleted","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"deleted","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"deleted","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"deleted","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"deleted","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"deleted","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"deleted","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"deleted","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"deleted","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"deleted","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}}},"comorbidity":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"deleted","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"deleted","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"deleted","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"deleted","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"deleted","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"deleted","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}}}}} diff --git a/scripts/data/schemas/diffs/1.24/1.24-diff-0.14.json b/scripts/data/schemas/diffs/1.24/1.24-diff-0.14.json new file mode 100644 index 00000000..37d03cd3 --- /dev/null +++ b/scripts/data/schemas/diffs/1.24/1.24-diff-0.14.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"program_id":{"meta":{"examples":{"left":"TEST-CA","right":"PACA-AU,BR-CA"},"notes":{"left":"This is the unique id that is assigned to your program. If you have logged into the platform, this is the Program Id that you see in the Program Services area. For example, TEST-CA is a Program ID.","right":"This is the unique id that is assigned to your program. If you have logged into the platform, this is the Program Id that you see in the Submission area. For example, PACA-CA is a Program ID."}}},"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":[],"deleted":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\r\n\r\n const row = $row;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n const designation = row.tumour_normal_designation.trim().toLowerCase();\r\n const specimen_type = $field.trim().toLowerCase();\r\n \r\n if (designation === \"normal\"){\r\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\r\n if (!validTypes.includes(specimen_type)){\r\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when tumour_normal_designation is set to Normal.\"};\r\n }\r\n }\r\n else if (designation === \"tumour\") {\r\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\r\n if (invalidTypes.includes(specimen_type)){\r\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when tumour_normal_designation is set to Tumour.\"};\r\n }\r\n }\r\n return result;\r\n })()"]}}},"submitter_sample_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased"],"right":["Alive","Deceased","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"cause_of_death":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate() {\r\n let result = {valid: true, message: \"Ok\"};\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n const vitalStatus = $row.vital_status.trim().toLowerCase();\r\n \r\n if (!currField && vitalStatus === \"deceased\"){\r\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\r\n }\r\n else if (currField && vitalStatus != \"deceased\"){\r\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\r\n }\r\n return result;\r\n })()"]}}},"survival_time":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate() {\r\n let result = {valid: true, message: \"Ok\"};\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n const vitalStatus = $row.vital_status.trim().toLowerCase();\r\n \r\n if (!currField && vitalStatus === \"deceased\"){\r\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\r\n }\r\n else if (currField && vitalStatus != \"deceased\"){\r\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\r\n }\r\n return result;\r\n })()"]},"range":{"left":{"exclusiveMin":0},"right":null}}},"primary_site":{"meta":{"notes":{"left":"To include multiple values, separate values with a pipe delimiter '|' within your file.","right":null},"examples":{"left":"Breast|Ovary","right":null}},"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Not Reported","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva","Unknown"],"data":{"added":["Not Reported","Unknown"],"deleted":["Unknown primary site"]}}}},"height":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"weight":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"bmi":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"menopause_status":{"description":{"left":"Indicate the donor's menopause status at the time of primary diagnosis. (Reference: caDSR CDE ID 2434914)","right":"Indicate the donor's menopause status at the time of primary diagnosis. (Codelist reference: NCI CDE ID: 2434914)"},"restrictions":{"codeList":{"left":["Not applicable","Perimenopausal","Postmenopausal","Premenopausal","Unknown"],"right":["Indeterminate or unknown","Not applicable","Perimenopausal","Postmenopausal","Premenopausal"],"data":{"added":["Indeterminate or unknown"],"deleted":["Unknown"]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)","right":"Indicate the donor's age of menarche, the first occurrence of menstruation."},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"number_of_pregnancies":{"description":{"left":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)","right":"Indicate the number of pregnancies a donor has had."},"restrictions":{"range":{"left":{"min":0},"right":null}}},"number_of_children":{"description":{"left":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)","right":"Indicate the number of children the donor has birthed."},"restrictions":{"range":{"left":{"min":0},"right":null}}}},"created":{"prior_malignancy":{"changeType":"created","description":"Prior malignancy affecting donor.","name":"prior_malignancy","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy","examples":"C41.1, C16.9, C00.5, D46.9"}},"cancer_type_prior_malignancy":{"changeType":"created","description":"The code to represent the cancer type of a prior malignancy using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","name":"cancer_type_prior_malignancy","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"valueType":"string","meta":{"displayName":"Cancer Type Prior Malignancy"}},"age_at_prior_malignancy":{"changeType":"created","description":"If donor has history of prior malignancy, indicate age at previous diagnosis, in years.","name":"age_at_prior_malignancy","valueType":"integer","meta":{"displayName":"Age at Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"created","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Codelist reference: NCI CDE: 4122391)","name":"laterality_of_prior_malignancy","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality at Prior Malignancy"}}},"deleted":{"genetic_disorders":{"changeType":"deleted","description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},"hrt_type":{"changeType":"deleted","description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},"hrt_duration":{"changeType":"deleted","description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},"contraception_type":{"changeType":"deleted","description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},"contraception_duration":{"changeType":"deleted","description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},"lost_to_followup_after_clinical_event_id":{"changeType":"deleted","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}}},"specimen":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"description":{"left":"Indicate the primary diagnosis event in the clinical timeline that this specimen acquisition was related to.","right":"Indicate the primary diagnosis event in the clinical timeline that this specimen aquisition was related to."},"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"pathological_tumour_staging_system":{"meta":{"validationDependency":{"left":true,"right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n /* This is not a required field, so first ensure that it exists */\r\n if ($field) {\r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })()"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"pathological_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"pathological_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"pathological_stage_group":{"description":{"left":"Specify the tumour stage, based on pathological_tumour_staging_system, used to assess the cancer at the time the tumour specimen was resected.","right":"Specify the tumour stage, based on tumour_staging_system, used to assess the cancer at the time the tumour specimen was resected."},"meta":{"notes":{"left":"This field depends on the selected pathological_tumour_staging_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","right":"This field depends on the selected pathological staging system, and is only required if the specimen is a tumour."}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.pathological_tumour_staging_system && $field) {\r\n let codeList = [];\r\n switch ($row.pathological_tumour_staging_system && $row.pathological_tumour_staging_system.trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb',\r\n 'stage ive',\r\n 'stage ivs'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When 'pathological_tumour_staging_system' is set to '${\r\n $row.pathological_tumour_staging_system\r\n }', 'pathological_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })()"]}}},"specimen_acquisition_interval":{"meta":{"notes":{"left":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":"The associated Primary Diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."},"displayName":{"left":"Specimen Acquisition Interval","right":"Specimen Aquisition Interval"}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"data":{"added":[],"deleted":["Unknown"]}}}},"specimen_storage":{"description":{"left":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured.","right":"Indicate the method of specimen storage for specimens that were not extracted freshly or immediately cultured."},"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"data":{"added":[],"deleted":["Unknown"]}}}},"reference_pathology_confirmed":{"description":{"left":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)","right":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. This only applies to clinical studies."}},"tumour_grading_system":{"meta":{"validationDependency":{"left":true,"right":null}}},"tumour_grade":{"meta":{"notes":{"left":"This field depends on the selected tumour_grading_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Grading Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-grading-classifications","right":"This field depends on the selected tumour grading system, and is only required if the specimen is a tumour."}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.tumour_grading_system && $field) {\r\n let codeList = [];\r\n const tieredGradingList = ['gx','g1','g2','g3'];\r\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\r\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\r\n case 'two-tier grading system':\r\n codeList = [\r\n 'low grade',\r\n 'high grade',\r\n ];\r\n break;\r\n case 'three-tier grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'four-tier grading system':\r\n codeList = [\r\n 'gx',\r\n 'g1',\r\n 'g2',\r\n 'g3',\r\n 'g4',\r\n ];\r\n break;\r\n case 'grading system for gists':\r\n codeList = [\r\n 'low',\r\n 'high',\r\n ];\r\n break;\r\n case 'grading system for gnets':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'isup grading system':\r\n codeList = [\r\n 'gx',\r\n 'g1',\r\n 'g2',\r\n 'g3',\r\n 'g4',\r\n ];\r\n break;\r\n case 'who grading system for cns tumours':\r\n codeList = [\r\n 'grade i',\r\n 'grade ii',\r\n 'grade iii',\r\n 'grade iv',\r\n ];\r\n break;\r\n case 'fnclcc grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'gleason grade group system':\r\n codeList = [\r\n 'grade group 1',\r\n 'grade group 2',\r\n 'grade group 3',\r\n 'grade group 4',\r\n 'grade group 5',\r\n ];\r\n break;\r\n case 'scarff-bloom-richardson grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'nuclear grading system for dcis':\r\n codeList = tieredGradingList;\r\n break;\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase())) {\r\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\r\n $row.tumour_grading_system\r\n }', 'tumour_grade' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\r\n result.valid = false;\r\n const msg = \"'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.\";\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })()"]}}},"percent_tumour_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)","right":"Indicate a value, in decimals, that represents the percentage of infiltration by tumour cells in a specimen."},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null},"script":{"left":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"],"right":null}}},"percent_proliferating_cells":{"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_inflammatory_tissue":{"description":{"left":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)","right":"Indicate a value, in decimals, that represents local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_stromal_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)","right":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a malignant tumour specimen but are not malignant such as fibroblasts, vascular structures, etc."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_necrosis":{"description":{"left":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)","right":"Indicate a value, in decimals, that represents the percentage of cell death in a malignant tumour specimen."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}}},"created":{},"deleted":{"specimen_laterality":{"changeType":"deleted","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"percent_tumour_cells_measurement_method":{"changeType":"deleted","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"age_at_diagnosis":{"description":{"left":"Age that the donor was first diagnosed with cancer, in years. This should be based on the earliest diagnosis of cancer.","right":"Age that the donor was first diagnosed with cancer, in years."},"restrictions":{"range":{"left":{"exclusiveMin":0,"max":90},"right":null}}},"number_lymph_nodes_examined":{"description":{"left":"The total number of lymph nodes tested for the presence of cancer. (Reference: caDSR CDE ID 3)","right":"The total number of lymph nodes tested for the presence of cancer. (Reference: NCI CDE ID: 3)"},"meta":{"dependsOn":{"left":"primary_diagnosis.lymph_nodes_examined_status","right":null},"notes":{"left":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":null},"range":{"left":{"min":0},"right":null}}},"number_lymph_nodes_positive":{"description":{"left":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: caDSR CDE ID 6113694)","right":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: NCI CDE ID: 6113694)"},"meta":{"dependsOn":{"left":"primary_diagnosis.lymph_nodes_examined_status","right":null},"notes":{"left":"This field is only required if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":null},"range":{"left":{"min":0},"right":null},"required":{"left":null,"right":true}}},"clinical_tumour_staging_system":{"meta":{"validationDependency":{"left":true,"right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n /* This is not a required field, so first ensure that it exists */\r\n if ($field) {\r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })()"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}},"required":{"left":null,"right":true}}},"clinical_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"clinical_n_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null}}},"clinical_m_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned.","right":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned."},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"clinical_stage_group":{"description":{"left":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage.","right":"Stage group of the tumour, as assigned by the reporting tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.)."},"meta":{"notes":{"left":"This field is dependent on the selected clinical_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","right":"This field is dependent on the selected clinical_tumour_staging_system"},"examples":{"left":"Stage I, Stage IIB","right":null}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.clinical_tumour_staging_system && $field) {\r\n let codeList = [];\r\n switch ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system.trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb',\r\n 'stage ive',\r\n 'stage ivs'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When 'clinical_tumour_staging_system' is set to '${\r\n $row.clinical_tumour_staging_system\r\n }', 'clinical_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })()"]}}},"presenting_symptoms":{"restrictions":{"codeList":{"left":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Loss of Appetite","Nausea","None","Not Reported","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Swelling in the Neck","Unknown","Vomiting","Weight Loss"],"right":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Nausea","None","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Unknown","Vomiting","Weight Loss"],"data":{"added":[],"deleted":["Loss of Appetite","Not Reported","Swelling in the Neck"]}}}},"performance_status":{"description":{"left":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status).","right":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference source: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status)."},"meta":{"notes":{"left":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction.\nGrade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work).\nGrade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours.\nGrade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours.\nGrade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair","right":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction \n Grade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work) \n Grade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours \n Grade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours \n Grade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair"}},"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"data":{"added":[],"deleted":["Unknown"]}}}}},"created":{},"deleted":{"cancer_type_additional_information":{"changeType":"deleted","name":"cancer_type_additional_information","valueType":"string","description":"Additional details related to the cancer type that are not covered by the ICD-10 code provided in the cancer_type field.","meta":{"displayName":"Cancer Type Additional Information"}},"laterality":{"changeType":"deleted","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_status":{"changeType":"deleted","name":"lymph_nodes_examined_status","description":"Indicate if lymph nodes were examined for metastases.","valueType":"string","restrictions":{"required":true,"codeList":["Cannot be determined","No","No lymph nodes found in resected specimen","Not applicable","Yes"]},"meta":{"core":true,"displayName":"Lymph Nodes Examined Status"}},"lymph_nodes_examined_method":{"changeType":"deleted","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}}},"treatment":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"treatment_type":{"meta":{"notes":{"left":"Depending on the treatment_type(s) selected, additional treatment details may be required to be submitted. For example, if treatment_type includes 'Chemotherapy', the supplemental Chemotherapy treatment type file is required.\nTo include multiple values, separate values with a pipe delimiter '|' within your file.","right":"Depending on the treatment_type selected, additional treatment details may be required to be submitted. For example, if treatment_type includes 'Chemotherapy', the supplemental Chemotherapy treatment type file is required."},"examples":{"left":"Chemotherapy|Hormonal therapy","right":null}},"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Combined chemotherapy and immunotherapy","Combined chemotherapy and radiation therapy","Combined chemotherapy, radiation therapy and surgery","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":["Combined chemotherapy and immunotherapy","Combined chemotherapy and radiation therapy","Combined chemotherapy, radiation therapy and surgery"],"deleted":["End of life care"]}}}},"is_primary_treatment":{"description":{"left":"Indicate if the treatment was the primary treatment following the initial diagnosis.","right":"Indicate if the treamtment was the primary treatment following the initial diagnosis."},"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"codeList":{"left":["Yes","No"],"right":["Yes","No","Unknown"],"data":{"added":["Unknown"],"deleted":[]}},"required":{"left":null,"right":true}}},"line_of_treatment":{"meta":{"dependsOn":{"left":"treatment.is_primary_treatment","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"],"right":null}}},"treatment_start_interval":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"treatment_duration":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null},"required":{"left":null,"right":true}}},"days_per_cycle":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null}}},"number_of_cycles":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null}}},"toxicity_type":{"description":{"left":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity.","right":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hemotological toxicity or non-hemotological toxicity."},"meta":{"dependsOn":{"left":"treatment.outcome_of_treatment","right":null}},"restrictions":{"codeList":{"left":["Hematological","Non-hematological","Not applicable","Unknown"],"right":["Hemotological","Non-hemotological"],"data":{"added":["Hemotological","Non-hemotological"],"deleted":["Hematological","Non-hematological","Not applicable","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"],"right":null}}},"adverse_events":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null},"notes":{"left":"To include multiple values, separate values with a pipe delimiter '|' within your file.","right":null}},"restrictions":{"codeList":{"left":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"right":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"data":{"added":[],"deleted":["None","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null}}},"clinical_trials_database":{"meta":{"notes":{"left":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added.","right":null}},"restrictions":{"codeList":{"left":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"],"right":["NCI Clinical Trials","EU Clinical Trials Register"],"data":{"added":[],"deleted":["Not applicable","Unknown"]}}}},"clinical_trial_number":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"],"right":["(function validate() {\r\n let result = {valid: true, message: \"Ok\"};\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n //regex check for clinical trial number\r\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\r\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\r\n\r\n // list of valid clinical trial databases\r\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\r\n \r\n if ($row.clinical_trials_database && $field) {\r\n const trialNumber = $field.trim();\r\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\r\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\r\n result = {valid: false, message: 'The submitted NCI clinical trial number is in incorrect format.'};\r\n }\r\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\r\n result = {valid: false, message: \"The submitted EudraCT clinical trial number is in incorrect format.\"};\r\n }\r\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\r\n result = {valid: false, message: \"The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database.\"};\r\n }\r\n }\r\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\r\n result = {valid: true, message: \"Ok\"};\r\n }\r\n else if ($row.clinical_trials_database && !$field) {\r\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\r\n result = {valid: false, message: \"'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.\"};\r\n } \r\n }\r\n return result;\r\n })()"]}}}},"created":{"age_at_consent_for_treatment":{"changeType":"created","name":"age_at_consent_for_treatment","description":"Indicate the age of donor when consent was given for treatment.","valueType":"integer","meta":{"displayName":"Age At Consent For Treatment"}},"therapeutic_intent":{"changeType":"created","name":"therapeutic_intent","description":"The therapeutic intent, the reason behind the choice of a therapy, of the treatment.","valueType":"string","restrictions":{"required":true,"codeList":["Adjuvant","Concurrent","Curative","Neoadjuvant","Not applicable","Palliative","Unknown"]},"meta":{"core":true,"displayName":"Therapeutic Intent"}},"response_to_therapy":{"changeType":"created","name":"response_to_therapy","description":"The donors's response to the applied treatment regimen. (Source: RECIST)","valueType":"string","restrictions":{"required":true,"codeList":["Complete response","Disease progression","NED","Partial response","Stable disease"]},"meta":{"core":true,"displayName":"Response To Therapy"}},"outcome_of_therapy":{"changeType":"created","name":"outcome_of_therapy","description":"Indicate the donor's outcome of the prescribed treatment.","valueType":"string","restrictions":{"codeList":["Treatment completed as prescribed","Treatment incomplete due to technical or organizational problems","Treatment incomplete because patient died","Patient choice (stopped or interrupted treatment)","Physician decision (stopped or interrupted treatment)","Treatment stopped due to lack of efficacy (disease progression)","Treatment stopped due to acute toxicity","Other","Not applicable","Unknown"]},"meta":{"displayName":"Outcome Of Therapy"}},"hemotological_toxicity":{"changeType":"created","name":"hemotological_toxicity","description":"Indicate the hemotological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5"]},"meta":{"displayName":"Hemotological Toxicity"}}},"deleted":{"treatment_intent":{"changeType":"deleted","name":"treatment_intent","description":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"]},"meta":{"core":true,"displayName":"Treatment Intent","dependsOn":"treatment.treatment_type"}},"treatment_setting":{"changeType":"deleted","name":"treatment_setting","description":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: NCIt C124308)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"]},"meta":{"core":true,"displayName":"Treatment Setting","dependsOn":"treatment.treatment_type"}},"response_to_treatment_criteria_method":{"changeType":"deleted","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},"response_to_treatment":{"changeType":"deleted","name":"response_to_treatment","description":"The donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"codeList":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"]},"meta":{"core":true,"displayName":"Response To Treatment","dependsOn":"treatment.response_to_treatment_criteria_method","notes":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"outcome_of_treatment":{"changeType":"deleted","name":"outcome_of_treatment","description":"Indicate the donor's outcome of the prescribed treatment.","valueType":"string","restrictions":{"codeList":["Treatment completed as prescribed","Treatment incomplete due to technical or organizational problems","Treatment incomplete because patient died","Patient choice (stopped or interrupted treatment)","Physician decision (stopped or interrupted treatment)","Treatment stopped due to lack of efficacy (disease progression)","Treatment stopped due to acute toxicity","Other","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Outcome Of Treatment","dependsOn":"treatment.treatment_type"}},"hematological_toxicity":{"changeType":"deleted","name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"non-hematological_toxicity":{"changeType":"deleted","name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"chemotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"dependsOn":{"left":"chemotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"description":{"left":"Name of agent or drug administered to donor as part of the treatment regimen.","right":"Name of agent or drug administered to patient as part of the treatment regimen."},"meta":{"dependsOn":{"left":"chemotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"chemotherapy_dosage_units":{"changeType":"created","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate the total drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"deleted","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"deleted","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"deleted","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"deleted","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"description":{"left":"Name of agent or drug administered to donor as part of the treatment regimen.","right":"Name of agent or drug administered to patient as part of the treatment regimen."},"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"hormone_drug_dosage_units":{"changeType":"created","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"deleted","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"radiation":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"radiation_therapy_fractions":{"description":{"left":"Indicate the total number of fractions delivered as part of treatment.","right":"Indicate the number of total fractions delivered as part of treatment."},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"radiation_therapy_dosage":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"anatomical_site_irradiated":{"description":{"left":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)","right":"Indicate localization site where radiation therapy was administered."},"restrictions":{"codeList":{"left":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"right":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"data":{"added":["Bone","Extremities","Head-Neck","Peritoneum"],"deleted":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"]}}}}},"created":{"radiation_treatment_type":{"changeType":"created","name":"radiation_treatment_type","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal"]},"meta":{"core":true,"displayName":"Application Form","notes":"Internal application includes Brachytherapy."}}},"deleted":{"radiation_therapy_type":{"changeType":"deleted","name":"radiation_therapy_type","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal"]},"meta":{"core":true,"displayName":"Type of Radiation Therapy","notes":"Internal application includes Brachytherapy."}},"radiation_boost":{"changeType":"deleted","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"deleted","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}}},"immunotherapy":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"immunotherapy_type":{"changeType":"deleted","name":"immunotherapy_type","valueType":"string","description":"Indicate the type of immunotherapy administered to donor.","meta":{"displayName":"Immunotherapy Type","core":true},"restrictions":{"required":true,"codeList":["Cell-based","Immune checkpoint inhibitors","Monoclonal antibodies other than immune checkpoint inhibitors","Other immunomodulatory substances"]}},"drug_rxnormcui":{"changeType":"deleted","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"deleted","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"deleted","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"surgery":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"deleted","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"deleted","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"deleted","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"deleted","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"deleted","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"deleted","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"deleted","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"deleted","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"deleted","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"deleted","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"deleted","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"deleted","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"deleted","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"deleted","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}}},"follow_up":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_follow_up_id":{"description":{"left":"Unique identifier for a follow-up event in a donor's clinical record, assigned by the data provider.","right":"Unique identifier for a follow-up event in a donors clincal record, assigned by the data provider."},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"interval_of_followup":{"meta":{"notes":{"left":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":"The associated Primary Diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}}},"disease_status_at_followup":{"description":{"left":"Indicate the donor's disease status at time of follow-up. (Reference: RECIST)","right":"Indicate the donor's disease status at time of follow-up."},"restrictions":{"codeList":{"left":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Progression NOS","Relapse or recurrence","Stable"],"right":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Relapse or recurrence","Stable"],"data":{"added":[],"deleted":["Progression NOS"]}}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"treatment.submitter_treatment_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"weight_at_followup":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"relapse_type":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })()"]}}},"relapse_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })()"]}}},"method_of_progression_status":{"description":{"left":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Reference: caDSR CDE ID 6161031)","right":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Codelist reference: NCI CDE ID: 6161031)"},"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })()"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n /* This is not a required field, so first ensure that it exists */\r\n if ($field) {\r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })()","(function validate() {\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })()"]}}},"recurrence_t_category":{"description":{"left":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"recurrence_n_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":null,"right":true}}},"recurrence_m_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"recurrence_stage_group":{"description":{"left":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) at the time of retreatment for a recurrence or disease progression.","right":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery."},"meta":{"notes":{"left":"This field is dependent on the selected recurrence_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","right":"This field is dependent on the selected recurrence_tumour_staging_system."},"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.recurrence_tumour_staging_system && $field) {\r\n let codeList = [];\r\n switch ($row.recurrence_tumour_staging_system && $row.recurrence_tumour_staging_system.trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb',\r\n 'stage ive',\r\n 'stage ivs'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When 'recurrence_tumour_staging_system' is set to '${\r\n $row.recurrence_tumour_staging_system\r\n }', 'recurrence_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })()"]}}},"posttherapy_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n /* This is not a required field, so first ensure that it exists */\r\n if ($field) {\r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })()"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"posttherapy_t_category":{"meta":{"dependsOn":{"left":"follow_up.posttherapy_tumour_staging_system","right":"follow_up.post_therapy_tumour_staging_system"}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"posttherapy_n_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"dependsOn":{"left":"follow_up.posttherapy_tumour_staging_system","right":"follow_up.post_therapy_tumour_staging_system"}}},"posttherapy_m_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"dependsOn":{"left":"follow_up.posttherapy_tumour_staging_system","right":"follow_up.post_therapy_tumour_staging_system"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"posttherapy_stage_group":{"meta":{"dependsOn":{"left":"follow_up.posttherapy_tumour_staging_system","right":"follow_up.post_therapy_tumour_staging_system"},"notes":{"left":"This field is dependent on the selected posttherapy_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","right":"This field is dependent on the selected posttherapy_tumour_staging_system."}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.posttherapy_tumour_staging_system && $field) {\r\n let codeList = [];\r\n switch ($row.posttherapy_tumour_staging_system && $row.posttherapy_tumour_staging_system.trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb',\r\n 'stage ive',\r\n 'stage ivs'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When 'posttherapy_tumour_staging_system' is set to '${\r\n $row.posttherapy_tumour_staging_system\r\n }', 'posttherapy_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })()"]}}}},"created":{"anatomic_site_progression_or_recurrences":{"changeType":"created","description":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate() {\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })()"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1,C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}}},"deleted":{"anatomic_site_progression_or_recurrence":{"changeType":"deleted","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"exposure":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"deleted","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"deleted","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"deleted","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"deleted","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"deleted","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"deleted","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"deleted","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"deleted","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"deleted","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"deleted","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"deleted","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}}},"family_history":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"family_relative_id":{"changeType":"deleted","description":"Unique identifier of the relative, assigned by the data provider.","name":"family_relative_id","valueType":"string","meta":{"displayName":"Family Relative ID","primaryId":true,"notes":"This field is required to ensure that family members are identified in unique records. Ids can be as simple as an incremented numeral to ensure uniqueness."},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"relative_with_cancer_history":{"changeType":"deleted","description":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","name":"relative_with_cancer_history","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Relative with Cancer History"}},"relationship_type":{"changeType":"deleted","description":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","name":"relationship_type","restrictions":{"codeList":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"]},"valueType":"string","meta":{"displayName":"Relationship Type"}},"gender_of_relative":{"changeType":"deleted","description":"The self-reported gender of related individual.","name":"gender_of_relative","restrictions":{"codeList":["Female","Male","Other","Unknown"]},"valueType":"string","meta":{"displayName":"Gender of Relative"}},"age_of_relative_at_diagnosis":{"changeType":"deleted","description":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","name":"age_of_relative_at_diagnosis","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","displayName":"Age Of Relative At Diagnosis"}},"cancer_type_code_of_relative":{"changeType":"deleted","name":"cancer_type_code_of_relative","valueType":"string","description":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"examples":"C41.1,C16.9,C00.5,D46.9","dependsOn":"family_history.relative_with_cancer_history","displayName":"Cancer Type Code (ICD-10) of Relative"}},"relative_vital_status":{"changeType":"deleted","description":"Relative's last known state of living or deceased.","name":"relative_vital_status","restrictions":{"codeList":["Alive","Deceased","Unknown"]},"valueType":"string","meta":{"displayName":"Vital Status of Relative"}},"cause_of_death_of_relative":{"changeType":"deleted","description":"Indicate the cause of the death of the relative.","name":"cause_of_death_of_relative","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]},"valueType":"string","meta":{"dependsOn":"family_history.relative_vital_status","displayName":"Cause of Death of Relative"}},"relative_survival_time":{"changeType":"deleted","description":"Indicate how long, in days, the relative survived from the time they were diagnosed with cancer.","name":"relative_survival_time","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","units":"days","displayName":"Survival Time Of Relative"}}}},"biomarker":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"deleted","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"deleted","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"deleted","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"deleted","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"deleted","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"deleted","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"deleted","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"deleted","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"deleted","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"deleted","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"deleted","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"deleted","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"deleted","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"deleted","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"deleted","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"deleted","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}}},"comorbidity":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"deleted","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"deleted","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"deleted","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"deleted","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"deleted","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"deleted","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}}}}} diff --git a/scripts/data/schemas/diffs/1.24/1.24-diff-0.15.json b/scripts/data/schemas/diffs/1.24/1.24-diff-0.15.json new file mode 100644 index 00000000..51387af7 --- /dev/null +++ b/scripts/data/schemas/diffs/1.24/1.24-diff-0.15.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"program_id":{"meta":{"examples":{"left":"TEST-CA","right":"PACA-AU,BR-CA"},"notes":{"left":"This is the unique id that is assigned to your program. If you have logged into the platform, this is the Program Id that you see in the Program Services area. For example, TEST-CA is a Program ID.","right":"This is the unique id that is assigned to your program. If you have logged into the platform, this is the Program Id that you see in the Submission area. For example, PACA-CA is a Program ID."}}},"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":[],"deleted":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n\n const row = $row;\n let result = {valid: true, message: \"Ok\"};\n \n const designation = row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\"){\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when tumour_normal_designation is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when tumour_normal_designation is set to Tumour.\"};\n }\n }\n return result;\n })()"]}}},"submitter_sample_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased"],"right":["Alive","Deceased","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"cause_of_death":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })()"]}}},"survival_time":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })()"]},"range":{"left":{"exclusiveMin":0},"right":null}}},"primary_site":{"meta":{"notes":{"left":"To include multiple values, separate values with a pipe delimiter '|' within your file.","right":null},"examples":{"left":"Breast|Ovary","right":null}},"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Not Reported","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva","Unknown"],"data":{"added":["Not Reported","Unknown"],"deleted":["Unknown primary site"]}}}},"height":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"weight":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"bmi":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"menopause_status":{"description":{"left":"Indicate the donor's menopause status at the time of primary diagnosis. (Reference: caDSR CDE ID 2434914)","right":"Indicate the donor's menopause status at the time of primary diagnosis. (Codelist reference: NCI CDE ID: 2434914)"},"restrictions":{"codeList":{"left":["Not applicable","Perimenopausal","Postmenopausal","Premenopausal","Unknown"],"right":["Indeterminate or unknown","Not applicable","Perimenopausal","Postmenopausal","Premenopausal"],"data":{"added":["Indeterminate or unknown"],"deleted":["Unknown"]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)","right":"Indicate the donor's age of menarche, the first occurrence of menstruation."},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"number_of_pregnancies":{"description":{"left":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)","right":"Indicate the number of pregnancies a donor has had."},"restrictions":{"range":{"left":{"min":0},"right":null}}},"number_of_children":{"description":{"left":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)","right":"Indicate the number of children the donor has birthed."},"restrictions":{"range":{"left":{"min":0},"right":null}}}},"created":{"prior_malignancy":{"changeType":"created","description":"Prior malignancy affecting donor.","name":"prior_malignancy","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy","examples":"C41.1, C16.9, C00.5, D46.9"}},"cancer_type_prior_malignancy":{"changeType":"created","description":"The code to represent the cancer type of a prior malignancy using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","name":"cancer_type_prior_malignancy","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"valueType":"string","meta":{"displayName":"Cancer Type Prior Malignancy"}},"age_at_prior_malignancy":{"changeType":"created","description":"If donor has history of prior malignancy, indicate age at previous diagnosis, in years.","name":"age_at_prior_malignancy","valueType":"integer","meta":{"displayName":"Age at Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"created","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Codelist reference: NCI CDE: 4122391)","name":"laterality_of_prior_malignancy","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality at Prior Malignancy"}}},"deleted":{"genetic_disorders":{"changeType":"deleted","description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},"hrt_type":{"changeType":"deleted","description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},"hrt_duration":{"changeType":"deleted","description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},"contraception_type":{"changeType":"deleted","description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},"contraception_duration":{"changeType":"deleted","description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},"lost_to_followup_after_clinical_event_id":{"changeType":"deleted","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}}},"specimen":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"description":{"left":"Indicate the primary diagnosis event in the clinical timeline that this specimen acquisition was related to.","right":"Indicate the primary diagnosis event in the clinical timeline that this specimen aquisition was related to."},"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"pathological_tumour_staging_system":{"meta":{"validationDependency":{"left":true,"right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"pathological_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"pathological_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"pathological_stage_group":{"description":{"left":"Specify the tumour stage, based on pathological_tumour_staging_system, used to assess the cancer at the time the tumour specimen was resected.","right":"Specify the tumour stage, based on tumour_staging_system, used to assess the cancer at the time the tumour specimen was resected."},"meta":{"notes":{"left":"This field depends on the selected pathological_tumour_staging_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","right":"This field depends on the selected pathological staging system, and is only required if the specimen is a tumour."}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n if ($row.pathological_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.pathological_tumour_staging_system && $row.pathological_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'pathological_tumour_staging_system' is set to '${\n $row.pathological_tumour_staging_system\n }', 'pathological_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })()"]}}},"specimen_acquisition_interval":{"meta":{"notes":{"left":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":"The associated Primary Diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."},"displayName":{"left":"Specimen Acquisition Interval","right":"Specimen Aquisition Interval"}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"data":{"added":[],"deleted":["Unknown"]}}}},"specimen_storage":{"description":{"left":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured.","right":"Indicate the method of specimen storage for specimens that were not extracted freshly or immediately cultured."},"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"data":{"added":[],"deleted":["Unknown"]}}}},"reference_pathology_confirmed":{"description":{"left":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)","right":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. This only applies to clinical studies."}},"tumour_grading_system":{"meta":{"validationDependency":{"left":true,"right":null}}},"tumour_grade":{"meta":{"notes":{"left":"This field depends on the selected tumour_grading_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Grading Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-grading-classifications","right":"This field depends on the selected tumour grading system, and is only required if the specimen is a tumour."}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = \"'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.\";\n result.message = msg;\n }\n }\n return result;\n })()"]}}},"percent_tumour_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)","right":"Indicate a value, in decimals, that represents the percentage of infiltration by tumour cells in a specimen."},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null},"script":{"left":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"],"right":null}}},"percent_proliferating_cells":{"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_inflammatory_tissue":{"description":{"left":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)","right":"Indicate a value, in decimals, that represents local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_stromal_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)","right":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a malignant tumour specimen but are not malignant such as fibroblasts, vascular structures, etc."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_necrosis":{"description":{"left":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)","right":"Indicate a value, in decimals, that represents the percentage of cell death in a malignant tumour specimen."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}}},"created":{},"deleted":{"specimen_laterality":{"changeType":"deleted","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"percent_tumour_cells_measurement_method":{"changeType":"deleted","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"age_at_diagnosis":{"description":{"left":"Age that the donor was first diagnosed with cancer, in years. This should be based on the earliest diagnosis of cancer.","right":"Age that the donor was first diagnosed with cancer, in years."},"restrictions":{"range":{"left":{"exclusiveMin":0,"max":90},"right":null}}},"number_lymph_nodes_examined":{"description":{"left":"The total number of lymph nodes tested for the presence of cancer. (Reference: caDSR CDE ID 3)","right":"The total number of lymph nodes tested for the presence of cancer. (Reference: NCI CDE ID: 3)"},"meta":{"dependsOn":{"left":"primary_diagnosis.lymph_nodes_examined_status","right":null},"notes":{"left":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":null},"range":{"left":{"min":0},"right":null}}},"number_lymph_nodes_positive":{"description":{"left":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: caDSR CDE ID 6113694)","right":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: NCI CDE ID: 6113694)"},"meta":{"dependsOn":{"left":"primary_diagnosis.lymph_nodes_examined_status","right":null},"notes":{"left":"This field is only required if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":null},"range":{"left":{"min":0},"right":null},"required":{"left":null,"right":true}}},"clinical_tumour_staging_system":{"meta":{"validationDependency":{"left":true,"right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}},"required":{"left":null,"right":true}}},"clinical_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"clinical_n_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null}}},"clinical_m_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned.","right":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned."},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"clinical_stage_group":{"description":{"left":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage.","right":"Stage group of the tumour, as assigned by the reporting tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.)."},"meta":{"notes":{"left":"This field is dependent on the selected clinical_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","right":"This field is dependent on the selected clinical_tumour_staging_system"},"examples":{"left":"Stage I, Stage IIB","right":null}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n if ($row.clinical_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'clinical_tumour_staging_system' is set to '${\n $row.clinical_tumour_staging_system\n }', 'clinical_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })()"]}}},"presenting_symptoms":{"restrictions":{"codeList":{"left":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Loss of Appetite","Nausea","None","Not Reported","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Swelling in the Neck","Unknown","Vomiting","Weight Loss"],"right":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Nausea","None","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Unknown","Vomiting","Weight Loss"],"data":{"added":[],"deleted":["Loss of Appetite","Not Reported","Swelling in the Neck"]}}}},"performance_status":{"description":{"left":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status).","right":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference source: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status)."},"meta":{"notes":{"left":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction.\nGrade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work).\nGrade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours.\nGrade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours.\nGrade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair","right":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction \n Grade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work) \n Grade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours \n Grade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours \n Grade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair"}},"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"data":{"added":[],"deleted":["Unknown"]}}}}},"created":{},"deleted":{"cancer_type_additional_information":{"changeType":"deleted","name":"cancer_type_additional_information","valueType":"string","description":"Additional details related to the cancer type that are not covered by the ICD-10 code provided in the cancer_type field.","meta":{"displayName":"Cancer Type Additional Information"}},"laterality":{"changeType":"deleted","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_status":{"changeType":"deleted","name":"lymph_nodes_examined_status","description":"Indicate if lymph nodes were examined for metastases.","valueType":"string","restrictions":{"required":true,"codeList":["Cannot be determined","No","No lymph nodes found in resected specimen","Not applicable","Yes"]},"meta":{"core":true,"displayName":"Lymph Nodes Examined Status"}},"lymph_nodes_examined_method":{"changeType":"deleted","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}}},"treatment":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"treatment_type":{"meta":{"notes":{"left":"Depending on the treatment_type(s) selected, additional treatment details may be required to be submitted. For example, if treatment_type includes 'Chemotherapy', the supplemental Chemotherapy treatment type file is required.\nTo include multiple values, separate values with a pipe delimiter '|' within your file.","right":"Depending on the treatment_type(s) selected, additional treatment details may be required to be submitted. For example, if treatment_type includes 'Chemotherapy', the supplemental Chemotherapy treatment type file is required."},"examples":{"left":"Chemotherapy|Hormonal therapy","right":null}},"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":[],"deleted":["End of life care"]}}}},"is_primary_treatment":{"description":{"left":"Indicate if the treatment was the primary treatment following the initial diagnosis.","right":"Indicate if the treamtment was the primary treatment following the initial diagnosis."},"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"codeList":{"left":["Yes","No"],"right":["Yes","No","Unknown"],"data":{"added":["Unknown"],"deleted":[]}},"required":{"left":null,"right":true}}},"line_of_treatment":{"meta":{"dependsOn":{"left":"treatment.is_primary_treatment","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"],"right":null}}},"treatment_start_interval":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"treatment_duration":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null},"required":{"left":null,"right":true}}},"days_per_cycle":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null}}},"number_of_cycles":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null}}},"toxicity_type":{"description":{"left":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity.","right":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hemotological toxicity or non-hemotological toxicity."},"meta":{"dependsOn":{"left":"treatment.outcome_of_treatment","right":null}},"restrictions":{"codeList":{"left":["Hematological","Non-hematological","Not applicable","Unknown"],"right":["Hemotological","Non-hemotological"],"data":{"added":["Hemotological","Non-hemotological"],"deleted":["Hematological","Non-hematological","Not applicable","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"],"right":null}}},"adverse_events":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null},"notes":{"left":"To include multiple values, separate values with a pipe delimiter '|' within your file.","right":null}},"restrictions":{"codeList":{"left":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"right":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"data":{"added":[],"deleted":["None","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null}}},"clinical_trials_database":{"meta":{"notes":{"left":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added.","right":null}},"restrictions":{"codeList":{"left":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"],"right":["NCI Clinical Trials","EU Clinical Trials Register"],"data":{"added":[],"deleted":["Not applicable","Unknown"]}}}},"clinical_trial_number":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: 'The submitted NCI clinical trial number is in incorrect format.'};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: \"The submitted EudraCT clinical trial number is in incorrect format.\"};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: \"The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database.\"};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: \"'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.\"};\n } \n }\n return result;\n })()"]}}}},"created":{"age_at_consent_for_treatment":{"changeType":"created","name":"age_at_consent_for_treatment","description":"Indicate the age of donor when consent was given for treatment.","valueType":"integer","meta":{"displayName":"Age At Consent For Treatment"}},"therapeutic_intent":{"changeType":"created","name":"therapeutic_intent","description":"The therapeutic intent, the reason behind the choice of a therapy, of the treatment.","valueType":"string","restrictions":{"required":true,"codeList":["Adjuvant","Concurrent","Curative","Neoadjuvant","Not applicable","Palliative","Unknown"]},"meta":{"core":true,"displayName":"Therapeutic Intent"}},"response_to_therapy":{"changeType":"created","name":"response_to_therapy","description":"The donors's response to the applied treatment regimen. (Source: RECIST)","valueType":"string","restrictions":{"required":true,"codeList":["Complete response","Disease progression","NED","Partial response","Stable disease"]},"meta":{"core":true,"displayName":"Response To Therapy"}},"outcome_of_therapy":{"changeType":"created","name":"outcome_of_therapy","description":"Indicate the donor's outcome of the prescribed treatment.","valueType":"string","restrictions":{"codeList":["Treatment completed as prescribed","Treatment incomplete due to technical or organizational problems","Treatment incomplete because patient died","Patient choice (stopped or interrupted treatment)","Physician decision (stopped or interrupted treatment)","Treatment stopped due to lack of efficacy (disease progression)","Treatment stopped due to acute toxicity","Other","Not applicable","Unknown"]},"meta":{"displayName":"Outcome Of Therapy"}},"hemotological_toxicity":{"changeType":"created","name":"hemotological_toxicity","description":"Indicate the hemotological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5"]},"meta":{"displayName":"Hemotological Toxicity"}}},"deleted":{"treatment_intent":{"changeType":"deleted","name":"treatment_intent","description":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"]},"meta":{"core":true,"displayName":"Treatment Intent","dependsOn":"treatment.treatment_type"}},"treatment_setting":{"changeType":"deleted","name":"treatment_setting","description":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: NCIt C124308)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"]},"meta":{"core":true,"displayName":"Treatment Setting","dependsOn":"treatment.treatment_type"}},"response_to_treatment_criteria_method":{"changeType":"deleted","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},"response_to_treatment":{"changeType":"deleted","name":"response_to_treatment","description":"The donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"codeList":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"]},"meta":{"core":true,"displayName":"Response To Treatment","dependsOn":"treatment.response_to_treatment_criteria_method","notes":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"outcome_of_treatment":{"changeType":"deleted","name":"outcome_of_treatment","description":"Indicate the donor's outcome of the prescribed treatment.","valueType":"string","restrictions":{"codeList":["Treatment completed as prescribed","Treatment incomplete due to technical or organizational problems","Treatment incomplete because patient died","Patient choice (stopped or interrupted treatment)","Physician decision (stopped or interrupted treatment)","Treatment stopped due to lack of efficacy (disease progression)","Treatment stopped due to acute toxicity","Other","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Outcome Of Treatment","dependsOn":"treatment.treatment_type"}},"hematological_toxicity":{"changeType":"deleted","name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"non-hematological_toxicity":{"changeType":"deleted","name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"chemotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"dependsOn":{"left":"chemotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"description":{"left":"Name of agent or drug administered to donor as part of the treatment regimen.","right":"Name of agent or drug administered to patient as part of the treatment regimen."},"meta":{"dependsOn":{"left":"chemotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"chemotherapy_dosage_units":{"changeType":"created","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate the total drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"deleted","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"deleted","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"deleted","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"deleted","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"description":{"left":"Name of agent or drug administered to donor as part of the treatment regimen.","right":"Name of agent or drug administered to patient as part of the treatment regimen."},"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"hormone_drug_dosage_units":{"changeType":"created","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"deleted","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"radiation":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"radiation_therapy_fractions":{"description":{"left":"Indicate the total number of fractions delivered as part of treatment.","right":"Indicate the number of total fractions delivered as part of treatment."},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"radiation_therapy_dosage":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"anatomical_site_irradiated":{"description":{"left":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)","right":"Indicate localization site where radiation therapy was administered."},"restrictions":{"codeList":{"left":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"right":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"data":{"added":["Bone","Extremities","Head-Neck","Peritoneum"],"deleted":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"]}}}}},"created":{"radiation_treatment_type":{"changeType":"created","name":"radiation_treatment_type","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal"]},"meta":{"core":true,"displayName":"Application Form","notes":"Internal application includes Brachytherapy."}}},"deleted":{"radiation_therapy_type":{"changeType":"deleted","name":"radiation_therapy_type","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal"]},"meta":{"core":true,"displayName":"Type of Radiation Therapy","notes":"Internal application includes Brachytherapy."}},"radiation_boost":{"changeType":"deleted","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"deleted","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}}},"immunotherapy":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"immunotherapy_type":{"changeType":"deleted","name":"immunotherapy_type","valueType":"string","description":"Indicate the type of immunotherapy administered to donor.","meta":{"displayName":"Immunotherapy Type","core":true},"restrictions":{"required":true,"codeList":["Cell-based","Immune checkpoint inhibitors","Monoclonal antibodies other than immune checkpoint inhibitors","Other immunomodulatory substances"]}},"drug_rxnormcui":{"changeType":"deleted","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"deleted","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"deleted","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"surgery":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"deleted","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"deleted","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"deleted","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"deleted","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"deleted","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"deleted","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"deleted","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"deleted","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"deleted","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"deleted","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"deleted","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"deleted","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"deleted","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"deleted","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}}},"follow_up":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_follow_up_id":{"description":{"left":"Unique identifier for a follow-up event in a donor's clinical record, assigned by the data provider.","right":"Unique identifier for a follow-up event in a donors clincal record, assigned by the data provider."},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"interval_of_followup":{"meta":{"notes":{"left":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":"The associated Primary Diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}}},"disease_status_at_followup":{"description":{"left":"Indicate the donor's disease status at time of follow-up. (Reference: RECIST)","right":"Indicate the donor's disease status at time of follow-up."},"restrictions":{"codeList":{"left":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Progression NOS","Relapse or recurrence","Stable"],"right":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Relapse or recurrence","Stable"],"data":{"added":[],"deleted":["Progression NOS"]}}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"treatment.submitter_treatment_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"weight_at_followup":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"relapse_type":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })()"]}}},"relapse_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })()"]}}},"method_of_progression_status":{"description":{"left":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Reference: caDSR CDE ID 6161031)","right":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Codelist reference: NCI CDE ID: 6161031)"},"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })()"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })()"]}}},"recurrence_t_category":{"description":{"left":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"recurrence_n_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":null,"right":true}}},"recurrence_m_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"recurrence_stage_group":{"description":{"left":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) at the time of retreatment for a recurrence or disease progression.","right":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery."},"meta":{"notes":{"left":"This field is dependent on the selected recurrence_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","right":"This field is dependent on the selected recurrence_tumour_staging_system."},"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n if ($row.recurrence_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.recurrence_tumour_staging_system && $row.recurrence_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'recurrence_tumour_staging_system' is set to '${\n $row.recurrence_tumour_staging_system\n }', 'recurrence_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })()"]}}},"posttherapy_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"posttherapy_t_category":{"meta":{"dependsOn":{"left":"follow_up.posttherapy_tumour_staging_system","right":"follow_up.post_therapy_tumour_staging_system"}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"posttherapy_n_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"dependsOn":{"left":"follow_up.posttherapy_tumour_staging_system","right":"follow_up.post_therapy_tumour_staging_system"}}},"posttherapy_m_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"dependsOn":{"left":"follow_up.posttherapy_tumour_staging_system","right":"follow_up.post_therapy_tumour_staging_system"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"posttherapy_stage_group":{"meta":{"dependsOn":{"left":"follow_up.posttherapy_tumour_staging_system","right":"follow_up.post_therapy_tumour_staging_system"},"notes":{"left":"This field is dependent on the selected posttherapy_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","right":"This field is dependent on the selected posttherapy_tumour_staging_system."}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n if ($row.posttherapy_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.posttherapy_tumour_staging_system && $row.posttherapy_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'posttherapy_tumour_staging_system' is set to '${\n $row.posttherapy_tumour_staging_system\n }', 'posttherapy_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })()"]}}}},"created":{"anatomic_site_progression_or_recurrences":{"changeType":"created","description":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })()"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1,C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}}},"deleted":{"anatomic_site_progression_or_recurrence":{"changeType":"deleted","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"exposure":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"deleted","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"deleted","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"deleted","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"deleted","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"deleted","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"deleted","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"deleted","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"deleted","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"deleted","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"deleted","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"deleted","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}}},"family_history":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"family_relative_id":{"changeType":"deleted","description":"Unique identifier of the relative, assigned by the data provider.","name":"family_relative_id","valueType":"string","meta":{"displayName":"Family Relative ID","primaryId":true,"notes":"This field is required to ensure that family members are identified in unique records. Ids can be as simple as an incremented numeral to ensure uniqueness."},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"relative_with_cancer_history":{"changeType":"deleted","description":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","name":"relative_with_cancer_history","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Relative with Cancer History"}},"relationship_type":{"changeType":"deleted","description":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","name":"relationship_type","restrictions":{"codeList":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"]},"valueType":"string","meta":{"displayName":"Relationship Type"}},"gender_of_relative":{"changeType":"deleted","description":"The self-reported gender of related individual.","name":"gender_of_relative","restrictions":{"codeList":["Female","Male","Other","Unknown"]},"valueType":"string","meta":{"displayName":"Gender of Relative"}},"age_of_relative_at_diagnosis":{"changeType":"deleted","description":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","name":"age_of_relative_at_diagnosis","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","displayName":"Age Of Relative At Diagnosis"}},"cancer_type_code_of_relative":{"changeType":"deleted","name":"cancer_type_code_of_relative","valueType":"string","description":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"examples":"C41.1,C16.9,C00.5,D46.9","dependsOn":"family_history.relative_with_cancer_history","displayName":"Cancer Type Code (ICD-10) of Relative"}},"relative_vital_status":{"changeType":"deleted","description":"Relative's last known state of living or deceased.","name":"relative_vital_status","restrictions":{"codeList":["Alive","Deceased","Unknown"]},"valueType":"string","meta":{"displayName":"Vital Status of Relative"}},"cause_of_death_of_relative":{"changeType":"deleted","description":"Indicate the cause of the death of the relative.","name":"cause_of_death_of_relative","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]},"valueType":"string","meta":{"dependsOn":"family_history.relative_vital_status","displayName":"Cause of Death of Relative"}},"relative_survival_time":{"changeType":"deleted","description":"Indicate how long, in days, the relative survived from the time they were diagnosed with cancer.","name":"relative_survival_time","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","units":"days","displayName":"Survival Time Of Relative"}}}},"biomarker":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"deleted","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"deleted","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"deleted","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"deleted","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"deleted","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"deleted","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"deleted","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"deleted","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"deleted","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"deleted","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"deleted","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"deleted","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"deleted","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"deleted","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"deleted","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"deleted","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}}},"comorbidity":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"deleted","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"deleted","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"deleted","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"deleted","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"deleted","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"deleted","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}}}}} diff --git a/scripts/data/schemas/diffs/1.24/1.24-diff-0.5.json b/scripts/data/schemas/diffs/1.24/1.24-diff-0.5.json new file mode 100644 index 00000000..d6ef57e1 --- /dev/null +++ b/scripts/data/schemas/diffs/1.24/1.24-diff-0.5.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"program_id":{"meta":{"examples":{"left":"TEST-CA","right":"PACA-AU,BR-CA"},"notes":{"left":"This is the unique id that is assigned to your program. If you have logged into the platform, this is the Program Id that you see in the Program Services area. For example, TEST-CA is a Program ID.","right":null},"displayName":{"left":"Program ID","right":null}}},"submitter_donor_id":{"meta":{"displayName":{"left":"Submitter Donor ID","right":null}}},"gender":{"meta":{"displayName":{"left":"Gender","right":null}}},"submitter_specimen_id":{"meta":{"displayName":{"left":"Submitter Specimen ID","right":null}}},"specimen_tissue_source":{"meta":{"displayName":{"left":"Specimen Tissue Source","right":null}}},"tumour_normal_designation":{"meta":{"displayName":{"left":"Tumour Normal Designation","right":null}}},"specimen_type":{"meta":{"displayName":{"left":"Specimen Type","right":null}},"restrictions":{"codeList":{"left":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Normal","Normal - tissue adjacent to primary tumour","Primary tumour","Primary tumour - adjacent to normal","Primary tumour - additional new primary","Recurrent tumour","Metastatic tumour","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour - additional metastatic","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line","Cell line - derived from xenograft tumour","Cell line - derived from tumour","Cell line - derived from normal"],"data":{"added":[],"deleted":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n\n const row = $row;\n let result = {valid: true, message: \"Ok\"};\n \n const designation = row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\"){\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when tumour_normal_designation is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when tumour_normal_designation is set to Tumour.\"};\n }\n }\n return result;\n })()"]}}},"submitter_sample_id":{"meta":{"displayName":{"left":"Submitter Sample ID","right":null}}},"sample_type":{"meta":{"displayName":{"left":"Sample Type","right":null}}}},"created":{},"deleted":{}},"donor":{"updated":{"program_id":{"meta":{"displayName":{"left":"Program ID","right":null}}},"submitter_donor_id":{"meta":{"displayName":{"left":"Submitter Donor ID","right":null}}},"vital_status":{"meta":{"displayName":{"left":"Vital Status","right":null}},"restrictions":{"codeList":{"left":["Alive","Deceased"],"right":["Alive","Deceased","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"cause_of_death":{"meta":{"displayName":{"left":"Cause of Death","right":null}},"restrictions":{"codeList":{"left":["Died of cancer","Died of other reasons","Unknown"],"right":["Died of cancer","Died of other reasons"],"data":{"added":[],"deleted":["Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })()"]}}},"survival_time":{"meta":{"displayName":{"left":"Survival Time","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })()"]},"range":{"left":{"exclusiveMin":0},"right":null}}},"height":{"valueType":{"left":"number","right":"integer"},"meta":{"displayName":{"left":"Height","right":null}},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"weight":{"valueType":{"left":"number","right":"integer"},"meta":{"displayName":{"left":"Weight","right":null}},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"bmi":{"valueType":{"left":"number","right":"integer"},"meta":{"displayName":{"left":"BMI","right":null}},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"menopause_status":{"description":{"left":"Indicate the donor's menopause status at the time of primary diagnosis. (Reference: caDSR CDE ID 2434914)","right":"Indicate the donor's menopause status at the time of primary diagnosis. (Codelist reference: NCI CDE ID: 2434914)"},"meta":{"displayName":{"left":"Menopause Status","right":null}},"restrictions":{"codeList":{"left":["Not applicable","Perimenopausal","Postmenopausal","Premenopausal","Unknown"],"right":["Premenopausal","Perimenopausal","Postmenopausal","Indeterminate or unknown","Not applicable"],"data":{"added":["Indeterminate or unknown"],"deleted":["Unknown"]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)","right":"Indicate the donor's age of menarche, the first occurrence of menstruation."},"meta":{"displayName":{"left":"Age at Menarche","right":null}},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"number_of_pregnancies":{"description":{"left":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)","right":"Indicate the number of pregnancies a donor has had."},"meta":{"displayName":{"left":"Number of Pregnancies","right":null}},"restrictions":{"range":{"left":{"min":0},"right":null}}},"number_of_children":{"description":{"left":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)","right":"Indicate the number of children the donor has birthed."},"meta":{"displayName":{"left":"Number of Children","right":null}},"restrictions":{"range":{"left":{"min":0},"right":null}}}},"created":{"prior_malignancy":{"changeType":"created","description":"Prior malignancy affecting donor.","name":"prior_malignancy","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string"},"cancer_type_prior_malignancy":{"changeType":"created","description":"ICD-10 diagnostic code for type of cancer in a prior malignancy.","name":"cancer_type_prior_malignancy","restrictions":{"regex":"[A-Z]{1}[0-9]{2}.[0-9]{0,3}[A-Z]{0,1}$"},"valueType":"string"},"age_at_prior_malignancy":{"changeType":"created","description":"If donor has history of prior malignancy, indicate age at previous diagnosis, in years.","name":"age_at_prior_malignancy","valueType":"integer"},"laterality_of_prior_malignancy":{"changeType":"created","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis.","name":"laterality_of_prior_malignancy","valueType":"string"}},"deleted":{"primary_site":{"changeType":"deleted","name":"primary_site","valueType":"string","isArray":true,"description":"The text term used to describe the primary site of disease, as categorized by the World Health Organization's (WHO) International Classification of Diseases for Oncology (ICD-O). This categorization groups cases into general categories.","meta":{"displayName":"Primary Site","core":true,"notes":"To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Breast|Ovary"},"restrictions":{"required":true,"codeList":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"]}},"genetic_disorders":{"changeType":"deleted","description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},"hrt_type":{"changeType":"deleted","description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},"hrt_duration":{"changeType":"deleted","description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},"contraception_type":{"changeType":"deleted","description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},"contraception_duration":{"changeType":"deleted","description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},"lost_to_followup_after_clinical_event_id":{"changeType":"deleted","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}}},"specimen":{"updated":{"program_id":{"meta":{"displayName":{"left":"Program ID","right":null}}},"submitter_donor_id":{"meta":{"displayName":{"left":"Submitter Donor ID","right":null}}},"submitter_specimen_id":{"meta":{"displayName":{"left":"Submitter Specimen ID","right":null}}},"pathological_tumour_staging_system":{"meta":{"validationDependency":{"left":true,"right":null},"displayName":{"left":"Pathological Tumour Staging System","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate() {\n\n let result = {valid: true, message: \"Ok\"};\n \n /* This is not a required field, so first ensure that it exists */\n if ($field){\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name.trim().toLowerCase().split('_tumour_staging_system')[0];\n /* Perform validation only if an AJCC value was selected */\n if (/^(AJCC)\\b/i.test($field)){\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`\n ];\n const convertedRow = Object.fromEntries(Object.entries($row).map(([fieldName,fieldVal]) => [fieldName.toLowerCase(), fieldVal]));\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(field => Object.keys(convertedRow).includes(field) && (!convertedRow[field] || checkforEmpty(convertedRow[field])))\n if (emptyFields.length){\n result = {valid: false, \"message\": `The following fields are required when ${$name} is set to an AJCC option: ${emptyFields}`};\n }\n }\n }\n return result;\n })()"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"data":{"added":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"deleted":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"]}}}},"pathological_t_category":{"meta":{"displayName":{"left":"Pathological T Category","right":null}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":null,"data":{"added":[],"deleted":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"]}}}},"pathological_n_category":{"meta":{"displayName":{"left":"Pathological N Category","right":null}},"restrictions":{"codeList":{"left":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"],"right":null,"data":{"added":[],"deleted":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"]}}}},"pathological_m_category":{"meta":{"displayName":{"left":"Pathological M Category","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":null,"data":{"added":[],"deleted":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"]}}}},"pathological_stage_group":{"description":{"left":"Specify the tumour stage, based on pathological_tumour_staging_system, used to assess the cancer at the time the tumour specimen was resected.","right":"Specify the tumour stage, based on tumor_staging_system, used to assess the cancer at the time the tumour specimen was resected."},"meta":{"notes":{"left":"This field depends on the selected pathological_tumour_staging_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","right":null},"displayName":{"left":"Pathological Stage Group","right":null}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":null,"data":{"added":[],"deleted":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":null}}},"specimen_acquisition_interval":{"meta":{"notes":{"left":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":null},"displayName":{"left":"Specimen Acquisition Interval","right":null}}},"tumour_histological_type":{"description":{"left":"The code to represent the histology (morphology) of neoplasms that is usually obtained from a pathology report, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","right":"The code to represent the histology (morphology) of neoplasms that is usually obtained from a pathology report, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Please refer to the guidelines provided in the ICD-O-3 manual at https://apps.who.int/iris/handle/10665/42344."},"meta":{"validationDependency":{"left":true,"right":null},"displayName":{"left":"Tumour Histological Type","right":null}}},"specimen_anatomic_location":{"description":{"left":"Indicate the ICD-O-3 topography code for the anatomic location of a specimen when it was collected. Refer to the guidelines provided in the ICD-O-3 manual at https://apps.who.int/iris/handle/10665/42344.","right":"Anatomic location of a specimen when it was collected."},"meta":{"displayName":{"left":"Specimen Anatomic Location","right":null},"examples":{"left":"C50.1,C18","right":null}},"restrictions":{"regex":{"left":"^[C][0-9]{2}(.[0-9]{1})?$","right":null},"codeList":{"right":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear, pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal; distal","Esophageal; mid","Esophageal; proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck, NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es), maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"],"data":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear, pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal; distal","Esophageal; mid","Esophageal; proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck, NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es), maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"]}}},"specimen_processing":{"meta":{"displayName":{"left":"Specimen Processing","right":null}},"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation, other","Formalin fixed & paraffin embedded","Formalin fixed, buffered","Formalin fixed, unbuffered","Fresh","Other"],"data":{"added":["Cryopreservation, other","Formalin fixed, buffered","Formalin fixed, unbuffered"],"deleted":["Cryopreservation - other","Formalin fixed - buffered","Formalin fixed - unbuffered","Unknown"]}}}},"specimen_storage":{"description":{"left":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured.","right":"Indicate the method of specimen storage for specimens that were not extracted freshly or immediately cultured."},"meta":{"displayName":{"left":"Specimen Storage","right":null}},"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"right":["Cut slide","Frozen, -70 freezer","Frozen, liquid nitrogen","Frozen, vapor phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"data":{"added":["Frozen, -70 freezer","Frozen, liquid nitrogen","Frozen, vapor phase"],"deleted":["Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Unknown"]}}}},"tumour_grading_system":{"meta":{"validationDependency":{"left":true,"right":null},"displayName":{"left":"Tumour Grading System","right":null}},"restrictions":{"codeList":{"left":["FNCLCC grading system","Four-tier grading system","Gleason grade group system","Grading system for GISTs","Grading system for GNETs","ISUP grading system","Nuclear grading system for DCIS","Scarff-Bloom-Richardson grading system","Three-tier grading system","Two-tier grading system","WHO grading system for CNS tumours"],"right":["Default","Gleason","Nottingham","Brain cancer","ISUP","Lymphoid neoplasms"],"data":{"added":["Default","Gleason","Nottingham","Brain cancer","ISUP","Lymphoid neoplasms"],"deleted":["FNCLCC grading system","Four-tier grading system","Gleason grade group system","Grading system for GISTs","Grading system for GNETs","ISUP grading system","Nuclear grading system for DCIS","Scarff-Bloom-Richardson grading system","Three-tier grading system","Two-tier grading system","WHO grading system for CNS tumours"]}}}},"tumour_grade":{"meta":{"notes":{"left":"This field depends on the selected tumour_grading_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Grading Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-grading-classifications","right":"This field depends on the selected tumour grading system."},"displayName":{"left":"Tumour Grade","right":null}},"restrictions":{"codeList":{"left":["Low grade","High grade","GX","G1","G2","G3","G4","Low","High","Grade I","Grade II","Grade III","Grade IV","Grade Group 1","Grade Group 2","Grade Group 3","Grade Group 4","Grade Group 5"],"data":["Low grade","High grade","GX","G1","G2","G3","G4","Low","High","Grade I","Grade II","Grade III","Grade IV","Grade Group 1","Grade Group 2","Grade Group 3","Grade Group 4","Grade Group 5"]},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'default':\n codeList = [\n 'gx - cannot be assessed',\n 'g1 well differentiated/low grade',\n 'g2 moderately differentiated/intermediated grade',\n 'g3 poorly differentiated/high grade',\n 'g4 undifferentiated/high grade',\n ];\n break;\n case 'gleason':\n codeList = [\n 'gleason x: gleason score cannot be determined',\n 'gleason 2–6: the tumor tissue is well differentiated',\n 'gleason 7: the tumor tissue is moderately differentiated',\n 'gleason 8–10: the tumor tissue is poorly differentiated or undifferentiated',\n ];\n break;\n case 'nottingham':\n codeList = [\n 'g1 (low grade or well differentiated)',\n 'g2 (intermediate grade or moderately differentiated)',\n 'g3 (high grade or poorly differentiated)',\n ];\n break;\n case 'brain cancer':\n codeList = ['grade i', 'grade ii', 'grade iii', 'grade iv'];\n break;\n case 'isup for renal cell carcinoma':\n codeList = [\n 'grade 1: tumor cell nucleoli invisible or small and basophilic at 400 x magnification',\n 'grade 2: tumor cell nucleoli conspicuous at 400 x magnification but inconspicuous at 100 x magnification',\n 'grade 3: tumor cell nucleoli eosinophilic and clearly visible at 100 x magnification',\n 'grade 4: tumors showing extreme nuclear pleomorphism and/or containing tumor giant cells and/or the presence of any proportion of tumor showing sarcomatoid and/or rhabdoid dedifferentiation',\n ];\n break;\n case 'lymphoid neoplasms':\n codeList = ['low grade or indolent nhl', 'high grade or aggressive nhl'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList.join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })()"]}}},"percent_tumour_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)","right":"Indicate a value, in decimals, that represents the percentage of infiltration by tumour cells in a specimen."},"meta":{"displayName":{"left":"Percent Tumour Cells","right":null}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null},"script":{"left":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"],"right":null}}},"percent_proliferating_cells":{"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"displayName":{"left":"Percent Proliferating Cells","right":null},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_inflammatory_tissue":{"description":{"left":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)","right":"Indicate a value, in decimals, that represents local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"displayName":{"left":"Percent Inflammatory Tissue","right":null},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_stromal_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)","right":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a malignant tumour specimen but are not malignant such as fibroblasts, vascular structures, etc."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"displayName":{"left":"Percent Stromal Cells","right":null},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_necrosis":{"description":{"left":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)","right":"Indicate a value, in decimals, that represents the percentage of cell death in a malignant tumour specimen."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"displayName":{"left":"Percent Necrosis","right":null},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}}},"created":{"central_pathology_confirmed":{"changeType":"created","name":"central_pathology_confirmed","description":"Indicate whether the histologic description of tissue or cells was confirmed by a pathology review of frozen or formalin fixed slide(s) completed after the diagnostic pathology review of the tumour sample used to extract analyte(s).","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour."},"restrictions":{"codeList":["Yes","No","Unknown"]}}},"deleted":{"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate the primary diagnosis event in the clinical timeline that this specimen acquisition was related to.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"specimen_laterality":{"changeType":"deleted","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"reference_pathology_confirmed":{"changeType":"deleted","name":"reference_pathology_confirmed","description":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)","valueType":"string","meta":{"validationDependency":true,"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Reference Pathology Confirmed"},"restrictions":{"codeList":["Yes","No","Unknown"]}},"percent_tumour_cells_measurement_method":{"changeType":"deleted","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}}},"primary_diagnosis":{"updated":{"program_id":{"meta":{"displayName":{"left":"Program ID","right":null}}},"submitter_donor_id":{"meta":{"displayName":{"left":"Submitter Donor ID","right":null}}},"age_at_diagnosis":{"description":{"left":"Age that the donor was first diagnosed with cancer, in years. This should be based on the earliest diagnosis of cancer.","right":"Age that the donor was first diagnosed with cancer, in years."},"meta":{"displayName":{"left":"Age at Diagnosis","right":null}},"restrictions":{"range":{"left":{"exclusiveMin":0,"max":90},"right":null}}},"cancer_type_code":{"description":{"left":"The code to represent the cancer type using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","right":"The code to represent the cancer type using the WHO ICD-10 code (https://icd.who.int/browse10/2016/en#/) classification."},"meta":{"examples":{"left":"C41.1,C16.9,C00.5,D46.9","right":null},"displayName":{"left":"Cancer Type Code","right":null}},"restrictions":{"regex":{"left":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","right":"[A-Z]{1}[0-9]{2}.[0-9]{0,3}[A-Z]{0,1}$"}}},"number_lymph_nodes_examined":{"description":{"left":"The total number of lymph nodes tested for the presence of cancer. (Reference: caDSR CDE ID 3)","right":"The total number of lymph nodes tested for the presence of cancer. (Reference: NCI CDE ID: 3)"},"meta":{"displayName":{"left":"Number Of Lymph Nodes Examined","right":null},"dependsOn":{"left":"primary_diagnosis.lymph_nodes_examined_status","right":null},"notes":{"left":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":null},"range":{"left":{"min":0},"right":null}}},"number_lymph_nodes_positive":{"description":{"left":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: caDSR CDE ID 6113694)","right":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: NCI CDE ID: 6113694)"},"meta":{"displayName":{"left":"Number Of Lymph Nodes Positive","right":null},"dependsOn":{"left":"primary_diagnosis.lymph_nodes_examined_status","right":null},"notes":{"left":"This field is only required if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":null},"range":{"left":{"min":0},"right":null},"required":{"left":null,"right":true}}},"clinical_tumour_staging_system":{"meta":{"validationDependency":{"left":true,"right":null},"displayName":{"left":"Clinical Tumour Staging System","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate() {\n\n let result = {valid: true, message: \"Ok\"};\n \n /* This is not a required field, so first ensure that it exists */\n if ($field){\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name.trim().toLowerCase().split('_tumour_staging_system')[0];\n /* Perform validation only if an AJCC value was selected */\n if (/^(AJCC)\\b/i.test($field)){\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`\n ];\n const convertedRow = Object.fromEntries(Object.entries($row).map(([fieldName,fieldVal]) => [fieldName.toLowerCase(), fieldVal]));\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(field => Object.keys(convertedRow).includes(field) && (!convertedRow[field] || checkforEmpty(convertedRow[field])))\n if (emptyFields.length){\n result = {valid: false, \"message\": `The following fields are required when ${$name} is set to an AJCC option: ${emptyFields}`};\n }\n }\n }\n return result;\n })()"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"data":{"added":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"deleted":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"]}},"required":{"left":null,"right":true}}},"clinical_t_category":{"meta":{"displayName":{"left":"Clinical T Category","right":null}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":null,"data":{"added":[],"deleted":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"]}}}},"clinical_n_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"displayName":{"left":"Clinical N Category","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"],"right":null,"data":{"added":[],"deleted":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"]}}}},"clinical_m_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned.","right":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned."},"meta":{"displayName":{"left":"Clinical M Category","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":null,"data":{"added":[],"deleted":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"]}}}},"clinical_stage_group":{"description":{"left":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage.","right":"Stage group of the tumour, as assigned by the reporting tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.)."},"meta":{"notes":{"left":"This field is dependent on the selected clinical_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","right":null},"displayName":{"left":"Clinical Stage Group","right":null},"examples":{"left":"Stage I, Stage IIB","right":null}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"presenting_symptoms":{"meta":{"displayName":{"left":"Presenting Symptoms","right":null},"notes":{"left":"To include multiple values, separate values with a pipe delimiter '|' within your file.","right":null},"examples":{"left":"Anemia|Bloating|Diabetes","right":null}},"restrictions":{"codeList":{"left":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Loss of Appetite","Nausea","None","Not Reported","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Swelling in the Neck","Unknown","Vomiting","Weight Loss"],"right":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Nausea","None","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Unknown","Vomiting","Weight Loss"],"data":{"added":[],"deleted":["Loss of Appetite","Not Reported","Swelling in the Neck"]}}}},"performance_status":{"description":{"left":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status).","right":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference source: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status)."},"meta":{"notes":{"left":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction.\nGrade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work).\nGrade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours.\nGrade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours.\nGrade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair","right":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction \n Grade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work) \n Grade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours \n Grade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours \n Grade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair"},"displayName":{"left":"Performance Status","right":null}},"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"data":{"added":[],"deleted":["Unknown"]}}}}},"created":{"stage_suffix":{"changeType":"created","name":"stage_suffix","description":"If necessary, use this field to add any applicable stage suffixes. Stage suffixes may apply to certain staging systems such as Ann Arbour staging system where the four stages are divided into 4 categories (A, B, X and E).","valueType":"string","meta":{"core":true,"dependsOn":"primary_diagnosis.clinical_tumour_staging_system"}}},"deleted":{"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Unique identifier of the primary diagnosis event, assigned by the data provider.","meta":{"primaryId":true,"displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"cancer_type_additional_information":{"changeType":"deleted","name":"cancer_type_additional_information","valueType":"string","description":"Additional details related to the cancer type that are not covered by the ICD-10 code provided in the cancer_type field.","meta":{"displayName":"Cancer Type Additional Information"}},"basis_of_diagnosis":{"changeType":"deleted","name":"basis_of_diagnosis","description":"Indicate the most valid basis of how the primary diagnosis was identified. If more than one diagnosis technique was used, select the term that has the highest code number (see notes). (Reference: IACR Standard for Basis of Diagnosis http://www.iacr.com.fr/images/doc/basis.pdf)","restrictions":{"codeList":["Clinical investigation","Clinical","Cytology","Death certificate only","Histology of a metastasis","Histology of a primary tumour","Specific tumour markers","Unknown"]},"valueType":"string","meta":{"notes":"0: Death certificate only: Information provided is from a death certificate.\n1: Clinical: Diagnosis made before death.\n2: Clinical investigation: All diagnostic techniques, including X-ray, endoscopy, imaging, ultrasound, exploratory surgery (such as laparotomy), and autopsy, without a tissue diagnosis.\n4: Specific tumour markers: Including biochemical and/or immunologic markers that are specific for a tumour site.\n5: Cytology: Examination of cells from a primary or secondary site, including fluids aspirated by endoscopy or needle; also includes the microscopic examination of peripheral blood and bone marrow aspirates.\n6: Histology of a metastasis: Histologic examination of tissue from a metastasis, including autopsy specimens.\n7: Histology of a primary tumour: Histologic examination of tissue from primary tumour, however obtained, including all cutting techniques and bone marrow biopsies; also includes autopsy specimens of primary tumour.\n9: Unknown: No information on how the diagnosis has been made.","displayName":"Basis of Diagnosis"}},"laterality":{"changeType":"deleted","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_status":{"changeType":"deleted","name":"lymph_nodes_examined_status","description":"Indicate if lymph nodes were examined for metastases.","valueType":"string","restrictions":{"required":true,"codeList":["Cannot be determined","No","No lymph nodes found in resected specimen","Not applicable","Yes"]},"meta":{"core":true,"displayName":"Lymph Nodes Examined Status"}},"lymph_nodes_examined_method":{"changeType":"deleted","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}}},"treatment":{"updated":{"program_id":{"meta":{"displayName":{"left":"Program ID","right":null}}},"submitter_donor_id":{"meta":{"displayName":{"left":"Submitter Donor ID","right":null}}},"submitter_treatment_id":{"meta":{"displayName":{"left":"Submitter Treatment ID","right":null}}},"treatment_type":{"meta":{"notes":{"left":"Depending on the treatment_type(s) selected, additional treatment details may be required to be submitted. For example, if treatment_type includes 'Chemotherapy', the supplemental Chemotherapy treatment type file is required.\nTo include multiple values, separate values with a pipe delimiter '|' within your file.","right":"Depending on the treatment_type selected, additional treament details may be required to be submitted."},"displayName":{"left":"Treatment Type","right":null},"examples":{"left":"Chemotherapy|Hormonal therapy","right":null}},"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Chemotherapy","Ablation","Bone marrow transplant","Combined chemo+immunotherapy","Combined chemo+radiation therapy","Combined chemo-radiotherapy and surgery","Endoscopic therapy","Hormonal therapy","Immunotherapy","Monoclonal antibodies (for liquid tumours)","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgical resection"],"data":{"added":["Combined chemo+immunotherapy","Combined chemo+radiation therapy","Combined chemo-radiotherapy and surgery","Monoclonal antibodies (for liquid tumours)","Surgical resection"],"deleted":["End of life care","Surgery"]}}}},"is_primary_treatment":{"description":{"left":"Indicate if the treatment was the primary treatment following the initial diagnosis.","right":"Indicate if the treamtment was the primary treatment following the initial diagnosis."},"meta":{"displayName":{"left":"Is Primary Treatment","right":null},"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"codeList":{"left":["Yes","No"],"right":["Yes","No","Unknown"],"data":{"added":["Unknown"],"deleted":[]}},"required":{"left":null,"right":true}}},"treatment_start_interval":{"description":{"left":"The interval between the primary diagnosis and initiation of treatment, in days.","right":"The interval between primary diagnosis and initiation of treatment, in days."},"meta":{"notes":{"left":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":null},"displayName":{"left":"Treatment Start Interval","right":null},"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"treatment_duration":{"description":{"left":"The duration of treatment regimen, in days.","right":"The duration of treatment regimen, in days"},"meta":{"displayName":{"left":"Treatment Duration","right":null},"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null},"required":{"left":null,"right":true}}}},"created":{"age_at_consent_for_treatment":{"changeType":"created","name":"age_at_consent_for_treatment","description":"Indicate the age of donor when consent was given for treatment.","valueType":"integer"},"therapeutic_intent":{"changeType":"created","name":"therapeutic_intent","description":"The therapeutic intent, the reason behind the choice of a therapy, of the treatment.","valueType":"string","restrictions":{"required":true,"codeList":["Adjuvant","Concurrent","Curative","Neoadjuvant","Not applicable","Palliative","Unknown"]},"meta":{"core":true}},"response_to_therapy":{"changeType":"created","name":"response_to_therapy","description":"The donors's response to the applied treatment regimen. (Source: RECIST)","valueType":"string","restrictions":{"required":true,"codeList":["Complete response","Disease progression","NED","Partial response","Stable disease"]},"meta":{"core":true}}},"deleted":{"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate the primary diagnosis event in the clinical timeline that this treatment was related to.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"line_of_treatment":{"changeType":"deleted","name":"line_of_treatment","description":"Indicate the line of treatment if it is not the primary treatment.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Line Of treatment","dependsOn":"treatment.is_primary_treatment","examples":"2,3,4"}},"days_per_cycle":{"changeType":"deleted","name":"days_per_cycle","description":"Indicate the number of days in a treatment cycle.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Days Per Cycle","dependsOn":"treatment.treatment_type"}},"number_of_cycles":{"changeType":"deleted","name":"number_of_cycles","description":"Indicate the number of treatment cycles.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Number Of Cycles","dependsOn":"treatment.treatment_type"}},"treatment_intent":{"changeType":"deleted","name":"treatment_intent","description":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"]},"meta":{"core":true,"displayName":"Treatment Intent","dependsOn":"treatment.treatment_type"}},"treatment_setting":{"changeType":"deleted","name":"treatment_setting","description":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: NCIt C124308)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"]},"meta":{"core":true,"displayName":"Treatment Setting","dependsOn":"treatment.treatment_type"}},"response_to_treatment_criteria_method":{"changeType":"deleted","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},"response_to_treatment":{"changeType":"deleted","name":"response_to_treatment","description":"The donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"codeList":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"]},"meta":{"core":true,"displayName":"Response To Treatment","dependsOn":"treatment.response_to_treatment_criteria_method","notes":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"outcome_of_treatment":{"changeType":"deleted","name":"outcome_of_treatment","description":"Indicate the donor's outcome of the prescribed treatment.","valueType":"string","restrictions":{"codeList":["Treatment completed as prescribed","Treatment incomplete due to technical or organizational problems","Treatment incomplete because patient died","Patient choice (stopped or interrupted treatment)","Physician decision (stopped or interrupted treatment)","Treatment stopped due to lack of efficacy (disease progression)","Treatment stopped due to acute toxicity","Other","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Outcome Of Treatment","dependsOn":"treatment.treatment_type"}},"toxicity_type":{"changeType":"deleted","name":"toxicity_type","description":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity.","valueType":"string","restrictions":{"codeList":["Hematological","Non-hematological","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Toxicity Type","dependsOn":"treatment.outcome_of_treatment"}},"hematological_toxicity":{"changeType":"deleted","name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"non-hematological_toxicity":{"changeType":"deleted","name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"adverse_events":{"changeType":"deleted","name":"adverse_events","description":"Report any treatment related adverse events. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Adverse Events","dependsOn":"treatment.treatment_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"clinical_trials_database":{"changeType":"deleted","name":"clinical_trials_database","description":"If the donor is a participant in a clinical trial, indicate the clinical trial database where the clinical trial is registered.","valueType":"string","meta":{"display name":"Clinical Trials Database","notes":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added."},"restrictions":{"codeList":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"]}},"clinical_trial_number":{"changeType":"deleted","name":"clinical_trial_number","description":"Based on the clinical_trial_database, indicate the unique NCT or EudraCT clinical trial identifier of which the donor is a participant.","valueType":"string","meta":{"display name":"Clinical Trial Number","dependsOn":"treatment.clinical_trials_database","examples":"2016-002120-83,NCT02465060"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"]}}}},"chemotherapy":{"updated":{"program_id":{"meta":{"displayName":{"left":"Program ID","right":null}}},"submitter_donor_id":{"meta":{"displayName":{"left":"Submitter Donor ID","right":null}}},"submitter_treatment_id":{"meta":{"displayName":{"left":"Submitter Treatment ID","right":null}}}},"created":{"chemotherapy_drug_name":{"changeType":"created","name":"chemotherapy_drug_name","description":"Name of agent or drug administered to patient as part of the chemotherapy treatment regimen.","valueType":"string","restrictions":{"required":true,"codeList":["Placeholder list 1","Need list","Still need it"]},"meta":{"validationDependency":true,"core":true,"notes":"This field uses a controlled vocabulary gathered from the DrugBank database of drug names.","examples":"Allopurinol, Dronabinol, Sucralfate, Lapatinib"}},"chemotherapy_dosage_units":{"changeType":"created","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m²","IU/m²","µg/m²","g/m²","kg"]},"meta":{"core":true}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate the total drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"integer","restrictions":{"required":true},"meta":{"core":true}}},"deleted":{"drug_rxnormcui":{"changeType":"deleted","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"deleted","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"deleted","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"deleted","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"deleted","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"deleted","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}}},"hormone_therapy":{"updated":{"program_id":{"meta":{"displayName":{"left":"Program ID","right":null}}},"submitter_donor_id":{"meta":{"displayName":{"left":"Submitter Donor ID","right":null}}},"submitter_treatment_id":{"meta":{"displayName":{"left":"Submitter Treatment ID","right":null}}}},"created":{"hormone_therapy_drug_name":{"changeType":"created","name":"hormone_therapy_drug_name","description":"Name of agent or drug administered to patient as part of the hormone therapy treatment regimen.","valueType":"string","restrictions":{"required":true,"codeList":["Placeholder list 1","Need list","Still need it"]},"meta":{"validationDependency":true,"core":true,"notes":"This field uses a controlled vocabulary gathered from the DrugBank database of drug names."}},"hormone_drug_dosage_units":{"changeType":"created","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m²","IU/m²","µg/m²","g/m²","kg "]},"meta":{"core":true}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"integer","restrictions":{"required":true},"meta":{"core":true}}},"deleted":{"drug_rxnormcui":{"changeType":"deleted","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"deleted","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Hormone Therapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"deleted","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"radiation":{"updated":{"program_id":{"meta":{"displayName":{"left":"Program ID","right":null}}},"submitter_donor_id":{"meta":{"displayName":{"left":"Submitter Donor ID","right":null}}},"submitter_treatment_id":{"meta":{"displayName":{"left":"Submitter Treatment ID","right":null}}},"radiation_therapy_modality":{"meta":{"displayName":{"left":"Radiation Therapy Modality","right":null}}},"radiation_therapy_fractions":{"description":{"left":"Indicate the total number of fractions delivered as part of treatment.","right":"Indicate the number of total fractions delivered as part of treatment."},"meta":{"displayName":{"left":"Radiation Therapy Fractions","right":null}},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"radiation_therapy_dosage":{"valueType":{"left":"number","right":"integer"},"meta":{"displayName":{"left":"Radiation Therapy Dosage","right":null}},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"anatomical_site_irradiated":{"description":{"left":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)","right":"Indicate localization site where radiation therapy was administered."},"meta":{"displayName":{"left":"Anatomical Site Irradiated","right":null}},"restrictions":{"codeList":{"left":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"right":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"data":{"added":["Bone","Extremities","Head-Neck","Peritoneum"],"deleted":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"]}}}}},"created":{"application_form":{"changeType":"created","name":"application_form","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal (including Brachytherapy)"]},"meta":{"core":true}}},"deleted":{"radiation_therapy_type":{"changeType":"deleted","name":"radiation_therapy_type","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal"]},"meta":{"core":true,"displayName":"Type of Radiation Therapy","notes":"Internal application includes Brachytherapy."}},"radiation_boost":{"changeType":"deleted","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"deleted","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}}},"immunotherapy":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"immunotherapy_type":{"changeType":"deleted","name":"immunotherapy_type","valueType":"string","description":"Indicate the type of immunotherapy administered to donor.","meta":{"displayName":"Immunotherapy Type","core":true},"restrictions":{"required":true,"codeList":["Cell-based","Immune checkpoint inhibitors","Monoclonal antibodies other than immune checkpoint inhibitors","Other immunomodulatory substances"]}},"drug_rxnormcui":{"changeType":"deleted","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"deleted","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"deleted","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"surgery":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"deleted","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"deleted","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"deleted","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"deleted","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"deleted","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"deleted","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"deleted","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"deleted","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"deleted","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"deleted","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"deleted","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"deleted","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"deleted","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"deleted","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}}},"follow_up":{"updated":{"program_id":{"meta":{"displayName":{"left":"Program ID","right":null}}},"submitter_donor_id":{"meta":{"displayName":{"left":"Submitter Donor ID","right":null}}},"submitter_follow_up_id":{"description":{"left":"Unique identifier for a follow-up event in a donor's clinical record, assigned by the data provider.","right":"Unique identifier for a follow-up event in a donors clincal record, assigned by the data provider."},"meta":{"displayName":{"left":"Submitter Follow-Up ID","right":null}}},"interval_of_followup":{"description":{"left":"Interval from the primary diagnosis date to the follow-up date, in days.","right":"Interval from the primary diagnosis date to the follow up date, in days."},"meta":{"displayName":{"left":"Interval Of Follow-Up","right":null},"notes":{"left":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":null}}},"disease_status_at_followup":{"description":{"left":"Indicate the donor's disease status at time of follow-up. (Reference: RECIST)","right":"Indicate the donor's disease status at time of follow-up."},"meta":{"displayName":{"left":"Disease Status at Follow-Up","right":null}},"restrictions":{"codeList":{"left":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Progression NOS","Relapse or recurrence","Stable"],"right":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Relapse","Stable"],"data":{"added":["Relapse"],"deleted":["Progression NOS","Relapse or recurrence"]}}}},"relapse_type":{"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.","right":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse."},"displayName":{"left":"Relapse Type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":null}}},"relapse_interval":{"description":{"left":"If the donor was clinically disease free following primary treatment and then relapse or recurrence or progression (for liquid tumours) occurred afterwards, then this field will indicate the length of disease free interval, in days.","right":"If the donor was clinically disease free following primary treatment and then relapse or progression (for liquid tumours) occurred afterwards, then this field will indicate the length of disease free interval, in days."},"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.","right":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse."},"displayName":{"left":"Relapse Interval","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"]}}},"method_of_progression_status":{"description":{"left":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Reference: caDSR CDE ID 6161031)","right":"Indicate the method(s) used to confirm the donor's progression disease status. (Codelist reference: NCI CDE ID: 6161031)"},"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file.","right":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse."},"displayName":{"left":"Method Of Progression Status","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"]},"codeList":{"left":["Biomarker in liquid biopsy (e.g. tumour marker in blood or urine)","Biopsy","Blood draw","Bone marrow aspirate","Core biopsy","Cystoscopy","Cytology","Debulking","Diagnostic imaging","Dilation and curettage procedure","Enucleation","Excisional biopsy","Fine needle aspiration","Imaging","Incisional biopsy","Laparoscopy","Laparotomy","Other","Pap Smear","Pathologic review","Physical exam","Surgical resection","Thoracentesis","Ultrasound guided biopsy"],"right":["Autopsy","Biomarker in liquid biopsy (e.g. tumor marker in blood or urine)","Biopsy","Blood draw","Bone marrow aspirate","Core biopsy","Cystoscopy","Cytology","Debulking","Diagnostic imaging","Dilation and curettage procedure","Enucleation","Excisional biopsy","Fine needle aspiration","Imaging","Incisional biopsy","Laparoscopy","Laparotomy","Other","Pap Smear","Pathologic review","Physical exam","Surgical resection","Thoracentesis","Ultrasound guided biopsy"],"data":{"added":["Autopsy","Biomarker in liquid biopsy (e.g. tumor marker in blood or urine)"],"deleted":["Biomarker in liquid biopsy (e.g. tumour marker in blood or urine)"]}}}},"recurrence_tumour_staging_system":{"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.","right":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse."},"displayName":{"left":"Recurrance Tumour Staging System","right":null},"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"data":{"added":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"deleted":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n\n let result = {valid: true, message: \"Ok\"};\n \n /* This is not a required field, so first ensure that it exists */\n if ($field){\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name.trim().toLowerCase().split('_tumour_staging_system')[0];\n /* Perform validation only if an AJCC value was selected */\n if (/^(AJCC)\\b/i.test($field)){\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`\n ];\n const convertedRow = Object.fromEntries(Object.entries($row).map(([fieldName,fieldVal]) => [fieldName.toLowerCase(), fieldVal]));\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(field => Object.keys(convertedRow).includes(field) && (!convertedRow[field] || checkforEmpty(convertedRow[field])))\n if (emptyFields.length){\n result = {valid: false, \"message\": `The following fields are required when ${$name} is set to an AJCC option: ${emptyFields}`};\n }\n }\n }\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"]}}},"recurrence_t_category":{"description":{"left":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"displayName":{"left":"Recurrence T Category","right":null},"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":null,"data":{"added":[],"deleted":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"]}}}},"recurrence_n_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"displayName":{"left":"Recurrence N Category","right":null},"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"],"right":null,"data":{"added":[],"deleted":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"]}}}},"recurrence_m_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"displayName":{"left":"Recurrence M Category","right":null},"core":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":null,"data":{"added":[],"deleted":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"]}}}},"recurrence_stage_group":{"description":{"left":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) at the time of retreatment for a recurrence or disease progression.","right":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery."},"meta":{"notes":{"left":"This field is dependent on the selected recurrence_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","right":null},"displayName":{"left":"Recurrence Stage Group","right":null},"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":null,"data":{"added":[],"deleted":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":null}}},"posttherapy_tumour_staging_system":{"meta":{"displayName":{"left":"Post-therapy Tumour Staging System","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate() {\n\n let result = {valid: true, message: \"Ok\"};\n \n /* This is not a required field, so first ensure that it exists */\n if ($field){\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name.trim().toLowerCase().split('_tumour_staging_system')[0];\n /* Perform validation only if an AJCC value was selected */\n if (/^(AJCC)\\b/i.test($field)){\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`\n ];\n const convertedRow = Object.fromEntries(Object.entries($row).map(([fieldName,fieldVal]) => [fieldName.toLowerCase(), fieldVal]));\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(field => Object.keys(convertedRow).includes(field) && (!convertedRow[field] || checkforEmpty(convertedRow[field])))\n if (emptyFields.length){\n result = {valid: false, \"message\": `The following fields are required when ${$name} is set to an AJCC option: ${emptyFields}`};\n }\n }\n }\n return result;\n })()"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"data":{"added":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"deleted":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"]}}}},"posttherapy_t_category":{"meta":{"dependsOn":{"left":"follow_up.posttherapy_tumour_staging_system","right":"follow_up.post_therapy_tumour_staging_system"},"displayName":{"left":"Post-therapy T Category","right":null}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":null,"data":{"added":[],"deleted":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"]}}}},"posttherapy_n_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"dependsOn":{"left":"follow_up.posttherapy_tumour_staging_system","right":"follow_up.post_therapy_tumour_staging_system"},"displayName":{"left":"Post-therapy N Category","right":null}},"restrictions":{"codeList":{"left":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"],"right":null,"data":{"added":[],"deleted":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"]}}}},"posttherapy_m_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"dependsOn":{"left":"follow_up.posttherapy_tumour_staging_system","right":"follow_up.post_therapy_tumour_staging_system"},"displayName":{"left":"Post-therapy M Category","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":null,"data":{"added":[],"deleted":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"]}}}},"posttherapy_stage_group":{"meta":{"dependsOn":{"left":"follow_up.posttherapy_tumour_staging_system","right":"follow_up.post_therapy_tumour_staging_system"},"notes":{"left":"This field is dependent on the selected posttherapy_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","right":"This field value is dependent on the selected posttherapy_tumour_staging_system."},"displayName":{"left":"Post-therapy Stage Group","right":null}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":null,"data":{"added":[],"deleted":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":null}}}},"created":{"anatomic_site_progression_or_recurrences":{"changeType":"created","description":"Indicate the anatomic site where disease progression or recurrence occurred. (Codelist reference: NCI CDE ID: 4742851)","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"],"codeList":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear, pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal; distal","Esophageal; mid","Esophageal; proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck, NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es), maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"]},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","notes":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse."}}},"deleted":{"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate if the follow-up is related to a specific primary diagnosis event in the clinical timeline.","meta":{"validationDependency":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID","primaryId":true},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"Indicate if the follow-up is related to a specific treatment event in the clinical timeline.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"weight_at_followup":{"changeType":"deleted","description":"Indicate the donor's weight, in kilograms (kg), at the time of follow-up.","name":"weight_at_followup","valueType":"number","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Weight at Follow-Up"}},"anatomic_site_progression_or_recurrence":{"changeType":"deleted","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"exposure":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"deleted","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"deleted","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"deleted","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"deleted","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"deleted","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"deleted","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"deleted","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"deleted","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"deleted","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"deleted","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"deleted","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}}},"family_history":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"family_relative_id":{"changeType":"deleted","description":"Unique identifier of the relative, assigned by the data provider.","name":"family_relative_id","valueType":"string","meta":{"displayName":"Family Relative ID","primaryId":true,"notes":"This field is required to ensure that family members are identified in unique records. Ids can be as simple as an incremented numeral to ensure uniqueness."},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"relative_with_cancer_history":{"changeType":"deleted","description":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","name":"relative_with_cancer_history","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Relative with Cancer History"}},"relationship_type":{"changeType":"deleted","description":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","name":"relationship_type","restrictions":{"codeList":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"]},"valueType":"string","meta":{"displayName":"Relationship Type"}},"gender_of_relative":{"changeType":"deleted","description":"The self-reported gender of related individual.","name":"gender_of_relative","restrictions":{"codeList":["Female","Male","Other","Unknown"]},"valueType":"string","meta":{"displayName":"Gender of Relative"}},"age_of_relative_at_diagnosis":{"changeType":"deleted","description":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","name":"age_of_relative_at_diagnosis","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","displayName":"Age Of Relative At Diagnosis"}},"cancer_type_code_of_relative":{"changeType":"deleted","name":"cancer_type_code_of_relative","valueType":"string","description":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"examples":"C41.1,C16.9,C00.5,D46.9","dependsOn":"family_history.relative_with_cancer_history","displayName":"Cancer Type Code (ICD-10) of Relative"}},"relative_vital_status":{"changeType":"deleted","description":"Relative's last known state of living or deceased.","name":"relative_vital_status","restrictions":{"codeList":["Alive","Deceased","Unknown"]},"valueType":"string","meta":{"displayName":"Vital Status of Relative"}},"cause_of_death_of_relative":{"changeType":"deleted","description":"Indicate the cause of the death of the relative.","name":"cause_of_death_of_relative","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]},"valueType":"string","meta":{"dependsOn":"family_history.relative_vital_status","displayName":"Cause of Death of Relative"}},"relative_survival_time":{"changeType":"deleted","description":"Indicate how long, in days, the relative survived from the time they were diagnosed with cancer.","name":"relative_survival_time","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","units":"days","displayName":"Survival Time Of Relative"}}}},"biomarker":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"deleted","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"deleted","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"deleted","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"deleted","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"deleted","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"deleted","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"deleted","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"deleted","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"deleted","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"deleted","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"deleted","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"deleted","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"deleted","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"deleted","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"deleted","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"deleted","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}}},"comorbidity":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"deleted","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"deleted","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"deleted","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"deleted","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"deleted","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"deleted","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}}}}} diff --git a/scripts/data/schemas/diffs/1.24/1.24-diff-0.6.json b/scripts/data/schemas/diffs/1.24/1.24-diff-0.6.json new file mode 100644 index 00000000..0ab1faa1 --- /dev/null +++ b/scripts/data/schemas/diffs/1.24/1.24-diff-0.6.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"program_id":{"meta":{"examples":{"left":"TEST-CA","right":"PACA-AU,BR-CA"},"notes":{"left":"This is the unique id that is assigned to your program. If you have logged into the platform, this is the Program Id that you see in the Program Services area. For example, TEST-CA is a Program ID.","right":null},"displayName":{"left":"Program ID","right":null}}},"submitter_donor_id":{"meta":{"displayName":{"left":"Submitter Donor ID","right":null}}},"gender":{"meta":{"displayName":{"left":"Gender","right":null}}},"submitter_specimen_id":{"meta":{"displayName":{"left":"Submitter Specimen ID","right":null}}},"specimen_tissue_source":{"meta":{"displayName":{"left":"Specimen Tissue Source","right":null}}},"tumour_normal_designation":{"meta":{"displayName":{"left":"Tumour Normal Designation","right":null}}},"specimen_type":{"meta":{"displayName":{"left":"Specimen Type","right":null}},"restrictions":{"codeList":{"left":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Normal","Normal - tissue adjacent to primary tumour","Primary tumour","Primary tumour - adjacent to normal","Primary tumour - additional new primary","Recurrent tumour","Metastatic tumour","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour - additional metastatic","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line","Cell line - derived from xenograft tumour","Cell line - derived from tumour","Cell line - derived from normal"],"data":{"added":[],"deleted":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n\n const row = $row;\n let result = {valid: true, message: \"Ok\"};\n \n const designation = row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\"){\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when tumour_normal_designation is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when tumour_normal_designation is set to Tumour.\"};\n }\n }\n return result;\n })()"]}}},"submitter_sample_id":{"meta":{"displayName":{"left":"Submitter Sample ID","right":null}}},"sample_type":{"meta":{"displayName":{"left":"Sample Type","right":null}}}},"created":{},"deleted":{}},"donor":{"updated":{"program_id":{"meta":{"displayName":{"left":"Program ID","right":null}}},"submitter_donor_id":{"meta":{"displayName":{"left":"Submitter Donor ID","right":null}}},"vital_status":{"meta":{"displayName":{"left":"Vital Status","right":null}},"restrictions":{"codeList":{"left":["Alive","Deceased"],"right":["Alive","Deceased","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"cause_of_death":{"meta":{"displayName":{"left":"Cause of Death","right":null}},"restrictions":{"codeList":{"left":["Died of cancer","Died of other reasons","Unknown"],"right":["Died of cancer","Died of other reasons"],"data":{"added":[],"deleted":["Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })()"]}}},"survival_time":{"meta":{"displayName":{"left":"Survival Time","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })()"]},"range":{"left":{"exclusiveMin":0},"right":null}}},"height":{"valueType":{"left":"number","right":"integer"},"meta":{"displayName":{"left":"Height","right":null}},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"weight":{"valueType":{"left":"number","right":"integer"},"meta":{"displayName":{"left":"Weight","right":null}},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"bmi":{"valueType":{"left":"number","right":"integer"},"meta":{"displayName":{"left":"BMI","right":null}},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"menopause_status":{"description":{"left":"Indicate the donor's menopause status at the time of primary diagnosis. (Reference: caDSR CDE ID 2434914)","right":"Indicate the donor's menopause status at the time of primary diagnosis. (Codelist reference: NCI CDE ID: 2434914)"},"meta":{"displayName":{"left":"Menopause Status","right":null}},"restrictions":{"codeList":{"left":["Not applicable","Perimenopausal","Postmenopausal","Premenopausal","Unknown"],"right":["Premenopausal","Perimenopausal","Postmenopausal","Indeterminate or unknown","Not applicable"],"data":{"added":["Indeterminate or unknown"],"deleted":["Unknown"]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)","right":"Indicate the donor's age of menarche, the first occurrence of menstruation."},"meta":{"displayName":{"left":"Age at Menarche","right":null}},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"number_of_pregnancies":{"description":{"left":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)","right":"Indicate the number of pregnancies a donor has had."},"meta":{"displayName":{"left":"Number of Pregnancies","right":null}},"restrictions":{"range":{"left":{"min":0},"right":null}}},"number_of_children":{"description":{"left":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)","right":"Indicate the number of children the donor has birthed."},"meta":{"displayName":{"left":"Number of Children","right":null}},"restrictions":{"range":{"left":{"min":0},"right":null}}}},"created":{"prior_malignancy":{"changeType":"created","description":"Prior malignancy affecting donor.","name":"prior_malignancy","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string"},"cancer_type_prior_malignancy":{"changeType":"created","description":"ICD-10 diagnostic code for type of cancer in a prior malignancy.","name":"cancer_type_prior_malignancy","restrictions":{"regex":"[A-Z]{1}[0-9]{2}.[0-9]{0,3}[A-Z]{0,1}$"},"valueType":"string"},"age_at_prior_malignancy":{"changeType":"created","description":"If donor has history of prior malignancy, indicate age at previous diagnosis, in years.","name":"age_at_prior_malignancy","valueType":"integer"},"laterality_of_prior_malignancy":{"changeType":"created","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis.","name":"laterality_of_prior_malignancy","valueType":"string"}},"deleted":{"primary_site":{"changeType":"deleted","name":"primary_site","valueType":"string","isArray":true,"description":"The text term used to describe the primary site of disease, as categorized by the World Health Organization's (WHO) International Classification of Diseases for Oncology (ICD-O). This categorization groups cases into general categories.","meta":{"displayName":"Primary Site","core":true,"notes":"To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Breast|Ovary"},"restrictions":{"required":true,"codeList":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"]}},"genetic_disorders":{"changeType":"deleted","description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},"hrt_type":{"changeType":"deleted","description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},"hrt_duration":{"changeType":"deleted","description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},"contraception_type":{"changeType":"deleted","description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},"contraception_duration":{"changeType":"deleted","description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},"lost_to_followup_after_clinical_event_id":{"changeType":"deleted","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}}},"specimen":{"updated":{"program_id":{"meta":{"displayName":{"left":"Program ID","right":null}}},"submitter_donor_id":{"meta":{"displayName":{"left":"Submitter Donor ID","right":null}}},"submitter_specimen_id":{"meta":{"displayName":{"left":"Submitter Specimen ID","right":null}}},"pathological_tumour_staging_system":{"meta":{"validationDependency":{"left":true,"right":null},"displayName":{"left":"Pathological Tumour Staging System","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate() {\n\n let result = {valid: true, message: \"Ok\"};\n \n /* This is not a required field, so first ensure that it exists */\n if ($field){\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name.trim().toLowerCase().split('_tumour_staging_system')[0];\n /* Perform validation only if an AJCC value was selected */\n if (/^(AJCC)\\b/i.test($field)){\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`\n ];\n const convertedRow = Object.fromEntries(Object.entries($row).map(([fieldName,fieldVal]) => [fieldName.toLowerCase(), fieldVal]));\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(field => Object.keys(convertedRow).includes(field) && (!convertedRow[field] || checkforEmpty(convertedRow[field])))\n if (emptyFields.length){\n result = {valid: false, \"message\": `The following fields are required when ${$name} is set to an AJCC option: ${emptyFields}`};\n }\n }\n }\n return result;\n })()"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"data":{"added":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"deleted":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"]}}}},"pathological_t_category":{"meta":{"displayName":{"left":"Pathological T Category","right":null}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":null,"data":{"added":[],"deleted":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"]}}}},"pathological_n_category":{"meta":{"displayName":{"left":"Pathological N Category","right":null}},"restrictions":{"codeList":{"left":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"],"right":null,"data":{"added":[],"deleted":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"]}}}},"pathological_m_category":{"meta":{"displayName":{"left":"Pathological M Category","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":null,"data":{"added":[],"deleted":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"]}}}},"pathological_stage_group":{"description":{"left":"Specify the tumour stage, based on pathological_tumour_staging_system, used to assess the cancer at the time the tumour specimen was resected.","right":"Specify the tumour stage, based on tumor_staging_system, used to assess the cancer at the time the tumour specimen was resected."},"meta":{"notes":{"left":"This field depends on the selected pathological_tumour_staging_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","right":"This field depends on the selected pathological staging system, and is only required if the specimen is a tumour."},"displayName":{"left":"Pathological Stage Group","right":null}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":null,"data":{"added":[],"deleted":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":null}}},"specimen_acquisition_interval":{"meta":{"notes":{"left":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":null},"displayName":{"left":"Specimen Acquisition Interval","right":null}}},"tumour_histological_type":{"description":{"left":"The code to represent the histology (morphology) of neoplasms that is usually obtained from a pathology report, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","right":"The code to represent the histology (morphology) of neoplasms that is usually obtained from a pathology report, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Please refer to the guidelines provided in the ICD-O-3 manual at https://apps.who.int/iris/handle/10665/42344."},"meta":{"validationDependency":{"left":true,"right":null},"displayName":{"left":"Tumour Histological Type","right":null}}},"specimen_anatomic_location":{"description":{"left":"Indicate the ICD-O-3 topography code for the anatomic location of a specimen when it was collected. Refer to the guidelines provided in the ICD-O-3 manual at https://apps.who.int/iris/handle/10665/42344.","right":"Anatomic location of a specimen when it was collected."},"meta":{"displayName":{"left":"Specimen Anatomic Location","right":null},"examples":{"left":"C50.1,C18","right":null}},"restrictions":{"regex":{"left":"^[C][0-9]{2}(.[0-9]{1})?$","right":null},"codeList":{"right":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear, pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal; distal","Esophageal; mid","Esophageal; proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck, NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es), maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"],"data":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear, pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal; distal","Esophageal; mid","Esophageal; proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck, NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es), maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"]}}},"specimen_processing":{"meta":{"displayName":{"left":"Specimen Processing","right":null}},"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation, other","Formalin fixed & paraffin embedded","Formalin fixed, buffered","Formalin fixed, unbuffered","Fresh","Other"],"data":{"added":["Cryopreservation, other","Formalin fixed, buffered","Formalin fixed, unbuffered"],"deleted":["Cryopreservation - other","Formalin fixed - buffered","Formalin fixed - unbuffered","Unknown"]}}}},"specimen_storage":{"description":{"left":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured.","right":"Indicate the method of specimen storage for specimens that were not extracted freshly or immediately cultured."},"meta":{"displayName":{"left":"Specimen Storage","right":null}},"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"right":["Cut slide","Frozen, -70 freezer","Frozen, liquid nitrogen","Frozen, vapor phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"data":{"added":["Frozen, -70 freezer","Frozen, liquid nitrogen","Frozen, vapor phase"],"deleted":["Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Unknown"]}}}},"tumour_grading_system":{"meta":{"validationDependency":{"left":true,"right":null},"displayName":{"left":"Tumour Grading System","right":null}},"restrictions":{"codeList":{"left":["FNCLCC grading system","Four-tier grading system","Gleason grade group system","Grading system for GISTs","Grading system for GNETs","ISUP grading system","Nuclear grading system for DCIS","Scarff-Bloom-Richardson grading system","Three-tier grading system","Two-tier grading system","WHO grading system for CNS tumours"],"right":["Default","Gleason","Nottingham","Brain cancer","ISUP","Lymphoid neoplasms"],"data":{"added":["Default","Gleason","Nottingham","Brain cancer","ISUP","Lymphoid neoplasms"],"deleted":["FNCLCC grading system","Four-tier grading system","Gleason grade group system","Grading system for GISTs","Grading system for GNETs","ISUP grading system","Nuclear grading system for DCIS","Scarff-Bloom-Richardson grading system","Three-tier grading system","Two-tier grading system","WHO grading system for CNS tumours"]}}}},"tumour_grade":{"meta":{"notes":{"left":"This field depends on the selected tumour_grading_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Grading Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-grading-classifications","right":"This field depends on the selected tumour grading system, and is only required if the specimen is a tumour."},"displayName":{"left":"Tumour Grade","right":null}},"restrictions":{"codeList":{"left":["Low grade","High grade","GX","G1","G2","G3","G4","Low","High","Grade I","Grade II","Grade III","Grade IV","Grade Group 1","Grade Group 2","Grade Group 3","Grade Group 4","Grade Group 5"],"data":["Low grade","High grade","GX","G1","G2","G3","G4","Low","High","Grade I","Grade II","Grade III","Grade IV","Grade Group 1","Grade Group 2","Grade Group 3","Grade Group 4","Grade Group 5"]},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'default':\n codeList = [\n 'gx - cannot be assessed',\n 'g1 well differentiated/low grade',\n 'g2 moderately differentiated/intermediated grade',\n 'g3 poorly differentiated/high grade',\n 'g4 undifferentiated/high grade',\n ];\n break;\n case 'gleason':\n codeList = [\n 'gleason x: gleason score cannot be determined',\n 'gleason 2–6: the tumor tissue is well differentiated',\n 'gleason 7: the tumor tissue is moderately differentiated',\n 'gleason 8–10: the tumor tissue is poorly differentiated or undifferentiated',\n ];\n break;\n case 'nottingham':\n codeList = [\n 'g1 (low grade or well differentiated)',\n 'g2 (intermediate grade or moderately differentiated)',\n 'g3 (high grade or poorly differentiated)',\n ];\n break;\n case 'brain cancer':\n codeList = ['grade i', 'grade ii', 'grade iii', 'grade iv'];\n break;\n case 'isup for renal cell carcinoma':\n codeList = [\n 'grade 1: tumor cell nucleoli invisible or small and basophilic at 400 x magnification',\n 'grade 2: tumor cell nucleoli conspicuous at 400 x magnification but inconspicuous at 100 x magnification',\n 'grade 3: tumor cell nucleoli eosinophilic and clearly visible at 100 x magnification',\n 'grade 4: tumors showing extreme nuclear pleomorphism and/or containing tumor giant cells and/or the presence of any proportion of tumor showing sarcomatoid and/or rhabdoid dedifferentiation',\n ];\n break;\n case 'lymphoid neoplasms':\n codeList = ['low grade or indolent nhl', 'high grade or aggressive nhl'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })()"]}}},"percent_tumour_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)","right":"Indicate a value, in decimals, that represents the percentage of infiltration by tumour cells in a specimen."},"meta":{"displayName":{"left":"Percent Tumour Cells","right":null}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null},"script":{"left":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"],"right":null}}},"percent_proliferating_cells":{"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"displayName":{"left":"Percent Proliferating Cells","right":null},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_inflammatory_tissue":{"description":{"left":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)","right":"Indicate a value, in decimals, that represents local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"displayName":{"left":"Percent Inflammatory Tissue","right":null},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_stromal_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)","right":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a malignant tumour specimen but are not malignant such as fibroblasts, vascular structures, etc."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"displayName":{"left":"Percent Stromal Cells","right":null},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_necrosis":{"description":{"left":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)","right":"Indicate a value, in decimals, that represents the percentage of cell death in a malignant tumour specimen."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"displayName":{"left":"Percent Necrosis","right":null},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}}},"created":{"central_pathology_confirmed":{"changeType":"created","name":"central_pathology_confirmed","description":"Indicate whether the histologic description of tissue or cells was confirmed by a pathology review of frozen or formalin fixed slide(s) completed after the diagnostic pathology review of the tumour sample used to extract analyte(s).","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour."},"restrictions":{"codeList":["Yes","No","Unknown"]}}},"deleted":{"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate the primary diagnosis event in the clinical timeline that this specimen acquisition was related to.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"specimen_laterality":{"changeType":"deleted","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"reference_pathology_confirmed":{"changeType":"deleted","name":"reference_pathology_confirmed","description":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)","valueType":"string","meta":{"validationDependency":true,"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Reference Pathology Confirmed"},"restrictions":{"codeList":["Yes","No","Unknown"]}},"percent_tumour_cells_measurement_method":{"changeType":"deleted","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}}},"primary_diagnosis":{"updated":{"program_id":{"meta":{"displayName":{"left":"Program ID","right":null}}},"submitter_donor_id":{"meta":{"displayName":{"left":"Submitter Donor ID","right":null}}},"age_at_diagnosis":{"description":{"left":"Age that the donor was first diagnosed with cancer, in years. This should be based on the earliest diagnosis of cancer.","right":"Age that the donor was first diagnosed with cancer, in years."},"meta":{"displayName":{"left":"Age at Diagnosis","right":null}},"restrictions":{"range":{"left":{"exclusiveMin":0,"max":90},"right":null}}},"cancer_type_code":{"description":{"left":"The code to represent the cancer type using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","right":"The code to represent the cancer type using the WHO ICD-10 code (https://icd.who.int/browse10/2016/en#/) classification."},"meta":{"examples":{"left":"C41.1,C16.9,C00.5,D46.9","right":"C41.1,C16.9,C00.543A"},"displayName":{"left":"Cancer Type Code","right":null}},"restrictions":{"regex":{"left":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","right":"^C[0-9]{2}.[0-9]{0,3}[A-Z]{0,1}$"}}},"number_lymph_nodes_examined":{"description":{"left":"The total number of lymph nodes tested for the presence of cancer. (Reference: caDSR CDE ID 3)","right":"The total number of lymph nodes tested for the presence of cancer. (Reference: NCI CDE ID: 3)"},"meta":{"displayName":{"left":"Number Of Lymph Nodes Examined","right":null},"dependsOn":{"left":"primary_diagnosis.lymph_nodes_examined_status","right":null},"notes":{"left":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":null},"range":{"left":{"min":0},"right":null}}},"number_lymph_nodes_positive":{"description":{"left":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: caDSR CDE ID 6113694)","right":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: NCI CDE ID: 6113694)"},"meta":{"displayName":{"left":"Number Of Lymph Nodes Positive","right":null},"dependsOn":{"left":"primary_diagnosis.lymph_nodes_examined_status","right":null},"notes":{"left":"This field is only required if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":null},"range":{"left":{"min":0},"right":null},"required":{"left":null,"right":true}}},"clinical_tumour_staging_system":{"meta":{"validationDependency":{"left":true,"right":null},"displayName":{"left":"Clinical Tumour Staging System","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate() {\n\n let result = {valid: true, message: \"Ok\"};\n \n /* This is not a required field, so first ensure that it exists */\n if ($field){\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name.trim().toLowerCase().split('_tumour_staging_system')[0];\n /* Perform validation only if an AJCC value was selected */\n if (/^(AJCC)\\b/i.test($field)){\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`\n ];\n const convertedRow = Object.fromEntries(Object.entries($row).map(([fieldName,fieldVal]) => [fieldName.toLowerCase(), fieldVal]));\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(field => Object.keys(convertedRow).includes(field) && (!convertedRow[field] || checkforEmpty(convertedRow[field])))\n if (emptyFields.length){\n result = {valid: false, \"message\": `The following fields are required when ${$name} is set to an AJCC option: ${emptyFields}`};\n }\n }\n }\n return result;\n })()"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"data":{"added":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"deleted":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"]}},"required":{"left":null,"right":true}}},"clinical_t_category":{"meta":{"displayName":{"left":"Clinical T Category","right":null}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":null,"data":{"added":[],"deleted":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"]}}}},"clinical_n_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"displayName":{"left":"Clinical N Category","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"],"right":null,"data":{"added":[],"deleted":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"]}}}},"clinical_m_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned.","right":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned."},"meta":{"displayName":{"left":"Clinical M Category","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":null,"data":{"added":[],"deleted":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"]}}}},"clinical_stage_group":{"description":{"left":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage.","right":"Stage group of the tumour, as assigned by the reporting tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.)."},"meta":{"notes":{"left":"This field is dependent on the selected clinical_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","right":null},"displayName":{"left":"Clinical Stage Group","right":null},"examples":{"left":"Stage I, Stage IIB","right":null}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"presenting_symptoms":{"meta":{"displayName":{"left":"Presenting Symptoms","right":null},"notes":{"left":"To include multiple values, separate values with a pipe delimiter '|' within your file.","right":null},"examples":{"left":"Anemia|Bloating|Diabetes","right":null}},"restrictions":{"codeList":{"left":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Loss of Appetite","Nausea","None","Not Reported","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Swelling in the Neck","Unknown","Vomiting","Weight Loss"],"right":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Nausea","None","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Unknown","Vomiting","Weight Loss"],"data":{"added":[],"deleted":["Loss of Appetite","Not Reported","Swelling in the Neck"]}}}},"performance_status":{"description":{"left":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status).","right":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference source: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status)."},"meta":{"notes":{"left":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction.\nGrade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work).\nGrade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours.\nGrade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours.\nGrade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair","right":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction \n Grade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work) \n Grade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours \n Grade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours \n Grade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair"},"displayName":{"left":"Performance Status","right":null}},"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"data":{"added":[],"deleted":["Unknown"]}}}}},"created":{"stage_suffix":{"changeType":"created","name":"stage_suffix","description":"If necessary, use this field to add any applicable stage suffixes. Stage suffixes may apply to certain staging systems such as Ann Arbour staging system where the four stages are divided into 4 categories (A, B, X and E).","valueType":"string","meta":{"core":true,"dependsOn":"primary_diagnosis.clinical_tumour_staging_system"}}},"deleted":{"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Unique identifier of the primary diagnosis event, assigned by the data provider.","meta":{"primaryId":true,"displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"cancer_type_additional_information":{"changeType":"deleted","name":"cancer_type_additional_information","valueType":"string","description":"Additional details related to the cancer type that are not covered by the ICD-10 code provided in the cancer_type field.","meta":{"displayName":"Cancer Type Additional Information"}},"basis_of_diagnosis":{"changeType":"deleted","name":"basis_of_diagnosis","description":"Indicate the most valid basis of how the primary diagnosis was identified. If more than one diagnosis technique was used, select the term that has the highest code number (see notes). (Reference: IACR Standard for Basis of Diagnosis http://www.iacr.com.fr/images/doc/basis.pdf)","restrictions":{"codeList":["Clinical investigation","Clinical","Cytology","Death certificate only","Histology of a metastasis","Histology of a primary tumour","Specific tumour markers","Unknown"]},"valueType":"string","meta":{"notes":"0: Death certificate only: Information provided is from a death certificate.\n1: Clinical: Diagnosis made before death.\n2: Clinical investigation: All diagnostic techniques, including X-ray, endoscopy, imaging, ultrasound, exploratory surgery (such as laparotomy), and autopsy, without a tissue diagnosis.\n4: Specific tumour markers: Including biochemical and/or immunologic markers that are specific for a tumour site.\n5: Cytology: Examination of cells from a primary or secondary site, including fluids aspirated by endoscopy or needle; also includes the microscopic examination of peripheral blood and bone marrow aspirates.\n6: Histology of a metastasis: Histologic examination of tissue from a metastasis, including autopsy specimens.\n7: Histology of a primary tumour: Histologic examination of tissue from primary tumour, however obtained, including all cutting techniques and bone marrow biopsies; also includes autopsy specimens of primary tumour.\n9: Unknown: No information on how the diagnosis has been made.","displayName":"Basis of Diagnosis"}},"laterality":{"changeType":"deleted","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_status":{"changeType":"deleted","name":"lymph_nodes_examined_status","description":"Indicate if lymph nodes were examined for metastases.","valueType":"string","restrictions":{"required":true,"codeList":["Cannot be determined","No","No lymph nodes found in resected specimen","Not applicable","Yes"]},"meta":{"core":true,"displayName":"Lymph Nodes Examined Status"}},"lymph_nodes_examined_method":{"changeType":"deleted","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}}},"treatment":{"updated":{"program_id":{"meta":{"displayName":{"left":"Program ID","right":null}}},"submitter_donor_id":{"meta":{"displayName":{"left":"Submitter Donor ID","right":null}}},"submitter_treatment_id":{"meta":{"displayName":{"left":"Submitter Treatment ID","right":null}}},"treatment_type":{"meta":{"notes":{"left":"Depending on the treatment_type(s) selected, additional treatment details may be required to be submitted. For example, if treatment_type includes 'Chemotherapy', the supplemental Chemotherapy treatment type file is required.\nTo include multiple values, separate values with a pipe delimiter '|' within your file.","right":"Depending on the treatment_type selected, additional treament details may be required to be submitted."},"displayName":{"left":"Treatment Type","right":null},"examples":{"left":"Chemotherapy|Hormonal therapy","right":null}},"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Chemotherapy","Ablation","Bone marrow transplant","Combined chemo+immunotherapy","Combined chemo+radiation therapy","Combined chemo-radiotherapy and surgery","Endoscopic therapy","Hormonal therapy","Immunotherapy","Monoclonal antibodies (for liquid tumours)","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgical resection"],"data":{"added":["Combined chemo+immunotherapy","Combined chemo+radiation therapy","Combined chemo-radiotherapy and surgery","Monoclonal antibodies (for liquid tumours)","Surgical resection"],"deleted":["End of life care","Surgery"]}}}},"is_primary_treatment":{"description":{"left":"Indicate if the treatment was the primary treatment following the initial diagnosis.","right":"Indicate if the treamtment was the primary treatment following the initial diagnosis."},"meta":{"displayName":{"left":"Is Primary Treatment","right":null},"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"codeList":{"left":["Yes","No"],"right":["Yes","No","Unknown"],"data":{"added":["Unknown"],"deleted":[]}},"required":{"left":null,"right":true}}},"treatment_start_interval":{"description":{"left":"The interval between the primary diagnosis and initiation of treatment, in days.","right":"The interval between primary diagnosis and initiation of treatment, in days."},"meta":{"notes":{"left":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":null},"displayName":{"left":"Treatment Start Interval","right":null},"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"treatment_duration":{"description":{"left":"The duration of treatment regimen, in days.","right":"The duration of treatment regimen, in days"},"meta":{"displayName":{"left":"Treatment Duration","right":null},"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null},"required":{"left":null,"right":true}}}},"created":{"age_at_consent_for_treatment":{"changeType":"created","name":"age_at_consent_for_treatment","description":"Indicate the age of donor when consent was given for treatment.","valueType":"integer"},"therapeutic_intent":{"changeType":"created","name":"therapeutic_intent","description":"The therapeutic intent, the reason behind the choice of a therapy, of the treatment.","valueType":"string","restrictions":{"required":true,"codeList":["Adjuvant","Concurrent","Curative","Neoadjuvant","Not applicable","Palliative","Unknown"]},"meta":{"core":true}},"response_to_therapy":{"changeType":"created","name":"response_to_therapy","description":"The donors's response to the applied treatment regimen. (Source: RECIST)","valueType":"string","restrictions":{"required":true,"codeList":["Complete response","Disease progression","NED","Partial response","Stable disease"]},"meta":{"core":true}}},"deleted":{"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate the primary diagnosis event in the clinical timeline that this treatment was related to.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"line_of_treatment":{"changeType":"deleted","name":"line_of_treatment","description":"Indicate the line of treatment if it is not the primary treatment.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Line Of treatment","dependsOn":"treatment.is_primary_treatment","examples":"2,3,4"}},"days_per_cycle":{"changeType":"deleted","name":"days_per_cycle","description":"Indicate the number of days in a treatment cycle.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Days Per Cycle","dependsOn":"treatment.treatment_type"}},"number_of_cycles":{"changeType":"deleted","name":"number_of_cycles","description":"Indicate the number of treatment cycles.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Number Of Cycles","dependsOn":"treatment.treatment_type"}},"treatment_intent":{"changeType":"deleted","name":"treatment_intent","description":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"]},"meta":{"core":true,"displayName":"Treatment Intent","dependsOn":"treatment.treatment_type"}},"treatment_setting":{"changeType":"deleted","name":"treatment_setting","description":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: NCIt C124308)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"]},"meta":{"core":true,"displayName":"Treatment Setting","dependsOn":"treatment.treatment_type"}},"response_to_treatment_criteria_method":{"changeType":"deleted","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},"response_to_treatment":{"changeType":"deleted","name":"response_to_treatment","description":"The donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"codeList":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"]},"meta":{"core":true,"displayName":"Response To Treatment","dependsOn":"treatment.response_to_treatment_criteria_method","notes":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"outcome_of_treatment":{"changeType":"deleted","name":"outcome_of_treatment","description":"Indicate the donor's outcome of the prescribed treatment.","valueType":"string","restrictions":{"codeList":["Treatment completed as prescribed","Treatment incomplete due to technical or organizational problems","Treatment incomplete because patient died","Patient choice (stopped or interrupted treatment)","Physician decision (stopped or interrupted treatment)","Treatment stopped due to lack of efficacy (disease progression)","Treatment stopped due to acute toxicity","Other","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Outcome Of Treatment","dependsOn":"treatment.treatment_type"}},"toxicity_type":{"changeType":"deleted","name":"toxicity_type","description":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity.","valueType":"string","restrictions":{"codeList":["Hematological","Non-hematological","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Toxicity Type","dependsOn":"treatment.outcome_of_treatment"}},"hematological_toxicity":{"changeType":"deleted","name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"non-hematological_toxicity":{"changeType":"deleted","name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"adverse_events":{"changeType":"deleted","name":"adverse_events","description":"Report any treatment related adverse events. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Adverse Events","dependsOn":"treatment.treatment_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"clinical_trials_database":{"changeType":"deleted","name":"clinical_trials_database","description":"If the donor is a participant in a clinical trial, indicate the clinical trial database where the clinical trial is registered.","valueType":"string","meta":{"display name":"Clinical Trials Database","notes":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added."},"restrictions":{"codeList":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"]}},"clinical_trial_number":{"changeType":"deleted","name":"clinical_trial_number","description":"Based on the clinical_trial_database, indicate the unique NCT or EudraCT clinical trial identifier of which the donor is a participant.","valueType":"string","meta":{"display name":"Clinical Trial Number","dependsOn":"treatment.clinical_trials_database","examples":"2016-002120-83,NCT02465060"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"]}}}},"chemotherapy":{"updated":{"program_id":{"meta":{"displayName":{"left":"Program ID","right":null}}},"submitter_donor_id":{"meta":{"displayName":{"left":"Submitter Donor ID","right":null}}},"submitter_treatment_id":{"meta":{"displayName":{"left":"Submitter Treatment ID","right":null}}}},"created":{"chemotherapy_drug_name":{"changeType":"created","name":"chemotherapy_drug_name","description":"Name of agent or drug administered to patient as part of the chemotherapy treatment regimen.","valueType":"string","restrictions":{"required":true,"codeList":["Placeholder list 1","Need list","Still need it"]},"meta":{"validationDependency":true,"core":true,"notes":"This field uses a controlled vocabulary gathered from the DrugBank database of drug names.","examples":"Allopurinol, Dronabinol, Sucralfate, Lapatinib"}},"chemotherapy_dosage_units":{"changeType":"created","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m²","IU/m²","µg/m²","g/m²","mg/kg"]},"meta":{"core":true}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate the total drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"integer","restrictions":{"required":true},"meta":{"core":true}}},"deleted":{"drug_rxnormcui":{"changeType":"deleted","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"deleted","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"deleted","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"deleted","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"deleted","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"deleted","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}}},"hormone_therapy":{"updated":{"program_id":{"meta":{"displayName":{"left":"Program ID","right":null}}},"submitter_donor_id":{"meta":{"displayName":{"left":"Submitter Donor ID","right":null}}},"submitter_treatment_id":{"meta":{"displayName":{"left":"Submitter Treatment ID","right":null}}}},"created":{"hormone_therapy_drug_name":{"changeType":"created","name":"hormone_therapy_drug_name","description":"Name of agent or drug administered to patient as part of the hormone therapy treatment regimen.","valueType":"string","restrictions":{"required":true,"codeList":["Placeholder list 1","Need list","Still need it"]},"meta":{"validationDependency":true,"core":true,"notes":"This field uses a controlled vocabulary gathered from the DrugBank database of drug names."}},"hormone_drug_dosage_units":{"changeType":"created","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m²","IU/m²","µg/m²","g/m²","mg/kg"]},"meta":{"core":true}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"integer","restrictions":{"required":true},"meta":{"core":true}}},"deleted":{"drug_rxnormcui":{"changeType":"deleted","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"deleted","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Hormone Therapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"deleted","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"radiation":{"updated":{"program_id":{"meta":{"displayName":{"left":"Program ID","right":null}}},"submitter_donor_id":{"meta":{"displayName":{"left":"Submitter Donor ID","right":null}}},"submitter_treatment_id":{"meta":{"displayName":{"left":"Submitter Treatment ID","right":null}}},"radiation_therapy_modality":{"meta":{"displayName":{"left":"Radiation Therapy Modality","right":null}}},"radiation_therapy_fractions":{"description":{"left":"Indicate the total number of fractions delivered as part of treatment.","right":"Indicate the number of total fractions delivered as part of treatment."},"meta":{"displayName":{"left":"Radiation Therapy Fractions","right":null}},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"radiation_therapy_dosage":{"valueType":{"left":"number","right":"integer"},"meta":{"displayName":{"left":"Radiation Therapy Dosage","right":null}},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"anatomical_site_irradiated":{"description":{"left":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)","right":"Indicate localization site where radiation therapy was administered."},"meta":{"displayName":{"left":"Anatomical Site Irradiated","right":null}},"restrictions":{"codeList":{"left":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"right":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"data":{"added":["Bone","Extremities","Head-Neck","Peritoneum"],"deleted":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"]}}}}},"created":{"application_form":{"changeType":"created","name":"application_form","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal (including Brachytherapy)"]},"meta":{"core":true}}},"deleted":{"radiation_therapy_type":{"changeType":"deleted","name":"radiation_therapy_type","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal"]},"meta":{"core":true,"displayName":"Type of Radiation Therapy","notes":"Internal application includes Brachytherapy."}},"radiation_boost":{"changeType":"deleted","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"deleted","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}}},"immunotherapy":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"immunotherapy_type":{"changeType":"deleted","name":"immunotherapy_type","valueType":"string","description":"Indicate the type of immunotherapy administered to donor.","meta":{"displayName":"Immunotherapy Type","core":true},"restrictions":{"required":true,"codeList":["Cell-based","Immune checkpoint inhibitors","Monoclonal antibodies other than immune checkpoint inhibitors","Other immunomodulatory substances"]}},"drug_rxnormcui":{"changeType":"deleted","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"deleted","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"deleted","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"surgery":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"deleted","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"deleted","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"deleted","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"deleted","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"deleted","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"deleted","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"deleted","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"deleted","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"deleted","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"deleted","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"deleted","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"deleted","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"deleted","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"deleted","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}}},"follow_up":{"updated":{"program_id":{"meta":{"displayName":{"left":"Program ID","right":null}}},"submitter_donor_id":{"meta":{"displayName":{"left":"Submitter Donor ID","right":null}}},"submitter_follow_up_id":{"description":{"left":"Unique identifier for a follow-up event in a donor's clinical record, assigned by the data provider.","right":"Unique identifier for a follow-up event in a donors clincal record, assigned by the data provider."},"meta":{"displayName":{"left":"Submitter Follow-Up ID","right":null}}},"interval_of_followup":{"description":{"left":"Interval from the primary diagnosis date to the follow-up date, in days.","right":"Interval from the primary diagnosis date to the follow up date, in days."},"meta":{"displayName":{"left":"Interval Of Follow-Up","right":null},"notes":{"left":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":null}}},"disease_status_at_followup":{"description":{"left":"Indicate the donor's disease status at time of follow-up. (Reference: RECIST)","right":"Indicate the donor's disease status at time of follow-up."},"meta":{"displayName":{"left":"Disease Status at Follow-Up","right":null}},"restrictions":{"codeList":{"left":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Progression NOS","Relapse or recurrence","Stable"],"right":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Relapse","Stable"],"data":{"added":["Relapse"],"deleted":["Progression NOS","Relapse or recurrence"]}}}},"relapse_type":{"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.","right":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse."},"displayName":{"left":"Relapse Type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":null}}},"relapse_interval":{"description":{"left":"If the donor was clinically disease free following primary treatment and then relapse or recurrence or progression (for liquid tumours) occurred afterwards, then this field will indicate the length of disease free interval, in days.","right":"If the donor was clinically disease free following primary treatment and then relapse or progression (for liquid tumours) occurred afterwards, then this field will indicate the length of disease free interval, in days."},"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.","right":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse."},"displayName":{"left":"Relapse Interval","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"]}}},"method_of_progression_status":{"description":{"left":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Reference: caDSR CDE ID 6161031)","right":"Indicate the method(s) used to confirm the donor's progression disease status. (Codelist reference: NCI CDE ID: 6161031)"},"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file.","right":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse."},"displayName":{"left":"Method Of Progression Status","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"]},"codeList":{"left":["Biomarker in liquid biopsy (e.g. tumour marker in blood or urine)","Biopsy","Blood draw","Bone marrow aspirate","Core biopsy","Cystoscopy","Cytology","Debulking","Diagnostic imaging","Dilation and curettage procedure","Enucleation","Excisional biopsy","Fine needle aspiration","Imaging","Incisional biopsy","Laparoscopy","Laparotomy","Other","Pap Smear","Pathologic review","Physical exam","Surgical resection","Thoracentesis","Ultrasound guided biopsy"],"right":["Autopsy","Biomarker in liquid biopsy (e.g. tumor marker in blood or urine)","Biopsy","Blood draw","Bone marrow aspirate","Core biopsy","Cystoscopy","Cytology","Debulking","Diagnostic imaging","Dilation and curettage procedure","Enucleation","Excisional biopsy","Fine needle aspiration","Imaging","Incisional biopsy","Laparoscopy","Laparotomy","Other","Pap Smear","Pathologic review","Physical exam","Surgical resection","Thoracentesis","Ultrasound guided biopsy"],"data":{"added":["Autopsy","Biomarker in liquid biopsy (e.g. tumor marker in blood or urine)"],"deleted":["Biomarker in liquid biopsy (e.g. tumour marker in blood or urine)"]}}}},"recurrence_tumour_staging_system":{"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.","right":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse."},"displayName":{"left":"Recurrance Tumour Staging System","right":null},"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"data":{"added":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"deleted":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n\n let result = {valid: true, message: \"Ok\"};\n \n /* This is not a required field, so first ensure that it exists */\n if ($field){\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name.trim().toLowerCase().split('_tumour_staging_system')[0];\n /* Perform validation only if an AJCC value was selected */\n if (/^(AJCC)\\b/i.test($field)){\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`\n ];\n const convertedRow = Object.fromEntries(Object.entries($row).map(([fieldName,fieldVal]) => [fieldName.toLowerCase(), fieldVal]));\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(field => Object.keys(convertedRow).includes(field) && (!convertedRow[field] || checkforEmpty(convertedRow[field])))\n if (emptyFields.length){\n result = {valid: false, \"message\": `The following fields are required when ${$name} is set to an AJCC option: ${emptyFields}`};\n }\n }\n }\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"]}}},"recurrence_t_category":{"description":{"left":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"displayName":{"left":"Recurrence T Category","right":null},"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":null,"data":{"added":[],"deleted":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"]}}}},"recurrence_n_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"displayName":{"left":"Recurrence N Category","right":null},"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"],"right":null,"data":{"added":[],"deleted":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"]}}}},"recurrence_m_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"displayName":{"left":"Recurrence M Category","right":null},"core":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":null,"data":{"added":[],"deleted":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"]}}}},"recurrence_stage_group":{"description":{"left":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) at the time of retreatment for a recurrence or disease progression.","right":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery."},"meta":{"notes":{"left":"This field is dependent on the selected recurrence_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","right":null},"displayName":{"left":"Recurrence Stage Group","right":null},"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":null,"data":{"added":[],"deleted":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":null}}},"posttherapy_tumour_staging_system":{"meta":{"displayName":{"left":"Post-therapy Tumour Staging System","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate() {\n\n let result = {valid: true, message: \"Ok\"};\n \n /* This is not a required field, so first ensure that it exists */\n if ($field){\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name.trim().toLowerCase().split('_tumour_staging_system')[0];\n /* Perform validation only if an AJCC value was selected */\n if (/^(AJCC)\\b/i.test($field)){\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`\n ];\n const convertedRow = Object.fromEntries(Object.entries($row).map(([fieldName,fieldVal]) => [fieldName.toLowerCase(), fieldVal]));\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(field => Object.keys(convertedRow).includes(field) && (!convertedRow[field] || checkforEmpty(convertedRow[field])))\n if (emptyFields.length){\n result = {valid: false, \"message\": `The following fields are required when ${$name} is set to an AJCC option: ${emptyFields}`};\n }\n }\n }\n return result;\n })()"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"data":{"added":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"deleted":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"]}}}},"posttherapy_t_category":{"meta":{"dependsOn":{"left":"follow_up.posttherapy_tumour_staging_system","right":"follow_up.post_therapy_tumour_staging_system"},"displayName":{"left":"Post-therapy T Category","right":null}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":null,"data":{"added":[],"deleted":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"]}}}},"posttherapy_n_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"dependsOn":{"left":"follow_up.posttherapy_tumour_staging_system","right":"follow_up.post_therapy_tumour_staging_system"},"displayName":{"left":"Post-therapy N Category","right":null}},"restrictions":{"codeList":{"left":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"],"right":null,"data":{"added":[],"deleted":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"]}}}},"posttherapy_m_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"dependsOn":{"left":"follow_up.posttherapy_tumour_staging_system","right":"follow_up.post_therapy_tumour_staging_system"},"displayName":{"left":"Post-therapy M Category","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":null,"data":{"added":[],"deleted":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"]}}}},"posttherapy_stage_group":{"meta":{"dependsOn":{"left":"follow_up.posttherapy_tumour_staging_system","right":"follow_up.post_therapy_tumour_staging_system"},"notes":{"left":"This field is dependent on the selected posttherapy_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","right":"This field value is dependent on the selected posttherapy_tumour_staging_system."},"displayName":{"left":"Post-therapy Stage Group","right":null}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":null,"data":{"added":[],"deleted":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":null}}}},"created":{"anatomic_site_progression_or_recurrences":{"changeType":"created","description":"Indicate the anatomic site where disease progression or recurrence occurred. (Codelist reference: NCI CDE ID: 4742851)","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"],"codeList":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear, pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal; distal","Esophageal; mid","Esophageal; proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck, NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es), maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"]},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","notes":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse."}}},"deleted":{"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate if the follow-up is related to a specific primary diagnosis event in the clinical timeline.","meta":{"validationDependency":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID","primaryId":true},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"Indicate if the follow-up is related to a specific treatment event in the clinical timeline.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"weight_at_followup":{"changeType":"deleted","description":"Indicate the donor's weight, in kilograms (kg), at the time of follow-up.","name":"weight_at_followup","valueType":"number","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Weight at Follow-Up"}},"anatomic_site_progression_or_recurrence":{"changeType":"deleted","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"exposure":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"deleted","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"deleted","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"deleted","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"deleted","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"deleted","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"deleted","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"deleted","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"deleted","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"deleted","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"deleted","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"deleted","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}}},"family_history":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"family_relative_id":{"changeType":"deleted","description":"Unique identifier of the relative, assigned by the data provider.","name":"family_relative_id","valueType":"string","meta":{"displayName":"Family Relative ID","primaryId":true,"notes":"This field is required to ensure that family members are identified in unique records. Ids can be as simple as an incremented numeral to ensure uniqueness."},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"relative_with_cancer_history":{"changeType":"deleted","description":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","name":"relative_with_cancer_history","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Relative with Cancer History"}},"relationship_type":{"changeType":"deleted","description":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","name":"relationship_type","restrictions":{"codeList":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"]},"valueType":"string","meta":{"displayName":"Relationship Type"}},"gender_of_relative":{"changeType":"deleted","description":"The self-reported gender of related individual.","name":"gender_of_relative","restrictions":{"codeList":["Female","Male","Other","Unknown"]},"valueType":"string","meta":{"displayName":"Gender of Relative"}},"age_of_relative_at_diagnosis":{"changeType":"deleted","description":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","name":"age_of_relative_at_diagnosis","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","displayName":"Age Of Relative At Diagnosis"}},"cancer_type_code_of_relative":{"changeType":"deleted","name":"cancer_type_code_of_relative","valueType":"string","description":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"examples":"C41.1,C16.9,C00.5,D46.9","dependsOn":"family_history.relative_with_cancer_history","displayName":"Cancer Type Code (ICD-10) of Relative"}},"relative_vital_status":{"changeType":"deleted","description":"Relative's last known state of living or deceased.","name":"relative_vital_status","restrictions":{"codeList":["Alive","Deceased","Unknown"]},"valueType":"string","meta":{"displayName":"Vital Status of Relative"}},"cause_of_death_of_relative":{"changeType":"deleted","description":"Indicate the cause of the death of the relative.","name":"cause_of_death_of_relative","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]},"valueType":"string","meta":{"dependsOn":"family_history.relative_vital_status","displayName":"Cause of Death of Relative"}},"relative_survival_time":{"changeType":"deleted","description":"Indicate how long, in days, the relative survived from the time they were diagnosed with cancer.","name":"relative_survival_time","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","units":"days","displayName":"Survival Time Of Relative"}}}},"biomarker":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"deleted","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"deleted","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"deleted","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"deleted","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"deleted","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"deleted","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"deleted","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"deleted","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"deleted","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"deleted","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"deleted","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"deleted","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"deleted","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"deleted","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"deleted","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"deleted","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}}},"comorbidity":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"deleted","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"deleted","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"deleted","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"deleted","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"deleted","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"deleted","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}}}}} diff --git a/scripts/data/schemas/diffs/1.24/1.24-diff-0.7.json b/scripts/data/schemas/diffs/1.24/1.24-diff-0.7.json new file mode 100644 index 00000000..b337fced --- /dev/null +++ b/scripts/data/schemas/diffs/1.24/1.24-diff-0.7.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"program_id":{"meta":{"examples":{"left":"TEST-CA","right":"PACA-AU,BR-CA"},"notes":{"left":"This is the unique id that is assigned to your program. If you have logged into the platform, this is the Program Id that you see in the Program Services area. For example, TEST-CA is a Program ID.","right":null},"displayName":{"left":"Program ID","right":null}}},"submitter_donor_id":{"meta":{"displayName":{"left":"Submitter Donor ID","right":null}}},"gender":{"meta":{"displayName":{"left":"Gender","right":null}}},"submitter_specimen_id":{"meta":{"displayName":{"left":"Submitter Specimen ID","right":null}}},"specimen_tissue_source":{"meta":{"displayName":{"left":"Specimen Tissue Source","right":null}}},"tumour_normal_designation":{"meta":{"displayName":{"left":"Tumour Normal Designation","right":null}}},"specimen_type":{"meta":{"displayName":{"left":"Specimen Type","right":null}},"restrictions":{"codeList":{"left":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Normal","Normal - tissue adjacent to primary tumour","Primary tumour","Primary tumour - adjacent to normal","Primary tumour - additional new primary","Recurrent tumour","Metastatic tumour","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour - additional metastatic","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line","Cell line - derived from xenograft tumour","Cell line - derived from tumour","Cell line - derived from normal"],"data":{"added":[],"deleted":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n\n const row = $row;\n let result = {valid: true, message: \"Ok\"};\n \n const designation = row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\"){\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when tumour_normal_designation is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when tumour_normal_designation is set to Tumour.\"};\n }\n }\n return result;\n })()"]}}},"submitter_sample_id":{"meta":{"displayName":{"left":"Submitter Sample ID","right":null}}},"sample_type":{"meta":{"displayName":{"left":"Sample Type","right":null}}}},"created":{},"deleted":{}},"donor":{"updated":{"program_id":{"meta":{"displayName":{"left":"Program ID","right":null}}},"submitter_donor_id":{"meta":{"displayName":{"left":"Submitter Donor ID","right":null}}},"vital_status":{"meta":{"displayName":{"left":"Vital Status","right":null}},"restrictions":{"codeList":{"left":["Alive","Deceased"],"right":["Alive","Deceased","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"cause_of_death":{"meta":{"displayName":{"left":"Cause of Death","right":null}},"restrictions":{"codeList":{"left":["Died of cancer","Died of other reasons","Unknown"],"right":["Died of cancer","Died of other reasons"],"data":{"added":[],"deleted":["Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })()"]}}},"survival_time":{"meta":{"displayName":{"left":"Survival Time","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })()"]},"range":{"left":{"exclusiveMin":0},"right":null}}},"height":{"valueType":{"left":"number","right":"integer"},"meta":{"displayName":{"left":"Height","right":null}},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"weight":{"valueType":{"left":"number","right":"integer"},"meta":{"displayName":{"left":"Weight","right":null}},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"bmi":{"valueType":{"left":"number","right":"integer"},"meta":{"displayName":{"left":"BMI","right":null}},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"menopause_status":{"description":{"left":"Indicate the donor's menopause status at the time of primary diagnosis. (Reference: caDSR CDE ID 2434914)","right":"Indicate the donor's menopause status at the time of primary diagnosis. (Codelist reference: NCI CDE ID: 2434914)"},"meta":{"displayName":{"left":"Menopause Status","right":null}},"restrictions":{"codeList":{"left":["Not applicable","Perimenopausal","Postmenopausal","Premenopausal","Unknown"],"right":["Premenopausal","Perimenopausal","Postmenopausal","Indeterminate or unknown","Not applicable"],"data":{"added":["Indeterminate or unknown"],"deleted":["Unknown"]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)","right":"Indicate the donor's age of menarche, the first occurrence of menstruation."},"meta":{"displayName":{"left":"Age at Menarche","right":null}},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"number_of_pregnancies":{"description":{"left":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)","right":"Indicate the number of pregnancies a donor has had."},"meta":{"displayName":{"left":"Number of Pregnancies","right":null}},"restrictions":{"range":{"left":{"min":0},"right":null}}},"number_of_children":{"description":{"left":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)","right":"Indicate the number of children the donor has birthed."},"meta":{"displayName":{"left":"Number of Children","right":null}},"restrictions":{"range":{"left":{"min":0},"right":null}}}},"created":{"prior_malignancy":{"changeType":"created","description":"Prior malignancy affecting donor.","name":"prior_malignancy","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string"},"cancer_type_prior_malignancy":{"changeType":"created","description":"ICD-10 diagnostic code for type of cancer in a prior malignancy.","name":"cancer_type_prior_malignancy","restrictions":{"regex":"[A-Z]{1}[0-9]{2}.[0-9]{0,3}[A-Z]{0,1}$"},"valueType":"string"},"age_at_prior_malignancy":{"changeType":"created","description":"If donor has history of prior malignancy, indicate age at previous diagnosis, in years.","name":"age_at_prior_malignancy","valueType":"integer"},"laterality_of_prior_malignancy":{"changeType":"created","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis.","name":"laterality_of_prior_malignancy","valueType":"string"}},"deleted":{"primary_site":{"changeType":"deleted","name":"primary_site","valueType":"string","isArray":true,"description":"The text term used to describe the primary site of disease, as categorized by the World Health Organization's (WHO) International Classification of Diseases for Oncology (ICD-O). This categorization groups cases into general categories.","meta":{"displayName":"Primary Site","core":true,"notes":"To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Breast|Ovary"},"restrictions":{"required":true,"codeList":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"]}},"genetic_disorders":{"changeType":"deleted","description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},"hrt_type":{"changeType":"deleted","description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},"hrt_duration":{"changeType":"deleted","description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},"contraception_type":{"changeType":"deleted","description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},"contraception_duration":{"changeType":"deleted","description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},"lost_to_followup_after_clinical_event_id":{"changeType":"deleted","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}}},"specimen":{"updated":{"program_id":{"meta":{"displayName":{"left":"Program ID","right":null}}},"submitter_donor_id":{"meta":{"displayName":{"left":"Submitter Donor ID","right":null}}},"submitter_specimen_id":{"meta":{"displayName":{"left":"Submitter Specimen ID","right":null}}},"pathological_tumour_staging_system":{"meta":{"validationDependency":{"left":true,"right":null},"displayName":{"left":"Pathological Tumour Staging System","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(\n field =>\n Object.keys(convertedRow).includes(field) &&\n (!convertedRow[field] || checkforEmpty(convertedRow[field])),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"data":{"added":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"deleted":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"]}}}},"pathological_t_category":{"meta":{"displayName":{"left":"Pathological T Category","right":null}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":null,"data":{"added":[],"deleted":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"]}}}},"pathological_n_category":{"meta":{"displayName":{"left":"Pathological N Category","right":null}},"restrictions":{"codeList":{"left":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"],"right":null,"data":{"added":[],"deleted":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"]}}}},"pathological_m_category":{"meta":{"displayName":{"left":"Pathological M Category","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":null,"data":{"added":[],"deleted":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"]}}}},"pathological_stage_group":{"description":{"left":"Specify the tumour stage, based on pathological_tumour_staging_system, used to assess the cancer at the time the tumour specimen was resected.","right":"Specify the tumour stage, based on tumor_staging_system, used to assess the cancer at the time the tumour specimen was resected."},"meta":{"notes":{"left":"This field depends on the selected pathological_tumour_staging_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","right":"This field depends on the selected pathological staging system, and is only required if the specimen is a tumour."},"displayName":{"left":"Pathological Stage Group","right":null}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":null,"data":{"added":[],"deleted":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":null}}},"specimen_acquisition_interval":{"meta":{"notes":{"left":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":null},"displayName":{"left":"Specimen Acquisition Interval","right":null}}},"tumour_histological_type":{"description":{"left":"The code to represent the histology (morphology) of neoplasms that is usually obtained from a pathology report, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","right":"The code to represent the histology (morphology) of neoplasms that is usually obtained from a pathology report, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Please refer to the guidelines provided in the ICD-O-3 manual at https://apps.who.int/iris/handle/10665/42344."},"meta":{"validationDependency":{"left":true,"right":null},"displayName":{"left":"Tumour Histological Type","right":null}}},"specimen_anatomic_location":{"description":{"left":"Indicate the ICD-O-3 topography code for the anatomic location of a specimen when it was collected. Refer to the guidelines provided in the ICD-O-3 manual at https://apps.who.int/iris/handle/10665/42344.","right":"Anatomic location of a specimen when it was collected."},"meta":{"displayName":{"left":"Specimen Anatomic Location","right":null},"examples":{"left":"C50.1,C18","right":null}},"restrictions":{"regex":{"left":"^[C][0-9]{2}(.[0-9]{1})?$","right":null},"codeList":{"right":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear, pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal; distal","Esophageal; mid","Esophageal; proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck, NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es), maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"],"data":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear, pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal; distal","Esophageal; mid","Esophageal; proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck, NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es), maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"]}}},"specimen_processing":{"meta":{"displayName":{"left":"Specimen Processing","right":null}},"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation, other","Formalin fixed & paraffin embedded","Formalin fixed, buffered","Formalin fixed, unbuffered","Fresh","Other"],"data":{"added":["Cryopreservation, other","Formalin fixed, buffered","Formalin fixed, unbuffered"],"deleted":["Cryopreservation - other","Formalin fixed - buffered","Formalin fixed - unbuffered","Unknown"]}}}},"specimen_storage":{"description":{"left":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured.","right":"Indicate the method of specimen storage for specimens that were not extracted freshly or immediately cultured."},"meta":{"displayName":{"left":"Specimen Storage","right":null}},"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"right":["Cut slide","Frozen, -70 freezer","Frozen, liquid nitrogen","Frozen, vapor phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"data":{"added":["Frozen, -70 freezer","Frozen, liquid nitrogen","Frozen, vapor phase"],"deleted":["Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Unknown"]}}}},"tumour_grading_system":{"meta":{"validationDependency":{"left":true,"right":null},"displayName":{"left":"Tumour Grading System","right":null}},"restrictions":{"codeList":{"left":["FNCLCC grading system","Four-tier grading system","Gleason grade group system","Grading system for GISTs","Grading system for GNETs","ISUP grading system","Nuclear grading system for DCIS","Scarff-Bloom-Richardson grading system","Three-tier grading system","Two-tier grading system","WHO grading system for CNS tumours"],"right":["Default","Gleason","Nottingham","Brain cancer","ISUP","Lymphoid neoplasms"],"data":{"added":["Default","Gleason","Nottingham","Brain cancer","ISUP","Lymphoid neoplasms"],"deleted":["FNCLCC grading system","Four-tier grading system","Gleason grade group system","Grading system for GISTs","Grading system for GNETs","ISUP grading system","Nuclear grading system for DCIS","Scarff-Bloom-Richardson grading system","Three-tier grading system","Two-tier grading system","WHO grading system for CNS tumours"]}}}},"tumour_grade":{"meta":{"notes":{"left":"This field depends on the selected tumour_grading_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Grading Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-grading-classifications","right":"This field depends on the selected tumour grading system, and is only required if the specimen is a tumour."},"displayName":{"left":"Tumour Grade","right":null}},"restrictions":{"codeList":{"left":["Low grade","High grade","GX","G1","G2","G3","G4","Low","High","Grade I","Grade II","Grade III","Grade IV","Grade Group 1","Grade Group 2","Grade Group 3","Grade Group 4","Grade Group 5"],"data":["Low grade","High grade","GX","G1","G2","G3","G4","Low","High","Grade I","Grade II","Grade III","Grade IV","Grade Group 1","Grade Group 2","Grade Group 3","Grade Group 4","Grade Group 5"]},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'default':\n codeList = [\n 'gx - cannot be assessed',\n 'g1 well differentiated/low grade',\n 'g2 moderately differentiated/intermediated grade',\n 'g3 poorly differentiated/high grade',\n 'g4 undifferentiated/high grade',\n ];\n break;\n case 'gleason':\n codeList = [\n 'gleason x: gleason score cannot be determined',\n 'gleason 2–6: the tumor tissue is well differentiated',\n 'gleason 7: the tumor tissue is moderately differentiated',\n 'gleason 8–10: the tumor tissue is poorly differentiated or undifferentiated',\n ];\n break;\n case 'nottingham':\n codeList = [\n 'g1 (low grade or well differentiated)',\n 'g2 (intermediate grade or moderately differentiated)',\n 'g3 (high grade or poorly differentiated)',\n ];\n break;\n case 'brain cancer':\n codeList = ['grade i', 'grade ii', 'grade iii', 'grade iv'];\n break;\n case 'isup for renal cell carcinoma':\n codeList = [\n 'grade 1: tumor cell nucleoli invisible or small and basophilic at 400 x magnification',\n 'grade 2: tumor cell nucleoli conspicuous at 400 x magnification but inconspicuous at 100 x magnification',\n 'grade 3: tumor cell nucleoli eosinophilic and clearly visible at 100 x magnification',\n 'grade 4: tumors showing extreme nuclear pleomorphism and/or containing tumor giant cells and/or the presence of any proportion of tumor showing sarcomatoid and/or rhabdoid dedifferentiation',\n ];\n break;\n case 'lymphoid neoplasms':\n codeList = ['low grade or indolent nhl', 'high grade or aggressive nhl'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })()"]}}},"percent_tumour_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)","right":"Indicate a value, in decimals, that represents the percentage of infiltration by tumour cells in a specimen."},"meta":{"displayName":{"left":"Percent Tumour Cells","right":null}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null},"script":{"left":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"],"right":null}}},"percent_proliferating_cells":{"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"displayName":{"left":"Percent Proliferating Cells","right":null},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_inflammatory_tissue":{"description":{"left":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)","right":"Indicate a value, in decimals, that represents local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"displayName":{"left":"Percent Inflammatory Tissue","right":null},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_stromal_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)","right":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a malignant tumour specimen but are not malignant such as fibroblasts, vascular structures, etc."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"displayName":{"left":"Percent Stromal Cells","right":null},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_necrosis":{"description":{"left":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)","right":"Indicate a value, in decimals, that represents the percentage of cell death in a malignant tumour specimen."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"displayName":{"left":"Percent Necrosis","right":null},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}}},"created":{"central_pathology_confirmed":{"changeType":"created","name":"central_pathology_confirmed","description":"Indicate whether the histologic description of tissue or cells was confirmed by a pathology review of frozen or formalin fixed slide(s) completed after the diagnostic pathology review of the tumour sample used to extract analyte(s).","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour."},"restrictions":{"codeList":["Yes","No","Unknown"]}}},"deleted":{"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate the primary diagnosis event in the clinical timeline that this specimen acquisition was related to.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"specimen_laterality":{"changeType":"deleted","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"reference_pathology_confirmed":{"changeType":"deleted","name":"reference_pathology_confirmed","description":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)","valueType":"string","meta":{"validationDependency":true,"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Reference Pathology Confirmed"},"restrictions":{"codeList":["Yes","No","Unknown"]}},"percent_tumour_cells_measurement_method":{"changeType":"deleted","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}}},"primary_diagnosis":{"updated":{"program_id":{"meta":{"displayName":{"left":"Program ID","right":null}}},"submitter_donor_id":{"meta":{"displayName":{"left":"Submitter Donor ID","right":null}}},"age_at_diagnosis":{"description":{"left":"Age that the donor was first diagnosed with cancer, in years. This should be based on the earliest diagnosis of cancer.","right":"Age that the donor was first diagnosed with cancer, in years."},"meta":{"displayName":{"left":"Age at Diagnosis","right":null}},"restrictions":{"range":{"left":{"exclusiveMin":0,"max":90},"right":null}}},"cancer_type_code":{"description":{"left":"The code to represent the cancer type using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","right":"The code to represent the cancer type using the WHO ICD-10 code (https://icd.who.int/browse10/2016/en#/) classification."},"meta":{"examples":{"left":"C41.1,C16.9,C00.5,D46.9","right":"C41.1,C16.9,C00.543A"},"displayName":{"left":"Cancer Type Code","right":null}},"restrictions":{"regex":{"left":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","right":"^C[0-9]{2}.[0-9]{0,3}[A-Z]{0,1}$"}}},"basis_of_diagnosis":{"meta":{"displayName":{"left":"Basis of Diagnosis","right":null}}},"number_lymph_nodes_examined":{"description":{"left":"The total number of lymph nodes tested for the presence of cancer. (Reference: caDSR CDE ID 3)","right":"The total number of lymph nodes tested for the presence of cancer. (Reference: NCI CDE ID: 3)"},"meta":{"displayName":{"left":"Number Of Lymph Nodes Examined","right":null},"dependsOn":{"left":"primary_diagnosis.lymph_nodes_examined_status","right":null},"notes":{"left":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":null},"range":{"left":{"min":0},"right":null}}},"number_lymph_nodes_positive":{"description":{"left":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: caDSR CDE ID 6113694)","right":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: NCI CDE ID: 6113694)"},"meta":{"displayName":{"left":"Number Of Lymph Nodes Positive","right":null},"dependsOn":{"left":"primary_diagnosis.lymph_nodes_examined_status","right":null},"notes":{"left":"This field is only required if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":null},"range":{"left":{"min":0},"right":null},"required":{"left":null,"right":true}}},"clinical_tumour_staging_system":{"meta":{"validationDependency":{"left":true,"right":null},"displayName":{"left":"Clinical Tumour Staging System","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(\n field =>\n Object.keys(convertedRow).includes(field) &&\n (!convertedRow[field] || checkforEmpty(convertedRow[field])),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"data":{"added":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"deleted":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"]}},"required":{"left":null,"right":true}}},"clinical_t_category":{"meta":{"displayName":{"left":"Clinical T Category","right":null}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":null,"data":{"added":[],"deleted":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"]}}}},"clinical_n_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"displayName":{"left":"Clinical N Category","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"],"right":null,"data":{"added":[],"deleted":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"]}}}},"clinical_m_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned.","right":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned."},"meta":{"displayName":{"left":"Clinical M Category","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":null,"data":{"added":[],"deleted":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"]}}}},"clinical_stage_group":{"description":{"left":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage.","right":"Stage group of the tumour, as assigned by the reporting tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.)."},"meta":{"notes":{"left":"This field is dependent on the selected clinical_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","right":null},"displayName":{"left":"Clinical Stage Group","right":null},"examples":{"left":"Stage I, Stage IIB","right":null}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"presenting_symptoms":{"meta":{"displayName":{"left":"Presenting Symptoms","right":null},"notes":{"left":"To include multiple values, separate values with a pipe delimiter '|' within your file.","right":null},"examples":{"left":"Anemia|Bloating|Diabetes","right":null}},"restrictions":{"codeList":{"left":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Loss of Appetite","Nausea","None","Not Reported","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Swelling in the Neck","Unknown","Vomiting","Weight Loss"],"right":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Nausea","None","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Unknown","Vomiting","Weight Loss"],"data":{"added":[],"deleted":["Loss of Appetite","Not Reported","Swelling in the Neck"]}}}},"performance_status":{"description":{"left":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status).","right":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference source: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status)."},"meta":{"notes":{"left":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction.\nGrade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work).\nGrade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours.\nGrade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours.\nGrade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair","right":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction \n Grade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work) \n Grade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours \n Grade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours \n Grade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair"},"displayName":{"left":"Performance Status","right":null}},"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"data":{"added":[],"deleted":["Unknown"]}}}}},"created":{"stage_suffix":{"changeType":"created","name":"stage_suffix","description":"If necessary, use this field to add any applicable stage suffixes. Stage suffixes may apply to certain staging systems such as Ann Arbour staging system where the four stages are divided into 4 categories (A, B, X and E).","valueType":"string","meta":{"core":true,"dependsOn":"primary_diagnosis.clinical_tumour_staging_system"}}},"deleted":{"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Unique identifier of the primary diagnosis event, assigned by the data provider.","meta":{"primaryId":true,"displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"cancer_type_additional_information":{"changeType":"deleted","name":"cancer_type_additional_information","valueType":"string","description":"Additional details related to the cancer type that are not covered by the ICD-10 code provided in the cancer_type field.","meta":{"displayName":"Cancer Type Additional Information"}},"laterality":{"changeType":"deleted","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_status":{"changeType":"deleted","name":"lymph_nodes_examined_status","description":"Indicate if lymph nodes were examined for metastases.","valueType":"string","restrictions":{"required":true,"codeList":["Cannot be determined","No","No lymph nodes found in resected specimen","Not applicable","Yes"]},"meta":{"core":true,"displayName":"Lymph Nodes Examined Status"}},"lymph_nodes_examined_method":{"changeType":"deleted","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}}},"treatment":{"updated":{"program_id":{"meta":{"displayName":{"left":"Program ID","right":null}}},"submitter_donor_id":{"meta":{"displayName":{"left":"Submitter Donor ID","right":null}}},"submitter_treatment_id":{"meta":{"displayName":{"left":"Submitter Treatment ID","right":null}}},"treatment_type":{"meta":{"notes":{"left":"Depending on the treatment_type(s) selected, additional treatment details may be required to be submitted. For example, if treatment_type includes 'Chemotherapy', the supplemental Chemotherapy treatment type file is required.\nTo include multiple values, separate values with a pipe delimiter '|' within your file.","right":"Depending on the treatment_type selected, additional treament details may be required to be submitted."},"displayName":{"left":"Treatment Type","right":null},"examples":{"left":"Chemotherapy|Hormonal therapy","right":null}},"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Chemotherapy","Ablation","Bone marrow transplant","Combined chemo+immunotherapy","Combined chemo+radiation therapy","Combined chemo-radiotherapy and surgery","Endoscopic therapy","Hormonal therapy","Immunotherapy","Monoclonal antibodies (for liquid tumours)","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgical resection"],"data":{"added":["Combined chemo+immunotherapy","Combined chemo+radiation therapy","Combined chemo-radiotherapy and surgery","Monoclonal antibodies (for liquid tumours)","Surgical resection"],"deleted":["End of life care","Surgery"]}}}},"is_primary_treatment":{"description":{"left":"Indicate if the treatment was the primary treatment following the initial diagnosis.","right":"Indicate if the treamtment was the primary treatment following the initial diagnosis."},"meta":{"displayName":{"left":"Is Primary Treatment","right":null},"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"codeList":{"left":["Yes","No"],"right":["Yes","No","Unknown"],"data":{"added":["Unknown"],"deleted":[]}},"required":{"left":null,"right":true}}},"treatment_start_interval":{"description":{"left":"The interval between the primary diagnosis and initiation of treatment, in days.","right":"The interval between primary diagnosis and initiation of treatment, in days."},"meta":{"notes":{"left":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":null},"displayName":{"left":"Treatment Start Interval","right":null},"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"treatment_duration":{"description":{"left":"The duration of treatment regimen, in days.","right":"The duration of treatment regimen, in days"},"meta":{"displayName":{"left":"Treatment Duration","right":null},"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null},"required":{"left":null,"right":true}}}},"created":{"age_at_consent_for_treatment":{"changeType":"created","name":"age_at_consent_for_treatment","description":"Indicate the age of donor when consent was given for treatment.","valueType":"integer"},"therapeutic_intent":{"changeType":"created","name":"therapeutic_intent","description":"The therapeutic intent, the reason behind the choice of a therapy, of the treatment.","valueType":"string","restrictions":{"required":true,"codeList":["Adjuvant","Concurrent","Curative","Neoadjuvant","Not applicable","Palliative","Unknown"]},"meta":{"core":true}},"response_to_therapy":{"changeType":"created","name":"response_to_therapy","description":"The donors's response to the applied treatment regimen. (Source: RECIST)","valueType":"string","restrictions":{"required":true,"codeList":["Complete response","Disease progression","NED","Partial response","Stable disease"]},"meta":{"core":true}}},"deleted":{"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate the primary diagnosis event in the clinical timeline that this treatment was related to.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"line_of_treatment":{"changeType":"deleted","name":"line_of_treatment","description":"Indicate the line of treatment if it is not the primary treatment.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Line Of treatment","dependsOn":"treatment.is_primary_treatment","examples":"2,3,4"}},"days_per_cycle":{"changeType":"deleted","name":"days_per_cycle","description":"Indicate the number of days in a treatment cycle.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Days Per Cycle","dependsOn":"treatment.treatment_type"}},"number_of_cycles":{"changeType":"deleted","name":"number_of_cycles","description":"Indicate the number of treatment cycles.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Number Of Cycles","dependsOn":"treatment.treatment_type"}},"treatment_intent":{"changeType":"deleted","name":"treatment_intent","description":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"]},"meta":{"core":true,"displayName":"Treatment Intent","dependsOn":"treatment.treatment_type"}},"treatment_setting":{"changeType":"deleted","name":"treatment_setting","description":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: NCIt C124308)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"]},"meta":{"core":true,"displayName":"Treatment Setting","dependsOn":"treatment.treatment_type"}},"response_to_treatment_criteria_method":{"changeType":"deleted","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},"response_to_treatment":{"changeType":"deleted","name":"response_to_treatment","description":"The donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"codeList":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"]},"meta":{"core":true,"displayName":"Response To Treatment","dependsOn":"treatment.response_to_treatment_criteria_method","notes":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"outcome_of_treatment":{"changeType":"deleted","name":"outcome_of_treatment","description":"Indicate the donor's outcome of the prescribed treatment.","valueType":"string","restrictions":{"codeList":["Treatment completed as prescribed","Treatment incomplete due to technical or organizational problems","Treatment incomplete because patient died","Patient choice (stopped or interrupted treatment)","Physician decision (stopped or interrupted treatment)","Treatment stopped due to lack of efficacy (disease progression)","Treatment stopped due to acute toxicity","Other","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Outcome Of Treatment","dependsOn":"treatment.treatment_type"}},"toxicity_type":{"changeType":"deleted","name":"toxicity_type","description":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity.","valueType":"string","restrictions":{"codeList":["Hematological","Non-hematological","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Toxicity Type","dependsOn":"treatment.outcome_of_treatment"}},"hematological_toxicity":{"changeType":"deleted","name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"non-hematological_toxicity":{"changeType":"deleted","name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"adverse_events":{"changeType":"deleted","name":"adverse_events","description":"Report any treatment related adverse events. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Adverse Events","dependsOn":"treatment.treatment_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"clinical_trials_database":{"changeType":"deleted","name":"clinical_trials_database","description":"If the donor is a participant in a clinical trial, indicate the clinical trial database where the clinical trial is registered.","valueType":"string","meta":{"display name":"Clinical Trials Database","notes":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added."},"restrictions":{"codeList":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"]}},"clinical_trial_number":{"changeType":"deleted","name":"clinical_trial_number","description":"Based on the clinical_trial_database, indicate the unique NCT or EudraCT clinical trial identifier of which the donor is a participant.","valueType":"string","meta":{"display name":"Clinical Trial Number","dependsOn":"treatment.clinical_trials_database","examples":"2016-002120-83,NCT02465060"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"]}}}},"chemotherapy":{"updated":{"program_id":{"meta":{"displayName":{"left":"Program ID","right":null}}},"submitter_donor_id":{"meta":{"displayName":{"left":"Submitter Donor ID","right":null}}},"submitter_treatment_id":{"meta":{"displayName":{"left":"Submitter Treatment ID","right":null}}}},"created":{"chemotherapy_drug_name":{"changeType":"created","name":"chemotherapy_drug_name","description":"Name of agent or drug administered to patient as part of the chemotherapy treatment regimen.","valueType":"string","restrictions":{"required":true,"codeList":["Placeholder list 1","Need list","Still need it"]},"meta":{"validationDependency":true,"core":true,"notes":"This field uses a controlled vocabulary gathered from the DrugBank database of drug names.","examples":"Allopurinol, Dronabinol, Sucralfate, Lapatinib"}},"chemotherapy_dosage_units":{"changeType":"created","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m²","IU/m²","µg/m²","g/m²","mg/kg"]},"meta":{"core":true}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate the total drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"integer","restrictions":{"required":true},"meta":{"core":true}}},"deleted":{"drug_rxnormcui":{"changeType":"deleted","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"deleted","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"deleted","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"deleted","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"deleted","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"deleted","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}}},"hormone_therapy":{"updated":{"program_id":{"meta":{"displayName":{"left":"Program ID","right":null}}},"submitter_donor_id":{"meta":{"displayName":{"left":"Submitter Donor ID","right":null}}},"submitter_treatment_id":{"meta":{"displayName":{"left":"Submitter Treatment ID","right":null}}}},"created":{"hormone_therapy_drug_name":{"changeType":"created","name":"hormone_therapy_drug_name","description":"Name of agent or drug administered to patient as part of the hormone therapy treatment regimen.","valueType":"string","restrictions":{"required":true,"codeList":["Placeholder list 1","Need list","Still need it"]},"meta":{"validationDependency":true,"core":true,"notes":"This field uses a controlled vocabulary gathered from the DrugBank database of drug names."}},"hormone_drug_dosage_units":{"changeType":"created","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m²","IU/m²","µg/m²","g/m²","mg/kg"]},"meta":{"core":true}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"integer","restrictions":{"required":true},"meta":{"core":true}}},"deleted":{"drug_rxnormcui":{"changeType":"deleted","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"deleted","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Hormone Therapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"deleted","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"radiation":{"updated":{"program_id":{"meta":{"displayName":{"left":"Program ID","right":null}}},"submitter_donor_id":{"meta":{"displayName":{"left":"Submitter Donor ID","right":null}}},"submitter_treatment_id":{"meta":{"displayName":{"left":"Submitter Treatment ID","right":null}}},"radiation_therapy_modality":{"meta":{"displayName":{"left":"Radiation Therapy Modality","right":null}}},"radiation_therapy_fractions":{"description":{"left":"Indicate the total number of fractions delivered as part of treatment.","right":"Indicate the number of total fractions delivered as part of treatment."},"meta":{"displayName":{"left":"Radiation Therapy Fractions","right":null}},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"radiation_therapy_dosage":{"valueType":{"left":"number","right":"integer"},"meta":{"displayName":{"left":"Radiation Therapy Dosage","right":null}},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"anatomical_site_irradiated":{"description":{"left":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)","right":"Indicate localization site where radiation therapy was administered."},"meta":{"displayName":{"left":"Anatomical Site Irradiated","right":null}},"restrictions":{"codeList":{"left":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"right":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"data":{"added":["Bone","Extremities","Head-Neck","Peritoneum"],"deleted":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"]}}}}},"created":{"application_form":{"changeType":"created","name":"application_form","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal (including Brachytherapy)"]},"meta":{"core":true}}},"deleted":{"radiation_therapy_type":{"changeType":"deleted","name":"radiation_therapy_type","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal"]},"meta":{"core":true,"displayName":"Type of Radiation Therapy","notes":"Internal application includes Brachytherapy."}},"radiation_boost":{"changeType":"deleted","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"deleted","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}}},"immunotherapy":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"immunotherapy_type":{"changeType":"deleted","name":"immunotherapy_type","valueType":"string","description":"Indicate the type of immunotherapy administered to donor.","meta":{"displayName":"Immunotherapy Type","core":true},"restrictions":{"required":true,"codeList":["Cell-based","Immune checkpoint inhibitors","Monoclonal antibodies other than immune checkpoint inhibitors","Other immunomodulatory substances"]}},"drug_rxnormcui":{"changeType":"deleted","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"deleted","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"deleted","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"surgery":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"deleted","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"deleted","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"deleted","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"deleted","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"deleted","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"deleted","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"deleted","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"deleted","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"deleted","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"deleted","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"deleted","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"deleted","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"deleted","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"deleted","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}}},"follow_up":{"updated":{"program_id":{"meta":{"displayName":{"left":"Program ID","right":null}}},"submitter_donor_id":{"meta":{"displayName":{"left":"Submitter Donor ID","right":null}}},"submitter_follow_up_id":{"description":{"left":"Unique identifier for a follow-up event in a donor's clinical record, assigned by the data provider.","right":"Unique identifier for a follow-up event in a donors clincal record, assigned by the data provider."},"meta":{"displayName":{"left":"Submitter Follow-Up ID","right":null}}},"interval_of_followup":{"description":{"left":"Interval from the primary diagnosis date to the follow-up date, in days.","right":"Interval from the primary diagnosis date to the follow up date, in days."},"meta":{"displayName":{"left":"Interval Of Follow-Up","right":null},"notes":{"left":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":null}}},"disease_status_at_followup":{"description":{"left":"Indicate the donor's disease status at time of follow-up. (Reference: RECIST)","right":"Indicate the donor's disease status at time of follow-up."},"meta":{"displayName":{"left":"Disease Status at Follow-Up","right":null}},"restrictions":{"codeList":{"left":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Progression NOS","Relapse or recurrence","Stable"],"right":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Relapse","Stable"],"data":{"added":["Relapse"],"deleted":["Progression NOS","Relapse or recurrence"]}}}},"relapse_type":{"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.","right":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse."},"displayName":{"left":"Relapse Type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":null}}},"relapse_interval":{"description":{"left":"If the donor was clinically disease free following primary treatment and then relapse or recurrence or progression (for liquid tumours) occurred afterwards, then this field will indicate the length of disease free interval, in days.","right":"If the donor was clinically disease free following primary treatment and then relapse or progression (for liquid tumours) occurred afterwards, then this field will indicate the length of disease free interval, in days."},"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.","right":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse."},"displayName":{"left":"Relapse Interval","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"]}}},"method_of_progression_status":{"description":{"left":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Reference: caDSR CDE ID 6161031)","right":"Indicate the method(s) used to confirm the donor's progression disease status. (Codelist reference: NCI CDE ID: 6161031)"},"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file.","right":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse."},"displayName":{"left":"Method Of Progression Status","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"]},"codeList":{"left":["Biomarker in liquid biopsy (e.g. tumour marker in blood or urine)","Biopsy","Blood draw","Bone marrow aspirate","Core biopsy","Cystoscopy","Cytology","Debulking","Diagnostic imaging","Dilation and curettage procedure","Enucleation","Excisional biopsy","Fine needle aspiration","Imaging","Incisional biopsy","Laparoscopy","Laparotomy","Other","Pap Smear","Pathologic review","Physical exam","Surgical resection","Thoracentesis","Ultrasound guided biopsy"],"right":["Autopsy","Biomarker in liquid biopsy (e.g. tumor marker in blood or urine)","Biopsy","Blood draw","Bone marrow aspirate","Core biopsy","Cystoscopy","Cytology","Debulking","Diagnostic imaging","Dilation and curettage procedure","Enucleation","Excisional biopsy","Fine needle aspiration","Imaging","Incisional biopsy","Laparoscopy","Laparotomy","Other","Pap Smear","Pathologic review","Physical exam","Surgical resection","Thoracentesis","Ultrasound guided biopsy"],"data":{"added":["Autopsy","Biomarker in liquid biopsy (e.g. tumor marker in blood or urine)"],"deleted":["Biomarker in liquid biopsy (e.g. tumour marker in blood or urine)"]}}}},"recurrence_tumour_staging_system":{"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.","right":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse."},"displayName":{"left":"Recurrance Tumour Staging System","right":null},"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"data":{"added":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"deleted":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(\n field =>\n Object.keys(convertedRow).includes(field) &&\n (!convertedRow[field] || checkforEmpty(convertedRow[field])),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"]}}},"recurrence_t_category":{"description":{"left":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"displayName":{"left":"Recurrence T Category","right":null},"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":null,"data":{"added":[],"deleted":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"]}}}},"recurrence_n_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"displayName":{"left":"Recurrence N Category","right":null},"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"],"right":null,"data":{"added":[],"deleted":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"]}}}},"recurrence_m_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"displayName":{"left":"Recurrence M Category","right":null},"core":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":null,"data":{"added":[],"deleted":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"]}}}},"recurrence_stage_group":{"description":{"left":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) at the time of retreatment for a recurrence or disease progression.","right":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery."},"meta":{"notes":{"left":"This field is dependent on the selected recurrence_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","right":null},"displayName":{"left":"Recurrence Stage Group","right":null},"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":null,"data":{"added":[],"deleted":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":null}}},"posttherapy_tumour_staging_system":{"meta":{"displayName":{"left":"Post-therapy Tumour Staging System","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(\n field =>\n Object.keys(convertedRow).includes(field) &&\n (!convertedRow[field] || checkforEmpty(convertedRow[field])),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"data":{"added":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"deleted":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"]}}}},"posttherapy_t_category":{"meta":{"dependsOn":{"left":"follow_up.posttherapy_tumour_staging_system","right":"follow_up.post_therapy_tumour_staging_system"},"displayName":{"left":"Post-therapy T Category","right":null}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":null,"data":{"added":[],"deleted":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"]}}}},"posttherapy_n_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"dependsOn":{"left":"follow_up.posttherapy_tumour_staging_system","right":"follow_up.post_therapy_tumour_staging_system"},"displayName":{"left":"Post-therapy N Category","right":null}},"restrictions":{"codeList":{"left":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"],"right":null,"data":{"added":[],"deleted":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"]}}}},"posttherapy_m_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"dependsOn":{"left":"follow_up.posttherapy_tumour_staging_system","right":"follow_up.post_therapy_tumour_staging_system"},"displayName":{"left":"Post-therapy M Category","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":null,"data":{"added":[],"deleted":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"]}}}},"posttherapy_stage_group":{"meta":{"dependsOn":{"left":"follow_up.posttherapy_tumour_staging_system","right":"follow_up.post_therapy_tumour_staging_system"},"notes":{"left":"This field is dependent on the selected posttherapy_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","right":"This field value is dependent on the selected posttherapy_tumour_staging_system."},"displayName":{"left":"Post-therapy Stage Group","right":null}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":null,"data":{"added":[],"deleted":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":null}}}},"created":{"anatomic_site_progression_or_recurrences":{"changeType":"created","description":"Indicate the anatomic site where disease progression or recurrence occurred. (Codelist reference: NCI CDE ID: 4742851)","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"],"codeList":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear, pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal; distal","Esophageal; mid","Esophageal; proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck, NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es), maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"]},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","notes":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse."}}},"deleted":{"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate if the follow-up is related to a specific primary diagnosis event in the clinical timeline.","meta":{"validationDependency":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID","primaryId":true},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"Indicate if the follow-up is related to a specific treatment event in the clinical timeline.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"weight_at_followup":{"changeType":"deleted","description":"Indicate the donor's weight, in kilograms (kg), at the time of follow-up.","name":"weight_at_followup","valueType":"number","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Weight at Follow-Up"}},"anatomic_site_progression_or_recurrence":{"changeType":"deleted","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"exposure":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"deleted","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"deleted","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"deleted","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"deleted","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"deleted","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"deleted","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"deleted","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"deleted","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"deleted","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"deleted","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"deleted","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}}},"family_history":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"family_relative_id":{"changeType":"deleted","description":"Unique identifier of the relative, assigned by the data provider.","name":"family_relative_id","valueType":"string","meta":{"displayName":"Family Relative ID","primaryId":true,"notes":"This field is required to ensure that family members are identified in unique records. Ids can be as simple as an incremented numeral to ensure uniqueness."},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"relative_with_cancer_history":{"changeType":"deleted","description":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","name":"relative_with_cancer_history","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Relative with Cancer History"}},"relationship_type":{"changeType":"deleted","description":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","name":"relationship_type","restrictions":{"codeList":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"]},"valueType":"string","meta":{"displayName":"Relationship Type"}},"gender_of_relative":{"changeType":"deleted","description":"The self-reported gender of related individual.","name":"gender_of_relative","restrictions":{"codeList":["Female","Male","Other","Unknown"]},"valueType":"string","meta":{"displayName":"Gender of Relative"}},"age_of_relative_at_diagnosis":{"changeType":"deleted","description":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","name":"age_of_relative_at_diagnosis","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","displayName":"Age Of Relative At Diagnosis"}},"cancer_type_code_of_relative":{"changeType":"deleted","name":"cancer_type_code_of_relative","valueType":"string","description":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"examples":"C41.1,C16.9,C00.5,D46.9","dependsOn":"family_history.relative_with_cancer_history","displayName":"Cancer Type Code (ICD-10) of Relative"}},"relative_vital_status":{"changeType":"deleted","description":"Relative's last known state of living or deceased.","name":"relative_vital_status","restrictions":{"codeList":["Alive","Deceased","Unknown"]},"valueType":"string","meta":{"displayName":"Vital Status of Relative"}},"cause_of_death_of_relative":{"changeType":"deleted","description":"Indicate the cause of the death of the relative.","name":"cause_of_death_of_relative","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]},"valueType":"string","meta":{"dependsOn":"family_history.relative_vital_status","displayName":"Cause of Death of Relative"}},"relative_survival_time":{"changeType":"deleted","description":"Indicate how long, in days, the relative survived from the time they were diagnosed with cancer.","name":"relative_survival_time","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","units":"days","displayName":"Survival Time Of Relative"}}}},"biomarker":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"deleted","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"deleted","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"deleted","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"deleted","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"deleted","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"deleted","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"deleted","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"deleted","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"deleted","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"deleted","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"deleted","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"deleted","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"deleted","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"deleted","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"deleted","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"deleted","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}}},"comorbidity":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"deleted","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"deleted","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"deleted","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"deleted","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"deleted","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"deleted","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}}}}} diff --git a/scripts/data/schemas/diffs/1.24/1.24-diff-1.0.json b/scripts/data/schemas/diffs/1.24/1.24-diff-1.0.json new file mode 100644 index 00000000..708f8496 --- /dev/null +++ b/scripts/data/schemas/diffs/1.24/1.24-diff-1.0.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":[],"deleted":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\r\n\r\n const row = $row;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n const designation = row.tumour_normal_designation.trim().toLowerCase();\r\n const specimen_type = $field.trim().toLowerCase();\r\n \r\n if (designation === \"normal\"){\r\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\r\n if (!validTypes.includes(specimen_type)){\r\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when tumour_normal_designation is set to Normal.\"};\r\n }\r\n }\r\n else if (designation === \"tumour\") {\r\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\r\n if (invalidTypes.includes(specimen_type)){\r\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when tumour_normal_designation is set to Tumour.\"};\r\n }\r\n }\r\n return result;\r\n })()"]}}},"submitter_sample_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased"],"right":["Alive","Deceased","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"cause_of_death":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate() {\r\n let result = {valid: true, message: \"Ok\"};\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n const vitalStatus = $row.vital_status.trim().toLowerCase();\r\n \r\n if (!currField && vitalStatus === \"deceased\"){\r\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\r\n }\r\n else if (currField && vitalStatus != \"deceased\"){\r\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\r\n }\r\n return result;\r\n })()"]}}},"survival_time":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate() {\r\n let result = {valid: true, message: \"Ok\"};\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n const vitalStatus = $row.vital_status.trim().toLowerCase();\r\n \r\n if (!currField && vitalStatus === \"deceased\"){\r\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\r\n }\r\n else if (currField && vitalStatus != \"deceased\"){\r\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\r\n }\r\n return result;\r\n })()"]},"range":{"left":{"exclusiveMin":0},"right":null}}},"primary_site":{"meta":{"notes":{"left":"To include multiple values, separate values with a pipe delimiter '|' within your file.","right":null},"examples":{"left":"Breast|Ovary","right":null}},"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Not Reported","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva","Unknown"],"data":{"added":["Not Reported","Unknown"],"deleted":["Unknown primary site"]}}}},"height":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"weight":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"bmi":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"menopause_status":{"description":{"left":"Indicate the donor's menopause status at the time of primary diagnosis. (Reference: caDSR CDE ID 2434914)","right":"Indicate the donor's menopause status at the time of primary diagnosis. (Codelist reference: NCI CDE ID: 2434914)"},"restrictions":{"codeList":{"left":["Not applicable","Perimenopausal","Postmenopausal","Premenopausal","Unknown"],"right":["Indeterminate or unknown","Not applicable","Perimenopausal","Postmenopausal","Premenopausal"],"data":{"added":["Indeterminate or unknown"],"deleted":["Unknown"]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)","right":"Indicate the donor's age of menarche, the first occurrence of menstruation."},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"number_of_pregnancies":{"description":{"left":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)","right":"Indicate the number of pregnancies a donor has had."},"restrictions":{"range":{"left":{"min":0},"right":null}}},"number_of_children":{"description":{"left":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)","right":"Indicate the number of children the donor has birthed."},"restrictions":{"range":{"left":{"min":0},"right":null}}}},"created":{"prior_malignancy":{"changeType":"created","description":"Prior malignancy affecting donor.","name":"prior_malignancy","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy","examples":"C41.1, C16.9, C00.5, D46.9"}},"cancer_type_prior_malignancy":{"changeType":"created","description":"The code to represent the cancer type of a prior malignancy using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","name":"cancer_type_prior_malignancy","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"valueType":"string","meta":{"displayName":"Cancer Type Prior Malignancy"}},"age_at_prior_malignancy":{"changeType":"created","description":"If donor has history of prior malignancy, indicate age at previous diagnosis, in years.","name":"age_at_prior_malignancy","valueType":"integer","meta":{"displayName":"Age at Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"created","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Codelist reference: NCI CDE: 4122391)","name":"laterality_of_prior_malignancy","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality at Prior Malignancy"}}},"deleted":{"genetic_disorders":{"changeType":"deleted","description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},"hrt_type":{"changeType":"deleted","description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},"hrt_duration":{"changeType":"deleted","description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},"contraception_type":{"changeType":"deleted","description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},"contraception_duration":{"changeType":"deleted","description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},"lost_to_followup_after_clinical_event_id":{"changeType":"deleted","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}}},"specimen":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null},"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"pathological_tumour_staging_system":{"meta":{"validationDependency":{"left":true,"right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n /* This is not a required field, so first ensure that it exists */\r\n if ($field) {\r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })()"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"pathological_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"pathological_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"pathological_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.pathological_tumour_staging_system && $field) {\r\n let codeList = [];\r\n switch ($row.pathological_tumour_staging_system && $row.pathological_tumour_staging_system.trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb',\r\n 'stage ive',\r\n 'stage ivs'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When 'pathological_tumour_staging_system' is set to '${\r\n $row.pathological_tumour_staging_system\r\n }', 'pathological_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })()"]}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"data":{"added":[],"deleted":["Unknown"]}}}},"specimen_storage":{"description":{"left":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured.","right":"Indicate the method of specimen storage for specimens that were not extracted freshly or immediately cultured."},"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"data":{"added":[],"deleted":["Unknown"]}}}},"reference_pathology_confirmed":{"description":{"left":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)","right":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist."}},"tumour_grading_system":{"meta":{"validationDependency":{"left":true,"right":null}}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.tumour_grading_system && $field) {\r\n let codeList = [];\r\n const tieredGradingList = ['gx','g1','g2','g3'];\r\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\r\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\r\n case 'two-tier grading system':\r\n codeList = [\r\n 'low grade',\r\n 'high grade',\r\n ];\r\n break;\r\n case 'three-tier grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'four-tier grading system':\r\n codeList = [\r\n 'gx',\r\n 'g1',\r\n 'g2',\r\n 'g3',\r\n 'g4',\r\n ];\r\n break;\r\n case 'grading system for gists':\r\n codeList = [\r\n 'low',\r\n 'high',\r\n ];\r\n break;\r\n case 'grading system for gnets':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'isup grading system':\r\n codeList = [\r\n 'gx',\r\n 'g1',\r\n 'g2',\r\n 'g3',\r\n 'g4',\r\n ];\r\n break;\r\n case 'who grading system for cns tumours':\r\n codeList = [\r\n 'grade i',\r\n 'grade ii',\r\n 'grade iii',\r\n 'grade iv',\r\n ];\r\n break;\r\n case 'fnclcc grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'gleason grade group system':\r\n codeList = [\r\n 'grade group 1',\r\n 'grade group 2',\r\n 'grade group 3',\r\n 'grade group 4',\r\n 'grade group 5',\r\n ];\r\n break;\r\n case 'scarff-bloom-richardson grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'nuclear grading system for dcis':\r\n codeList = tieredGradingList;\r\n break;\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase())) {\r\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\r\n $row.tumour_grading_system\r\n }', 'tumour_grade' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\r\n result.valid = false;\r\n const msg = \"'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.\";\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })()"]}}},"percent_tumour_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)","right":"Indicate a value, in decimals, that represents the percentage of infiltration by tumour cells in a specimen."},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null},"script":{"left":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"],"right":null}}},"percent_proliferating_cells":{"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_inflammatory_tissue":{"description":{"left":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)","right":"Indicate a value, in decimals, that represents local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_stromal_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)","right":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a malignant tumour specimen but are not malignant such as fibroblasts, vascular structures, etc."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_necrosis":{"description":{"left":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)","right":"Indicate a value, in decimals, that represents the percentage of cell death in a malignant tumour specimen."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}}},"created":{},"deleted":{"specimen_laterality":{"changeType":"deleted","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"percent_tumour_cells_measurement_method":{"changeType":"deleted","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"age_at_diagnosis":{"description":{"left":"Age that the donor was first diagnosed with cancer, in years. This should be based on the earliest diagnosis of cancer.","right":"Age that the donor was first diagnosed with cancer, in years."},"restrictions":{"range":{"left":{"exclusiveMin":0,"max":90},"right":null}}},"number_lymph_nodes_examined":{"description":{"left":"The total number of lymph nodes tested for the presence of cancer. (Reference: caDSR CDE ID 3)","right":"The total number of lymph nodes tested for the presence of cancer. (Reference: NCI CDE ID: 3)"},"meta":{"dependsOn":{"left":"primary_diagnosis.lymph_nodes_examined_status","right":null},"notes":{"left":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":null},"range":{"left":{"min":0},"right":null}}},"number_lymph_nodes_positive":{"description":{"left":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: caDSR CDE ID 6113694)","right":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: NCI CDE ID: 6113694)"},"meta":{"dependsOn":{"left":"primary_diagnosis.lymph_nodes_examined_status","right":null},"notes":{"left":"This field is only required if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":null},"range":{"left":{"min":0},"right":null},"required":{"left":null,"right":true}}},"clinical_tumour_staging_system":{"meta":{"validationDependency":{"left":true,"right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n /* This is not a required field, so first ensure that it exists */\r\n if ($field) {\r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })()"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}},"required":{"left":null,"right":true}}},"clinical_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"clinical_n_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null}}},"clinical_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"clinical_stage_group":{"description":{"left":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage.","right":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.)."},"meta":{"examples":{"left":"Stage I, Stage IIB","right":null}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.clinical_tumour_staging_system && $field) {\r\n let codeList = [];\r\n switch ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system.trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb',\r\n 'stage ive',\r\n 'stage ivs'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When 'clinical_tumour_staging_system' is set to '${\r\n $row.clinical_tumour_staging_system\r\n }', 'clinical_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })()"]},"required":{"left":null,"right":true}}},"presenting_symptoms":{"restrictions":{"codeList":{"left":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Loss of Appetite","Nausea","None","Not Reported","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Swelling in the Neck","Unknown","Vomiting","Weight Loss"],"right":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Loss of Appetite","Nausea","None","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Unknown","Vomiting","Weight Loss"],"data":{"added":[],"deleted":["Not Reported","Swelling in the Neck"]}}}},"performance_status":{"description":{"left":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status).","right":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference source: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status)."},"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"data":{"added":[],"deleted":["Unknown"]}}}}},"created":{},"deleted":{"laterality":{"changeType":"deleted","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_status":{"changeType":"deleted","name":"lymph_nodes_examined_status","description":"Indicate if lymph nodes were examined for metastases.","valueType":"string","restrictions":{"required":true,"codeList":["Cannot be determined","No","No lymph nodes found in resected specimen","Not applicable","Yes"]},"meta":{"core":true,"displayName":"Lymph Nodes Examined Status"}},"lymph_nodes_examined_method":{"changeType":"deleted","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}}},"treatment":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null},"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":[],"deleted":["End of life care"]}}}},"is_primary_treatment":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"codeList":{"left":["Yes","No"],"right":["Yes","No","Unknown"],"data":{"added":["Unknown"],"deleted":[]}},"required":{"left":null,"right":true}}},"line_of_treatment":{"meta":{"dependsOn":{"left":"treatment.is_primary_treatment","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"],"right":null}}},"treatment_start_interval":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"treatment_duration":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null},"required":{"left":null,"right":true}}},"days_per_cycle":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null}}},"number_of_cycles":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null}}},"toxicity_type":{"description":{"left":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity.","right":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hemotological toxicity or non-hemotological toxicity."},"meta":{"dependsOn":{"left":"treatment.outcome_of_treatment","right":null}},"restrictions":{"codeList":{"left":["Hematological","Non-hematological","Not applicable","Unknown"],"right":["Hemotological","Non-hemotological"],"data":{"added":["Hemotological","Non-hemotological"],"deleted":["Hematological","Non-hematological","Not applicable","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"],"right":null}}},"adverse_events":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"codeList":{"left":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"right":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"data":{"added":[],"deleted":["None","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null}}},"clinical_trials_database":{"meta":{"notes":{"left":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added.","right":null}},"restrictions":{"codeList":{"left":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"],"right":["NCI Clinical Trials","EU Clinical Trials Register"],"data":{"added":[],"deleted":["Not applicable","Unknown"]}}}},"clinical_trial_number":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"],"right":["(function validate() {\r\n let result = {valid: true, message: \"Ok\"};\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n //regex check for clinical trial number\r\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\r\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\r\n\r\n // list of valid clinical trial databases\r\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\r\n \r\n if ($row.clinical_trials_database && $field) {\r\n const trialNumber = $field.trim();\r\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\r\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\r\n result = {valid: false, message: 'The submitted NCI clinical trial number is in incorrect format.'};\r\n }\r\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\r\n result = {valid: false, message: \"The submitted EudraCT clinical trial number is in incorrect format.\"};\r\n }\r\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\r\n result = {valid: false, message: \"The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database.\"};\r\n }\r\n }\r\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\r\n result = {valid: true, message: \"Ok\"};\r\n }\r\n else if ($row.clinical_trials_database && !$field) {\r\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\r\n result = {valid: false, message: \"'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.\"};\r\n } \r\n }\r\n return result;\r\n })()"]}}}},"created":{"age_at_consent_for_treatment":{"changeType":"created","name":"age_at_consent_for_treatment","description":"Indicate the age of donor when consent was given for treatment.","valueType":"integer","meta":{"displayName":"Age At Consent For Treatment"}},"therapeutic_intent":{"changeType":"created","name":"therapeutic_intent","description":"The therapeutic intent, the reason behind the choice of a therapy, of the treatment.","valueType":"string","restrictions":{"required":true,"codeList":["Adjuvant","Concurrent","Curative","Neoadjuvant","Not applicable","Palliative","Unknown"]},"meta":{"core":true,"displayName":"Therapeutic Intent"}},"response_to_therapy":{"changeType":"created","name":"response_to_therapy","description":"The donor's response to the applied treatment regimen. (Source: RECIST)","valueType":"string","restrictions":{"required":true,"codeList":["Complete response","Disease progression","NED","Partial response","Stable disease"]},"meta":{"core":true,"displayName":"Response To Therapy"}},"outcome_of_therapy":{"changeType":"created","name":"outcome_of_therapy","description":"Indicate the donor's outcome of the prescribed treatment.","valueType":"string","restrictions":{"codeList":["Treatment completed as prescribed","Treatment incomplete due to technical or organizational problems","Treatment incomplete because patient died","Patient choice (stopped or interrupted treatment)","Physician decision (stopped or interrupted treatment)","Treatment stopped due to lack of efficacy (disease progression)","Treatment stopped due to acute toxicity","Other","Not applicable","Unknown"]},"meta":{"displayName":"Outcome Of Therapy"}},"hemotological_toxicity":{"changeType":"created","name":"hemotological_toxicity","description":"Indicate the hemotological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5"]},"meta":{"displayName":"Hemotological Toxicity","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"treatment_intent":{"changeType":"deleted","name":"treatment_intent","description":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"]},"meta":{"core":true,"displayName":"Treatment Intent","dependsOn":"treatment.treatment_type"}},"treatment_setting":{"changeType":"deleted","name":"treatment_setting","description":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: NCIt C124308)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"]},"meta":{"core":true,"displayName":"Treatment Setting","dependsOn":"treatment.treatment_type"}},"response_to_treatment_criteria_method":{"changeType":"deleted","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},"response_to_treatment":{"changeType":"deleted","name":"response_to_treatment","description":"The donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"codeList":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"]},"meta":{"core":true,"displayName":"Response To Treatment","dependsOn":"treatment.response_to_treatment_criteria_method","notes":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"outcome_of_treatment":{"changeType":"deleted","name":"outcome_of_treatment","description":"Indicate the donor's outcome of the prescribed treatment.","valueType":"string","restrictions":{"codeList":["Treatment completed as prescribed","Treatment incomplete due to technical or organizational problems","Treatment incomplete because patient died","Patient choice (stopped or interrupted treatment)","Physician decision (stopped or interrupted treatment)","Treatment stopped due to lack of efficacy (disease progression)","Treatment stopped due to acute toxicity","Other","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Outcome Of Treatment","dependsOn":"treatment.treatment_type"}},"hematological_toxicity":{"changeType":"deleted","name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"non-hematological_toxicity":{"changeType":"deleted","name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"chemotherapy":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"dependsOn":{"left":"chemotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"description":{"left":"Name of agent or drug administered to donor as part of the treatment regimen.","right":"Name of agent or drug administered to patient as part of the treatment regimen."},"meta":{"dependsOn":{"left":"chemotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"chemotherapy_dosage_units":{"changeType":"created","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate the total drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"deleted","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"deleted","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"deleted","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"deleted","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"description":{"left":"Name of agent or drug administered to donor as part of the treatment regimen.","right":"Name of agent or drug administered to patient as part of the treatment regimen."},"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"hormone_drug_dosage_units":{"changeType":"created","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"deleted","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"radiation":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"radiation_therapy_fractions":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"radiation_therapy_dosage":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"anatomical_site_irradiated":{"description":{"left":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)","right":"Indicate localization site where radiation therapy was administered."},"restrictions":{"codeList":{"left":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"right":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"data":{"added":["Bone","Extremities","Head-Neck","Peritoneum"],"deleted":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"]}}}}},"created":{},"deleted":{"radiation_boost":{"changeType":"deleted","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"deleted","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}}},"immunotherapy":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"immunotherapy_type":{"changeType":"deleted","name":"immunotherapy_type","valueType":"string","description":"Indicate the type of immunotherapy administered to donor.","meta":{"displayName":"Immunotherapy Type","core":true},"restrictions":{"required":true,"codeList":["Cell-based","Immune checkpoint inhibitors","Monoclonal antibodies other than immune checkpoint inhibitors","Other immunomodulatory substances"]}},"drug_rxnormcui":{"changeType":"deleted","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"deleted","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"deleted","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"surgery":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"deleted","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"deleted","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"deleted","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"deleted","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"deleted","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"deleted","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"deleted","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"deleted","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"deleted","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"deleted","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"deleted","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"deleted","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"deleted","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"deleted","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}}},"follow_up":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_follow_up_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"disease_status_at_followup":{"description":{"left":"Indicate the donor's disease status at time of follow-up. (Reference: RECIST)","right":"Indicate the donor's disease status at time of follow-up."},"restrictions":{"codeList":{"left":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Progression NOS","Relapse or recurrence","Stable"],"right":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Relapse or recurrence","Stable"],"data":{"added":[],"deleted":["Progression NOS"]}}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null},"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"treatment.submitter_treatment_id","right":null},"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"weight_at_followup":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"relapse_type":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })()"]}}},"relapse_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const intervalOfFollowup = parseInt($row.interval_of_followup);\r\n\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n relapseInterval = parseInt($field);\r\n if (relapseInterval > intervalOfFollowup) {\r\n result = {valid: false, message: `'${$name}' cannot be greater than the 'interval_of_followup'.` }\r\n }\r\n }\r\n return result;\r\n })()"]}}},"method_of_progression_status":{"description":{"left":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Reference: caDSR CDE ID 6161031)","right":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Codelist reference: NCI CDE ID: 6161031)"},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })()"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n /* This is not a required field, so first ensure that it exists */\r\n if ($field) {\r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })()","(function validate() {\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })()"]}}},"recurrence_t_category":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"recurrence_n_category":{"meta":{"core":{"left":null,"right":true}}},"recurrence_m_category":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"recurrence_stage_group":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.recurrence_tumour_staging_system && $field) {\r\n let codeList = [];\r\n switch ($row.recurrence_tumour_staging_system && $row.recurrence_tumour_staging_system.trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb',\r\n 'stage ive',\r\n 'stage ivs'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When 'recurrence_tumour_staging_system' is set to '${\r\n $row.recurrence_tumour_staging_system\r\n }', 'recurrence_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })()"]}}},"posttherapy_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n /* This is not a required field, so first ensure that it exists */\r\n if ($field) {\r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })()"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"posttherapy_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"posttherapy_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"posttherapy_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.posttherapy_tumour_staging_system && $field) {\r\n let codeList = [];\r\n switch ($row.posttherapy_tumour_staging_system && $row.posttherapy_tumour_staging_system.trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb',\r\n 'stage ive',\r\n 'stage ivs'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When 'posttherapy_tumour_staging_system' is set to '${\r\n $row.posttherapy_tumour_staging_system\r\n }', 'posttherapy_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })()"]}}}},"created":{"anatomic_site_progression_or_recurrences":{"changeType":"created","description":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate() {\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })()"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1,C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}}},"deleted":{"anatomic_site_progression_or_recurrence":{"changeType":"deleted","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"exposure":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"deleted","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"deleted","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"deleted","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"deleted","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"deleted","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"deleted","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"deleted","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"deleted","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"deleted","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"deleted","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"deleted","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}}},"family_history":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"family_relative_id":{"changeType":"deleted","description":"Unique identifier of the relative, assigned by the data provider.","name":"family_relative_id","valueType":"string","meta":{"displayName":"Family Relative ID","primaryId":true,"notes":"This field is required to ensure that family members are identified in unique records. Ids can be as simple as an incremented numeral to ensure uniqueness."},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"relative_with_cancer_history":{"changeType":"deleted","description":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","name":"relative_with_cancer_history","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Relative with Cancer History"}},"relationship_type":{"changeType":"deleted","description":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","name":"relationship_type","restrictions":{"codeList":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"]},"valueType":"string","meta":{"displayName":"Relationship Type"}},"gender_of_relative":{"changeType":"deleted","description":"The self-reported gender of related individual.","name":"gender_of_relative","restrictions":{"codeList":["Female","Male","Other","Unknown"]},"valueType":"string","meta":{"displayName":"Gender of Relative"}},"age_of_relative_at_diagnosis":{"changeType":"deleted","description":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","name":"age_of_relative_at_diagnosis","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","displayName":"Age Of Relative At Diagnosis"}},"cancer_type_code_of_relative":{"changeType":"deleted","name":"cancer_type_code_of_relative","valueType":"string","description":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"examples":"C41.1,C16.9,C00.5,D46.9","dependsOn":"family_history.relative_with_cancer_history","displayName":"Cancer Type Code (ICD-10) of Relative"}},"relative_vital_status":{"changeType":"deleted","description":"Relative's last known state of living or deceased.","name":"relative_vital_status","restrictions":{"codeList":["Alive","Deceased","Unknown"]},"valueType":"string","meta":{"displayName":"Vital Status of Relative"}},"cause_of_death_of_relative":{"changeType":"deleted","description":"Indicate the cause of the death of the relative.","name":"cause_of_death_of_relative","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]},"valueType":"string","meta":{"dependsOn":"family_history.relative_vital_status","displayName":"Cause of Death of Relative"}},"relative_survival_time":{"changeType":"deleted","description":"Indicate how long, in days, the relative survived from the time they were diagnosed with cancer.","name":"relative_survival_time","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","units":"days","displayName":"Survival Time Of Relative"}}}},"biomarker":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"deleted","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"deleted","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"deleted","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"deleted","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"deleted","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"deleted","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"deleted","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"deleted","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"deleted","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"deleted","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"deleted","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"deleted","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"deleted","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"deleted","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"deleted","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"deleted","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}}},"comorbidity":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"deleted","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"deleted","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"deleted","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"deleted","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"deleted","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"deleted","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}}}}} diff --git a/scripts/data/schemas/diffs/1.24/1.24-diff-1.1.json b/scripts/data/schemas/diffs/1.24/1.24-diff-1.1.json new file mode 100644 index 00000000..be8c8716 --- /dev/null +++ b/scripts/data/schemas/diffs/1.24/1.24-diff-1.1.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":[],"deleted":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n\n const row = $row;\n let result = {valid: true, message: \"Ok\"};\n \n const designation = row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\"){\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when tumour_normal_designation is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when tumour_normal_designation is set to Tumour.\"};\n }\n }\n return result;\n })()"]}}},"submitter_sample_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased"],"right":["Alive","Deceased","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"cause_of_death":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })()"]}}},"survival_time":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })()"]},"range":{"left":{"exclusiveMin":0},"right":null}}},"primary_site":{"meta":{"notes":{"left":"To include multiple values, separate values with a pipe delimiter '|' within your file.","right":null},"examples":{"left":"Breast|Ovary","right":null}},"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Not Reported","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva","Unknown"],"data":{"added":["Not Reported","Unknown"],"deleted":["Unknown primary site"]}}}},"height":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"weight":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"bmi":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"menopause_status":{"description":{"left":"Indicate the donor's menopause status at the time of primary diagnosis. (Reference: caDSR CDE ID 2434914)","right":"Indicate the donor's menopause status at the time of primary diagnosis. (Codelist reference: NCI CDE ID: 2434914)"},"restrictions":{"codeList":{"left":["Not applicable","Perimenopausal","Postmenopausal","Premenopausal","Unknown"],"right":["Indeterminate or unknown","Not applicable","Perimenopausal","Postmenopausal","Premenopausal"],"data":{"added":["Indeterminate or unknown"],"deleted":["Unknown"]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)","right":"Indicate the donor's age of menarche, the first occurrence of menstruation."},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"number_of_pregnancies":{"description":{"left":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)","right":"Indicate the number of pregnancies a donor has had."},"restrictions":{"range":{"left":{"min":0},"right":null}}},"number_of_children":{"description":{"left":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)","right":"Indicate the number of children the donor has birthed."},"restrictions":{"range":{"left":{"min":0},"right":null}}}},"created":{"prior_malignancy":{"changeType":"created","description":"Prior malignancy affecting donor.","name":"prior_malignancy","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy","examples":"C41.1, C16.9, C00.5, D46.9"}},"cancer_type_prior_malignancy":{"changeType":"created","description":"The code to represent the cancer type of a prior malignancy using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","name":"cancer_type_prior_malignancy","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"valueType":"string","meta":{"displayName":"Cancer Type Prior Malignancy"}},"age_at_prior_malignancy":{"changeType":"created","description":"If donor has history of prior malignancy, indicate age at previous diagnosis, in years.","name":"age_at_prior_malignancy","valueType":"integer","meta":{"displayName":"Age at Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"created","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Codelist reference: NCI CDE: 4122391)","name":"laterality_of_prior_malignancy","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality at Prior Malignancy"}}},"deleted":{"genetic_disorders":{"changeType":"deleted","description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},"hrt_type":{"changeType":"deleted","description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},"hrt_duration":{"changeType":"deleted","description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},"contraception_type":{"changeType":"deleted","description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},"contraception_duration":{"changeType":"deleted","description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},"lost_to_followup_after_clinical_event_id":{"changeType":"deleted","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}}},"specimen":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null},"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"pathological_tumour_staging_system":{"meta":{"validationDependency":{"left":true,"right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"pathological_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"pathological_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"pathological_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n if ($row.pathological_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.pathological_tumour_staging_system && $row.pathological_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'pathological_tumour_staging_system' is set to '${\n $row.pathological_tumour_staging_system\n }', 'pathological_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })()"]}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"data":{"added":[],"deleted":["Unknown"]}}}},"specimen_storage":{"description":{"left":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured.","right":"Indicate the method of specimen storage for specimens that were not extracted freshly or immediately cultured."},"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"data":{"added":[],"deleted":["Unknown"]}}}},"reference_pathology_confirmed":{"description":{"left":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)","right":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist."}},"tumour_grading_system":{"meta":{"validationDependency":{"left":true,"right":null}}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = \"'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.\";\n result.message = msg;\n }\n }\n return result;\n })()"]}}},"percent_tumour_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)","right":"Indicate a value, in decimals, that represents the percentage of infiltration by tumour cells in a specimen."},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null},"script":{"left":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"],"right":null}}},"percent_proliferating_cells":{"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_inflammatory_tissue":{"description":{"left":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)","right":"Indicate a value, in decimals, that represents local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_stromal_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)","right":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a malignant tumour specimen but are not malignant such as fibroblasts, vascular structures, etc."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_necrosis":{"description":{"left":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)","right":"Indicate a value, in decimals, that represents the percentage of cell death in a malignant tumour specimen."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}}},"created":{},"deleted":{"specimen_laterality":{"changeType":"deleted","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"percent_tumour_cells_measurement_method":{"changeType":"deleted","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"age_at_diagnosis":{"restrictions":{"range":{"left":{"exclusiveMin":0,"max":90},"right":null}}},"number_lymph_nodes_examined":{"description":{"left":"The total number of lymph nodes tested for the presence of cancer. (Reference: caDSR CDE ID 3)","right":"The total number of lymph nodes tested for the presence of cancer. (Reference: NCI CDE ID: 3)"},"meta":{"dependsOn":{"left":"primary_diagnosis.lymph_nodes_examined_status","right":null},"notes":{"left":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":null},"range":{"left":{"min":0},"right":null}}},"number_lymph_nodes_positive":{"description":{"left":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: caDSR CDE ID 6113694)","right":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: NCI CDE ID: 6113694)"},"meta":{"dependsOn":{"left":"primary_diagnosis.lymph_nodes_examined_status","right":null},"notes":{"left":"This field is only required if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":null},"range":{"left":{"min":0},"right":null},"required":{"left":null,"right":true}}},"clinical_tumour_staging_system":{"meta":{"validationDependency":{"left":true,"right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}},"required":{"left":null,"right":true}}},"clinical_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"clinical_n_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null}}},"clinical_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"clinical_stage_group":{"description":{"left":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage.","right":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.)."},"meta":{"examples":{"left":"Stage I, Stage IIB","right":null}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n if ($row.clinical_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'clinical_tumour_staging_system' is set to '${\n $row.clinical_tumour_staging_system\n }', 'clinical_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })()"]},"required":{"left":null,"right":true}}},"presenting_symptoms":{"restrictions":{"codeList":{"left":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Loss of Appetite","Nausea","None","Not Reported","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Swelling in the Neck","Unknown","Vomiting","Weight Loss"],"right":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Loss of Appetite","Nausea","None","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Unknown","Vomiting","Weight Loss"],"data":{"added":[],"deleted":["Not Reported","Swelling in the Neck"]}}}},"performance_status":{"description":{"left":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status).","right":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference source: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status)."},"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"data":{"added":[],"deleted":["Unknown"]}}}}},"created":{},"deleted":{"laterality":{"changeType":"deleted","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_status":{"changeType":"deleted","name":"lymph_nodes_examined_status","description":"Indicate if lymph nodes were examined for metastases.","valueType":"string","restrictions":{"required":true,"codeList":["Cannot be determined","No","No lymph nodes found in resected specimen","Not applicable","Yes"]},"meta":{"core":true,"displayName":"Lymph Nodes Examined Status"}},"lymph_nodes_examined_method":{"changeType":"deleted","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}}},"treatment":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null},"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":[],"deleted":["End of life care"]}}}},"is_primary_treatment":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"codeList":{"left":["Yes","No"],"right":["Yes","No","Unknown"],"data":{"added":["Unknown"],"deleted":[]}},"required":{"left":null,"right":true}}},"line_of_treatment":{"meta":{"dependsOn":{"left":"treatment.is_primary_treatment","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"],"right":null}}},"treatment_start_interval":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"treatment_duration":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null},"required":{"left":null,"right":true}}},"days_per_cycle":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null}}},"number_of_cycles":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null}}},"toxicity_type":{"description":{"left":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity.","right":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hemotological toxicity or non-hemotological toxicity."},"meta":{"dependsOn":{"left":"treatment.outcome_of_treatment","right":null}},"restrictions":{"codeList":{"left":["Hematological","Non-hematological","Not applicable","Unknown"],"right":["Hemotological","Non-hemotological"],"data":{"added":["Hemotological","Non-hemotological"],"deleted":["Hematological","Non-hematological","Not applicable","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"],"right":null}}},"adverse_events":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"codeList":{"left":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"right":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"data":{"added":[],"deleted":["None","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null}}},"clinical_trials_database":{"meta":{"notes":{"left":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added.","right":null}},"restrictions":{"codeList":{"left":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"],"right":["NCI Clinical Trials","EU Clinical Trials Register"],"data":{"added":[],"deleted":["Not applicable","Unknown"]}}}},"clinical_trial_number":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: 'The submitted NCI clinical trial number is in incorrect format.'};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: \"The submitted EudraCT clinical trial number is in incorrect format.\"};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: \"The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database.\"};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: \"'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.\"};\n } \n }\n return result;\n })()"]}}}},"created":{"age_at_consent_for_treatment":{"changeType":"created","name":"age_at_consent_for_treatment","description":"Indicate the age of donor when consent was given for treatment.","valueType":"integer","meta":{"displayName":"Age At Consent For Treatment"}},"therapeutic_intent":{"changeType":"created","name":"therapeutic_intent","description":"The therapeutic intent, the reason behind the choice of a therapy, of the treatment.","valueType":"string","restrictions":{"required":true,"codeList":["Adjuvant","Concurrent","Curative","Neoadjuvant","Not applicable","Palliative","Unknown"]},"meta":{"core":true,"displayName":"Therapeutic Intent"}},"response_to_therapy":{"changeType":"created","name":"response_to_therapy","description":"The donor's response to the applied treatment regimen. (Source: RECIST)","valueType":"string","restrictions":{"required":true,"codeList":["Complete response","Disease progression","NED","Partial response","Stable disease"]},"meta":{"core":true,"displayName":"Response To Therapy"}},"outcome_of_therapy":{"changeType":"created","name":"outcome_of_therapy","description":"Indicate the donor's outcome of the prescribed treatment.","valueType":"string","restrictions":{"codeList":["Treatment completed as prescribed","Treatment incomplete due to technical or organizational problems","Treatment incomplete because patient died","Patient choice (stopped or interrupted treatment)","Physician decision (stopped or interrupted treatment)","Treatment stopped due to lack of efficacy (disease progression)","Treatment stopped due to acute toxicity","Other","Not applicable","Unknown"]},"meta":{"displayName":"Outcome Of Therapy"}},"hemotological_toxicity":{"changeType":"created","name":"hemotological_toxicity","description":"Indicate the hemotological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5"]},"meta":{"displayName":"Hemotological Toxicity","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"treatment_intent":{"changeType":"deleted","name":"treatment_intent","description":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"]},"meta":{"core":true,"displayName":"Treatment Intent","dependsOn":"treatment.treatment_type"}},"treatment_setting":{"changeType":"deleted","name":"treatment_setting","description":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: NCIt C124308)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"]},"meta":{"core":true,"displayName":"Treatment Setting","dependsOn":"treatment.treatment_type"}},"response_to_treatment_criteria_method":{"changeType":"deleted","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},"response_to_treatment":{"changeType":"deleted","name":"response_to_treatment","description":"The donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"codeList":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"]},"meta":{"core":true,"displayName":"Response To Treatment","dependsOn":"treatment.response_to_treatment_criteria_method","notes":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"outcome_of_treatment":{"changeType":"deleted","name":"outcome_of_treatment","description":"Indicate the donor's outcome of the prescribed treatment.","valueType":"string","restrictions":{"codeList":["Treatment completed as prescribed","Treatment incomplete due to technical or organizational problems","Treatment incomplete because patient died","Patient choice (stopped or interrupted treatment)","Physician decision (stopped or interrupted treatment)","Treatment stopped due to lack of efficacy (disease progression)","Treatment stopped due to acute toxicity","Other","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Outcome Of Treatment","dependsOn":"treatment.treatment_type"}},"hematological_toxicity":{"changeType":"deleted","name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"non-hematological_toxicity":{"changeType":"deleted","name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"chemotherapy":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"dependsOn":{"left":"chemotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"description":{"left":"Name of agent or drug administered to donor as part of the treatment regimen.","right":"Name of agent or drug administered to patient as part of the treatment regimen."},"meta":{"dependsOn":{"left":"chemotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"chemotherapy_dosage_units":{"changeType":"created","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate the total drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"deleted","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"deleted","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"deleted","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"deleted","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"description":{"left":"Name of agent or drug administered to donor as part of the treatment regimen.","right":"Name of agent or drug administered to patient as part of the treatment regimen."},"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"hormone_drug_dosage_units":{"changeType":"created","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"deleted","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"radiation":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"radiation_therapy_fractions":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"radiation_therapy_dosage":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"anatomical_site_irradiated":{"description":{"left":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)","right":"Indicate localization site where radiation therapy was administered."},"restrictions":{"codeList":{"left":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"right":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"data":{"added":["Bone","Extremities","Head-Neck","Peritoneum"],"deleted":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"]}}}}},"created":{},"deleted":{"radiation_boost":{"changeType":"deleted","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"deleted","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}}},"immunotherapy":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"immunotherapy_type":{"changeType":"deleted","name":"immunotherapy_type","valueType":"string","description":"Indicate the type of immunotherapy administered to donor.","meta":{"displayName":"Immunotherapy Type","core":true},"restrictions":{"required":true,"codeList":["Cell-based","Immune checkpoint inhibitors","Monoclonal antibodies other than immune checkpoint inhibitors","Other immunomodulatory substances"]}},"drug_rxnormcui":{"changeType":"deleted","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"deleted","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"deleted","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"surgery":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"deleted","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"deleted","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"deleted","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"deleted","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"deleted","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"deleted","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"deleted","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"deleted","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"deleted","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"deleted","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"deleted","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"deleted","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"deleted","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"deleted","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}}},"follow_up":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_follow_up_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null},"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"treatment.submitter_treatment_id","right":null},"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"weight_at_followup":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"relapse_type":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })()"]}}},"relapse_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `'${$name}' cannot be greater than the 'interval_of_followup'.` }\n }\n }\n return result;\n })()"]}}},"method_of_progression_status":{"description":{"left":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Reference: caDSR CDE ID 6161031)","right":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Codelist reference: NCI CDE ID: 6161031)"},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })()"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })()"]}}},"recurrence_t_category":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"recurrence_n_category":{"meta":{"core":{"left":null,"right":true}}},"recurrence_m_category":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"recurrence_stage_group":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n if ($row.recurrence_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.recurrence_tumour_staging_system && $row.recurrence_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'recurrence_tumour_staging_system' is set to '${\n $row.recurrence_tumour_staging_system\n }', 'recurrence_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })()"]}}},"posttherapy_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"posttherapy_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"posttherapy_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"posttherapy_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n if ($row.posttherapy_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.posttherapy_tumour_staging_system && $row.posttherapy_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'posttherapy_tumour_staging_system' is set to '${\n $row.posttherapy_tumour_staging_system\n }', 'posttherapy_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })()"]}}}},"created":{"anatomic_site_progression_or_recurrences":{"changeType":"created","description":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })()"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1,C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}}},"deleted":{"anatomic_site_progression_or_recurrence":{"changeType":"deleted","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"exposure":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"deleted","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"deleted","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"deleted","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"deleted","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"deleted","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"deleted","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"deleted","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"deleted","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"deleted","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"deleted","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"deleted","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}}},"family_history":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"family_relative_id":{"changeType":"deleted","description":"Unique identifier of the relative, assigned by the data provider.","name":"family_relative_id","valueType":"string","meta":{"displayName":"Family Relative ID","primaryId":true,"notes":"This field is required to ensure that family members are identified in unique records. Ids can be as simple as an incremented numeral to ensure uniqueness."},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"relative_with_cancer_history":{"changeType":"deleted","description":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","name":"relative_with_cancer_history","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Relative with Cancer History"}},"relationship_type":{"changeType":"deleted","description":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","name":"relationship_type","restrictions":{"codeList":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"]},"valueType":"string","meta":{"displayName":"Relationship Type"}},"gender_of_relative":{"changeType":"deleted","description":"The self-reported gender of related individual.","name":"gender_of_relative","restrictions":{"codeList":["Female","Male","Other","Unknown"]},"valueType":"string","meta":{"displayName":"Gender of Relative"}},"age_of_relative_at_diagnosis":{"changeType":"deleted","description":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","name":"age_of_relative_at_diagnosis","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","displayName":"Age Of Relative At Diagnosis"}},"cancer_type_code_of_relative":{"changeType":"deleted","name":"cancer_type_code_of_relative","valueType":"string","description":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"examples":"C41.1,C16.9,C00.5,D46.9","dependsOn":"family_history.relative_with_cancer_history","displayName":"Cancer Type Code (ICD-10) of Relative"}},"relative_vital_status":{"changeType":"deleted","description":"Relative's last known state of living or deceased.","name":"relative_vital_status","restrictions":{"codeList":["Alive","Deceased","Unknown"]},"valueType":"string","meta":{"displayName":"Vital Status of Relative"}},"cause_of_death_of_relative":{"changeType":"deleted","description":"Indicate the cause of the death of the relative.","name":"cause_of_death_of_relative","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]},"valueType":"string","meta":{"dependsOn":"family_history.relative_vital_status","displayName":"Cause of Death of Relative"}},"relative_survival_time":{"changeType":"deleted","description":"Indicate how long, in days, the relative survived from the time they were diagnosed with cancer.","name":"relative_survival_time","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","units":"days","displayName":"Survival Time Of Relative"}}}},"biomarker":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"deleted","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"deleted","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"deleted","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"deleted","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"deleted","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"deleted","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"deleted","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"deleted","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"deleted","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"deleted","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"deleted","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"deleted","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"deleted","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"deleted","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"deleted","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"deleted","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}}},"comorbidity":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"deleted","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"deleted","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"deleted","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"deleted","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"deleted","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"deleted","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}}}}} diff --git a/scripts/data/schemas/diffs/1.24/1.24-diff-1.10.json b/scripts/data/schemas/diffs/1.24/1.24-diff-1.10.json new file mode 100644 index 00000000..0e84ed71 --- /dev/null +++ b/scripts/data/schemas/diffs/1.24/1.24-diff-1.10.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":[],"deleted":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \r\n const designation = $row.tumour_normal_designation.trim().toLowerCase();\r\n const specimen_type = $field.trim().toLowerCase();\r\n \r\n if (designation === \"normal\") {\r\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\r\n if (!validTypes.includes(specimen_type)) {\r\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\r\n }\r\n }\r\n else if (designation === \"tumour\") {\r\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\r\n if (invalidTypes.includes(specimen_type)) {\r\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\r\n }\r\n }\r\n }\r\n return result;\r\n })"]}}},"submitter_sample_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased"],"right":["Alive","Deceased","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"cause_of_death":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n \r\n if ($row.vital_status != null) {\r\n const vitalStatus = $row.vital_status.trim().toLowerCase();\r\n\r\n if (!currField && vitalStatus === \"deceased\") {\r\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\r\n }\r\n else if (currField && vitalStatus != \"deceased\"){\r\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\r\n }\r\n }\r\n else if (($row.vital_status === null) && (currField)) {\r\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\r\n }\r\n return result;\r\n })"]}}},"survival_time":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n \r\n if ($row.vital_status != null) {\r\n const vitalStatus = $row.vital_status.trim().toLowerCase();\r\n\r\n if (!currField && vitalStatus === \"deceased\") {\r\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\r\n }\r\n else if (currField && vitalStatus != \"deceased\"){\r\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\r\n }\r\n }\r\n else if (($row.vital_status === null) && (currField)) {\r\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\r\n }\r\n return result;\r\n })"]}}},"primary_site":{"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva"],"data":{"added":[],"deleted":["Unknown primary site"]}}}},"genetic_disorders":{"description":{"left":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","right":"Indicate presence of any hereditary genetic disorders. (Reference: Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)"},"restrictions":{"codeList":{"left":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"],"right":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Serrated Polyposis Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"],"data":{"added":[],"deleted":["None","Not applicable","Unknown"]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)","right":"Indicate the donor's age at which the first menstruation event occurred. (Reference: NCIt C19666)"}},"hrt_type":{"restrictions":{"codeList":{"left":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"],"right":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Other","Patch","Pill","Unknown"],"data":{"added":[],"deleted":["Not applicable"]}}}},"hrt_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n const type = $name.trim().toLowerCase().split('_duration')[0];\r\n const hormoneType = type + `_type`;\r\n \r\n if ($field != null && !(checkforEmpty($field))) {\r\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\r\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\r\n }\r\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\") {\r\n const submittedValue = $row[hormoneType].toLowerCase()\r\n result = {valid: false, message: `If '${$name}' is submitted, then '${hormoneType}' field cannot be '${submittedValue}'.`};\r\n }\r\n\r\n }\r\n return result;\r\n })"]}}},"contraception_type":{"restrictions":{"codeList":{"left":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"],"right":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Other","Progestin-only pill","Unknown","Vaginal ring"],"data":{"added":[],"deleted":["Not applicable","Oral contraceptive pill"]}}}},"contraception_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n const type = $name.trim().toLowerCase().split('_duration')[0];\r\n const hormoneType = type + `_type`;\r\n \r\n if ($field != null && !(checkforEmpty($field))) {\r\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\r\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\r\n }\r\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\") {\r\n const submittedValue = $row[hormoneType].toLowerCase()\r\n result = {valid: false, message: `If '${$name}' is submitted, then '${hormoneType}' field cannot be '${submittedValue}'.`};\r\n }\r\n\r\n }\r\n return result;\r\n })"]}}}},"created":{},"deleted":{"lost_to_followup_after_clinical_event_id":{"changeType":"deleted","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}}},"specimen":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"pathological_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\r\n\r\n \r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\r\n if (!($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n /* This is not a required field, so first ensure that it exists */\r\n else if ($field) {\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"pathological_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"pathological_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"pathological_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS"],"data":{"added":[],"deleted":["Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_stage_group')[0];\r\n\r\n const stagingSystem = stagingName + `_tumour_staging_system`;\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\r\n result.valid = false;\r\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\r\n result.message = msg;\r\n }\r\n else if (!($row[stagingSystem]) && $field) {\r\n result.valid = false;\r\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\r\n result.message = msg;\r\n }\r\n else if ($row[stagingSystem] && $field) {\r\n let codeList = [];\r\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage ii bulky',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ies',\r\n 'stage iae',\r\n 'stage ias',\r\n 'stage iaes',\r\n 'stage ib',\r\n 'stage ibe',\r\n 'stage ibs',\r\n 'stage ibes',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iies',\r\n 'stage iiae',\r\n 'stage iias',\r\n 'stage iiaes',\r\n 'stage iib',\r\n 'stage iibe',\r\n 'stage iibs',\r\n 'stage iibes',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iiies',\r\n 'stage iiiae',\r\n 'stage iiias',\r\n 'stage iiiaes',\r\n 'stage iiib',\r\n 'stage iiibe',\r\n 'stage iiibs',\r\n 'stage iiibes',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ive',\r\n 'stage ivs',\r\n 'stage ives',\r\n 'stage ivae',\r\n 'stage ivas',\r\n 'stage ivaes',\r\n 'stage ivb',\r\n 'stage ivbe',\r\n 'stage ivbs',\r\n 'stage ivbes'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\r\n $row[stagingSystem]\r\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n \r\n return result;\r\n })"]}}},"specimen_acquisition_interval":{"restrictions":{"range":{"left":null,"right":{"min":0}}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"data":{"added":[],"deleted":["Unknown"]}}}},"specimen_storage":{"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"data":{"added":[],"deleted":["Unknown"]}}}},"reference_pathology_confirmed":{"description":{"left":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)","right":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist."}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.tumour_grading_system && $field) {\r\n let codeList = [];\r\n const tieredGradingList = ['gx','g1','g2','g3'];\r\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\r\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\r\n case 'two-tier grading system':\r\n codeList = [\r\n 'low grade',\r\n 'high grade',\r\n ];\r\n break;\r\n case 'three-tier grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'four-tier grading system':\r\n codeList = [\r\n 'gx',\r\n 'g1',\r\n 'g2',\r\n 'g3',\r\n 'g4',\r\n ];\r\n break;\r\n case 'grading system for gists':\r\n codeList = [\r\n 'low',\r\n 'high',\r\n ];\r\n break;\r\n case 'grading system for gnets':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'isup grading system':\r\n codeList = [\r\n 'gx',\r\n 'g1',\r\n 'g2',\r\n 'g3',\r\n 'g4',\r\n ];\r\n break;\r\n case 'who grading system for cns tumours':\r\n codeList = [\r\n 'grade i',\r\n 'grade ii',\r\n 'grade iii',\r\n 'grade iv',\r\n ];\r\n break;\r\n case 'fnclcc grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'gleason grade group system':\r\n codeList = [\r\n 'grade group 1',\r\n 'grade group 2',\r\n 'grade group 3',\r\n 'grade group 4',\r\n 'grade group 5',\r\n ];\r\n break;\r\n case 'scarff-bloom-richardson grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'nuclear grading system for dcis':\r\n codeList = tieredGradingList;\r\n break;\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase())) {\r\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\r\n $row.tumour_grading_system\r\n }', 'tumour_grade' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\r\n result.valid = false;\r\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })"]}}},"percent_tumour_cells":{"restrictions":{"script":{"left":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"],"right":null}}},"percent_proliferating_cells":{"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}}},"percent_inflammatory_tissue":{"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}}},"percent_stromal_cells":{"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}}},"percent_necrosis":{"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}}}},"created":{},"deleted":{"specimen_laterality":{"changeType":"deleted","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"percent_tumour_cells_measurement_method":{"changeType":"deleted","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"number_lymph_nodes_examined":{"meta":{"notes":{"left":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n /* checks for a string just consisting of whitespacei */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\r\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\r\n \r\n if ($row.lymph_nodes_examined_status != null) {\r\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\r\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\r\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\r\n if (lymphNodesExaminedStatus === \"yes\") { \r\n if (parseInt($field) <= 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n else if (parseInt($field) > 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n \r\n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\r\n else if ($name === \"number_lymph_nodes_positive\") {\r\n if (lymphNodesExaminedStatus === \"yes\") {\r\n if (checkforEmpty($field) || $field == null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n else if (parseInt($field) < 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n else if ($field || $field != null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n }\r\n return result;\r\n})"]}}},"number_lymph_nodes_positive":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n /* checks for a string just consisting of whitespacei */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\r\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\r\n \r\n if ($row.lymph_nodes_examined_status != null) {\r\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\r\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\r\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\r\n if (lymphNodesExaminedStatus === \"yes\") { \r\n if (parseInt($field) <= 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n else if (parseInt($field) > 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n \r\n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\r\n else if ($name === \"number_lymph_nodes_positive\") {\r\n if (lymphNodesExaminedStatus === \"yes\") {\r\n if (checkforEmpty($field) || $field == null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n else if (parseInt($field) < 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n else if ($field || $field != null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n }\r\n return result;\r\n})"]}}},"clinical_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\r\n\r\n \r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\r\n if (!($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n /* This is not a required field, so first ensure that it exists */\r\n else if ($field) {\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"clinical_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"clinical_n_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null}}},"clinical_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"clinical_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS"],"data":{"added":[],"deleted":["Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_stage_group')[0];\r\n\r\n const stagingSystem = stagingName + `_tumour_staging_system`;\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\r\n result.valid = false;\r\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\r\n result.message = msg;\r\n }\r\n else if (!($row[stagingSystem]) && $field) {\r\n result.valid = false;\r\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\r\n result.message = msg;\r\n }\r\n else if ($row[stagingSystem] && $field) {\r\n let codeList = [];\r\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage ii bulky',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ies',\r\n 'stage iae',\r\n 'stage ias',\r\n 'stage iaes',\r\n 'stage ib',\r\n 'stage ibe',\r\n 'stage ibs',\r\n 'stage ibes',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iies',\r\n 'stage iiae',\r\n 'stage iias',\r\n 'stage iiaes',\r\n 'stage iib',\r\n 'stage iibe',\r\n 'stage iibs',\r\n 'stage iibes',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iiies',\r\n 'stage iiiae',\r\n 'stage iiias',\r\n 'stage iiiaes',\r\n 'stage iiib',\r\n 'stage iiibe',\r\n 'stage iiibs',\r\n 'stage iiibes',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ive',\r\n 'stage ivs',\r\n 'stage ives',\r\n 'stage ivae',\r\n 'stage ivas',\r\n 'stage ivaes',\r\n 'stage ivb',\r\n 'stage ivbe',\r\n 'stage ivbs',\r\n 'stage ivbes'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\r\n $row[stagingSystem]\r\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n \r\n return result;\r\n })"]}}},"performance_status":{"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"data":{"added":[],"deleted":["Unknown"]}}}}},"created":{},"deleted":{"laterality":{"changeType":"deleted","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_method":{"changeType":"deleted","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}}},"treatment":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":[],"deleted":["End of life care"]}}}},"is_primary_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]},"codeList":{"left":["Yes","No"],"right":["Yes","No","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"line_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\r\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\r\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\r\n if (isPrimaryTreatment === 'yes') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\r\n }\r\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\r\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\r\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\r\n }\r\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\r\n else if (isPrimaryTreatment === 'unknown') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'unknown'.`};\r\n }\r\n }\r\n return result;\r\n })"]}}},"treatment_start_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"treatment_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]}}},"days_per_cycle":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]}}},"number_of_cycles":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]}}},"treatment_intent":{"description":{"left":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","right":"Indicate the intended disease outcome for which the treatment is given. (Reference: NCIt C124307)"},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]},"codeList":{"left":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"],"right":["Curative","Palliative","Unknown"],"data":{"added":["Unknown"],"deleted":["Diagnostic","Forensic","Guidance","Preventative","Screening","Supportive"]}}}},"treatment_setting":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]},"codeList":{"left":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"],"right":["Adjuvant","Advanced/Metastatic","Neoadjuvant","Not applicable"],"data":{"added":["Not applicable"],"deleted":["Conditioning","Induction","Maintenance","Mobilization","Preventative","Radiosensitization","Salvage"]}}}},"response_to_treatment":{"description":{"left":"The donor's response to the applied treatment regimen.","right":"The donor's response to the applied treatment regimen. (Source: RECIST)"},"meta":{"dependsOn":{"left":"treatment.response_to_treatment_criteria_method","right":"treatment.treatment_type"},"notes":{"left":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]},"codeList":{"left":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"],"right":["Complete response","Disease progression","NED","Partial response","Stable disease"],"data":{"added":["Disease progression","NED"],"deleted":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease"]}}}},"outcome_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]}}},"toxicity_type":{"restrictions":{"codeList":{"left":["Hematological","Non-hematological","Not applicable","Unknown"],"right":["Hematological","Non-hematological"],"data":{"added":[],"deleted":["Not applicable","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($field != null && !(checkforEmpty($field))) {\r\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \r\n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\r\n \r\n /* toxicityType should only be submitted if treatment was terminated early due to acute toxicity ('outcome_of_treatment' is 'Treatment stopped due to acute toxicity'). */\r\n if (outcomeOfTreatment != \"treatment stopped due to acute toxicity\") {\r\n result = { valid: false, message: `The 'outcome_of_treatment' field should be 'Treatment stopped due to acute toxicity' if the '${$name}' field is submitted.`};\r\n }\r\n }\r\n else {\r\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\r\n }\r\n }\r\n return result;\r\n })"]}}},"hematological_toxicity":{"restrictions":{"codeList":{"left":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"right":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5"],"data":{"added":[],"deleted":["Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($field != null && !(checkforEmpty($field))) {\r\n if (($row.toxicity_type != null && !(checkforEmpty($row.toxicity_type)))) { \r\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\r\n \r\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\r\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\r\n }\r\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\r\n }\r\n }\r\n else {\r\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"]}}},"non-hematological_toxicity":{"restrictions":{"codeList":{"left":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"right":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"data":{"added":[],"deleted":["Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($field != null && !(checkforEmpty($field))) {\r\n if (($row.toxicity_type != null && !(checkforEmpty($row.toxicity_type)))) { \r\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\r\n \r\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\r\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\r\n }\r\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\r\n }\r\n }\r\n else {\r\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"]}}},"adverse_events":{"restrictions":{"codeList":{"left":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"right":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"data":{"added":[],"deleted":["None","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]}}},"clinical_trials_database":{"meta":{"notes":{"left":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added.","right":null}},"restrictions":{"codeList":{"left":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"],"right":["NCI Clinical Trials","EU Clinical Trials Register"],"data":{"added":[],"deleted":["Not applicable","Unknown"]}}}},"clinical_trial_number":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n //regex check for clinical trial number\r\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\r\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\r\n\r\n // list of valid clinical trial databases\r\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\r\n \r\n if ($row.clinical_trials_database && $field) {\r\n const trialNumber = $field.trim();\r\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\r\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\r\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\r\n }\r\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\r\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\r\n }\r\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\r\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database.`};\r\n }\r\n }\r\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\r\n result = {valid: true, message: \"Ok\"};\r\n }\r\n else if ($row.clinical_trials_database && !$field) {\r\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\r\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\r\n } \r\n }\r\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\r\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\r\n }\r\n return result;\r\n })"]}}}},"created":{},"deleted":{"response_to_treatment_criteria_method":{"changeType":"deleted","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}}}},"chemotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"dependsOn":{"left":"chemotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"dependsOn":{"left":"chemotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"chemotherapy_dosage_units":{"changeType":"created","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate the total actual drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true,"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"deleted","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"deleted","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"deleted","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"deleted","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"hormone_drug_dosage_units":{"changeType":"created","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true,"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"deleted","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"radiation":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"radiation_therapy_dosage":{"valueType":{"left":"number","right":"integer"}},"anatomical_site_irradiated":{"description":{"left":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)","right":"Indicate localization site where radiation therapy was administered."},"restrictions":{"codeList":{"left":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"right":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"data":{"added":["Bone","Extremities","Head-Neck","Peritoneum"],"deleted":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"]}}}}},"created":{},"deleted":{"radiation_boost":{"changeType":"deleted","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"deleted","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}}},"immunotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"immunotherapy_type":{"meta":{"core":{"left":true,"right":null}}},"drug_rxnormcui":{"meta":{"dependsOn":{"left":"immunotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"dependsOn":{"left":"immunotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"},"displayName":{"left":"Chemotherapy Drug Name","right":"Immunotherapy Drug Name"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"deleted","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"surgery":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"deleted","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"deleted","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"deleted","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"deleted","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"deleted","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"deleted","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"deleted","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"deleted","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"deleted","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"deleted","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"deleted","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"deleted","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"deleted","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"deleted","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}}},"follow_up":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_follow_up_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"interval_of_followup":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"treatment.submitter_treatment_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"relapse_type":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n if ($row.disease_status_at_followup != null) {\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n }\r\n return result;\r\n })"]}}},"relapse_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n if ($row.disease_status_at_followup != null) {\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const intervalOfFollowup = parseInt($row.interval_of_followup);\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n relapseInterval = parseInt($field);\r\n if (relapseInterval > intervalOfFollowup) {\r\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\r\n }\r\n }\r\n }\r\n return result;\r\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"method_of_progression_status":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n if ($row.disease_status_at_followup != null) {\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n }\r\n return result;\r\n })"]}}},"anatomic_site_progression_or_recurrence":{"description":{"left":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","right":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344."},"meta":{"examples":{"left":"C50.1|C18","right":"C50.1,C18"},"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n if ($row.disease_status_at_followup != null) {\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n }\r\n return result;\r\n })"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\r\n\r\n \r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\r\n if (!($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n /* This is not a required field, so first ensure that it exists */\r\n else if ($field) {\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })","(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n if ($row.disease_status_at_followup != null) {\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n }\r\n return result;\r\n })"]}}},"recurrence_t_category":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"recurrence_n_category":{"meta":{"core":{"left":null,"right":true}}},"recurrence_m_category":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"recurrence_stage_group":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS"],"data":{"added":[],"deleted":["Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_stage_group')[0];\r\n\r\n const stagingSystem = stagingName + `_tumour_staging_system`;\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\r\n result.valid = false;\r\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\r\n result.message = msg;\r\n }\r\n else if (!($row[stagingSystem]) && $field) {\r\n result.valid = false;\r\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\r\n result.message = msg;\r\n }\r\n else if ($row[stagingSystem] && $field) {\r\n let codeList = [];\r\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage ii bulky',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ies',\r\n 'stage iae',\r\n 'stage ias',\r\n 'stage iaes',\r\n 'stage ib',\r\n 'stage ibe',\r\n 'stage ibs',\r\n 'stage ibes',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iies',\r\n 'stage iiae',\r\n 'stage iias',\r\n 'stage iiaes',\r\n 'stage iib',\r\n 'stage iibe',\r\n 'stage iibs',\r\n 'stage iibes',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iiies',\r\n 'stage iiiae',\r\n 'stage iiias',\r\n 'stage iiiaes',\r\n 'stage iiib',\r\n 'stage iiibe',\r\n 'stage iiibs',\r\n 'stage iiibes',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ive',\r\n 'stage ivs',\r\n 'stage ives',\r\n 'stage ivae',\r\n 'stage ivas',\r\n 'stage ivaes',\r\n 'stage ivb',\r\n 'stage ivbe',\r\n 'stage ivbs',\r\n 'stage ivbes'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\r\n $row[stagingSystem]\r\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n \r\n return result;\r\n })"]}}},"posttherapy_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\r\n\r\n \r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\r\n if (!($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n /* This is not a required field, so first ensure that it exists */\r\n else if ($field) {\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"posttherapy_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"posttherapy_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"posttherapy_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS"],"data":{"added":[],"deleted":["Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_stage_group')[0];\r\n\r\n const stagingSystem = stagingName + `_tumour_staging_system`;\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\r\n result.valid = false;\r\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\r\n result.message = msg;\r\n }\r\n else if (!($row[stagingSystem]) && $field) {\r\n result.valid = false;\r\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\r\n result.message = msg;\r\n }\r\n else if ($row[stagingSystem] && $field) {\r\n let codeList = [];\r\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage ii bulky',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ies',\r\n 'stage iae',\r\n 'stage ias',\r\n 'stage iaes',\r\n 'stage ib',\r\n 'stage ibe',\r\n 'stage ibs',\r\n 'stage ibes',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iies',\r\n 'stage iiae',\r\n 'stage iias',\r\n 'stage iiaes',\r\n 'stage iib',\r\n 'stage iibe',\r\n 'stage iibs',\r\n 'stage iibes',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iiies',\r\n 'stage iiiae',\r\n 'stage iiias',\r\n 'stage iiiaes',\r\n 'stage iiib',\r\n 'stage iiibe',\r\n 'stage iiibs',\r\n 'stage iiibes',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ive',\r\n 'stage ivs',\r\n 'stage ives',\r\n 'stage ivae',\r\n 'stage ivas',\r\n 'stage ivaes',\r\n 'stage ivb',\r\n 'stage ivbe',\r\n 'stage ivbs',\r\n 'stage ivbes'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\r\n $row[stagingSystem]\r\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n \r\n return result;\r\n })"]}}}},"created":{},"deleted":{}},"exposure":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"tobacco_smoking_status":{"restrictions":{"codeList":{"left":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"],"right":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Smoking history not documented"],"data":{"added":[],"deleted":["Not applicable"]}}}},"tobacco_type":{"restrictions":{"codeList":{"left":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"right":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Roll-ups","Snuff","Unknown","Waterpipe"],"data":{"added":[],"deleted":["Not applicable","Pipe"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n // check tobacco related fields\r\n if ($name === 'tobacco_type') {\r\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\r\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\r\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\r\n }\r\n else if ($row.tobacco_smoking_status.toLowerCase() === 'smoking history not documented') {\r\n result = { valid: false, message: `The 'tobacco_smoking_status' field (smoking status not documented) is inconsistent if donor smoked '${$row.tobacco_type}'.`};\r\n }\r\n else if ($row.tobacco_smoking_status.toLowerCase() === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if donor is a lifelong non-smoker.`}\r\n }\r\n }\r\n else {\r\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\r\n if (smokerCategories.includes($row.tobacco_smoking_status.toLowerCase())) {\r\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\r\n }\r\n }\r\n }\r\n }\r\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\r\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\r\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\r\n }\r\n }\r\n return result;\r\n })"]}}},"pack_years_smoked":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n // check tobacco related fields\r\n if ($name === 'tobacco_type') {\r\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\r\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\r\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\r\n }\r\n else if ($row.tobacco_smoking_status.toLowerCase() === 'smoking history not documented') {\r\n result = { valid: false, message: `The 'tobacco_smoking_status' field (smoking status not documented) is inconsistent if donor smoked '${$row.tobacco_type}'.`};\r\n }\r\n else if ($row.tobacco_smoking_status.toLowerCase() === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if donor is a lifelong non-smoker.`}\r\n }\r\n }\r\n else {\r\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\r\n if (smokerCategories.includes($row.tobacco_smoking_status.toLowerCase())) {\r\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\r\n }\r\n }\r\n }\r\n }\r\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\r\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\r\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\r\n }\r\n }\r\n return result;\r\n })"]}}},"alcohol_history":{"restrictions":{"codeList":{"left":["Yes","No","Not applicable","Unknown"],"right":["Yes","No","Unknown"],"data":{"added":[],"deleted":["Not applicable"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\r\n noOrUnknownAllowedCategories = [\"none\", \"occasional drinker (< once a month)\", \"unknown\"];\r\n \r\n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\r\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\r\n if ((!$field || $field == null || checkforEmpty($field)) && alcoholHistoryCategories.includes(alcoholConsumptionCategory)) {\r\n result = {valid:false, message: `If the donor is a '${alcoholConsumptionCategory}', then the 'alcohol_history' field must be submitted as well.`};\r\n }\r\n if ((!$field || $field === null || checkforEmpty($field) || $field.trim().toLowerCase() === 'no') && (!(noOrUnknownAllowedCategories.includes(alcoholConsumptionCategory)))) {\r\n result = {valid:false, message: `If the donor is a '${alcoholConsumptionCategory}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\r\n }\r\n }\r\n return result;\r\n })"]}}},"alcohol_consumption_category":{"restrictions":{"codeList":{"left":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"right":["Daily Drinker","None","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"data":{"added":[],"deleted":["Not applicable"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\r\n \r\n if (!$field || $field === null || checkforEmpty($field)) {\r\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\r\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\r\n }\r\n }\r\n else {\r\n alcoholConsumptionCategory = $field.trim().toLowerCase();\r\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\r\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\r\n }\r\n }\r\n return result;\r\n })"]}}},"alcohol_type":{"restrictions":{"codeList":{"left":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"right":["Beer","Liquor","Other","Unknown","Wine"],"data":{"added":[],"deleted":["Not applicable"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n exclusionTerms = [\"no\", \"none\", \"unknown\"]; \r\n requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\r\n \r\n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\r\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\r\n if ($field && $field != null && !(checkforEmpty($field))) {\r\n if (exclusionTerms.includes(alcoholConsumptionCategory)) {\r\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field should not be submitted.`};\r\n }\r\n }\r\n else {\r\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\r\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\r\n }\r\n }\r\n }\r\n if ($field && $field != null && !(checkforEmpty($field)) && (!$row.alcohol_consumption_category || $row.alcohol_consumption_category === null || checkforEmpty($row.alcohol_consumption_category))) {\r\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\r\n }\r\n return result;\r\n })"]}}},"opiate_use":{"restrictions":{"codeList":{"left":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"],"right":["Never","Unknown","Yes, currently","Yes, only in the past"],"data":{"added":[],"deleted":["Not applicable"]}}}},"hot_drinks_consumption":{"restrictions":{"codeList":{"left":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"],"right":["Never","Unknown","Yes, currently","Yes, only in the past"],"data":{"added":[],"deleted":["Not applicable"]}}}},"red_meat_frequency":{"restrictions":{"codeList":{"left":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"],"right":["Never","Less than once a month","1-3 times a month","Once or twice a week","Most days but not every day","Every day","Unknown"],"data":{"added":[],"deleted":["Not applicable"]}}}},"processed_meat_frequency":{"restrictions":{"codeList":{"left":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"],"right":["Never","Less than once a month","1-3 times a month","Once or twice a week","Most days but not every day","Every day","Unknown"],"data":{"added":[],"deleted":["Not applicable"]}}}},"soft_drinks_frequency":{"restrictions":{"codeList":{"left":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"],"right":["Never","Less than once a month","1-3 times a month","Once or twice a week","Most days but not every day","Every day","Unknown"],"data":{"added":[],"deleted":["Not applicable"]}}}},"exercise_frequency":{"restrictions":{"codeList":{"left":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"],"right":["Never","Less than once a month","1-3 times a month","Once or twice a week","Most days but not every day","Every day","Unknown"],"data":{"added":[],"deleted":["Not applicable"]}}}},"exercise_intensity":{"restrictions":{"codeList":{"left":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"right":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Vigorous: Increase in the heart beat substantially with heavy perspiration"],"data":{"added":[],"deleted":["Not applicable","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($field != null || !(checkforEmpty($field))) {\r\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency)) && $row.exercise_frequency.trim().toLowerCase() === \"never\") {\r\n result = {valid: false, message: `The 'exercise_frequency' field cannot be 'never' if the '${$name}' field is submitted.`};\r\n }\r\n } \r\n return result;\r\n })"]}}}},"created":{},"deleted":{}},"family_history":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"family_relative_id":{"meta":{"primaryId":{"left":true,"right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"relationship_type":{"restrictions":{"codeList":{"left":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"],"right":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Sister","Son","Unknown"],"data":{"added":[],"deleted":["Maternal Uncle","Paternal Uncle","Uncle"]}}}},"age_of_relative_at_diagnosis":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n if ($row.relative_with_cancer_history != null) {\r\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\r\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\r\n };\r\n }\r\n }\r\n else {\r\n if (currField || currField != null) {\r\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"]}}},"cancer_type_code_of_relative":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n if ($row.relative_with_cancer_history != null) {\r\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\r\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\r\n };\r\n }\r\n }\r\n else {\r\n if (currField || currField != null) {\r\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"]}}},"cause_of_death_of_relative":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n if ($row.relative_vital_status && $row.relative_vital_status != null) {\r\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\r\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\r\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\r\n }\r\n }\r\n else {\r\n if ($field || $field != null) {\r\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\r\n }\r\n }\r\n return result;\r\n })"]}}},"relative_survival_time":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n if ($row.relative_with_cancer_history != null) {\r\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\r\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\r\n };\r\n }\r\n }\r\n else {\r\n if (currField || currField != null) {\r\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"]}}}},"created":{},"deleted":{}},"biomarker":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"deleted","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"deleted","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"deleted","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"deleted","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"deleted","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"deleted","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"deleted","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"deleted","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"deleted","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"deleted","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"deleted","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"deleted","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"deleted","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"deleted","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"deleted","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"deleted","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}}},"comorbidity":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"laterality_of_prior_malignancy":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n const invalidTypes = [\"no\", \"unknown\"]\r\n \r\n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\r\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\r\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"]}}},"age_at_comorbidity_diagnosis":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n const invalidTypes = [\"no\", \"unknown\"]\r\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\r\n \r\n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\r\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\r\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\r\n }\r\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\r\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\r\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\r\n }\r\n }\r\n }\r\n return result;\r\n })"]}}},"comorbidity_type_code":{"meta":{"notes":{"left":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n const invalidTypes = [\"no\", \"unknown\"]\r\n /* check if ICD-10 code is for neoplasms */\r\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\r\n\r\n \r\n if (neoplasmCode($row.comorbidity_type_code)) { \r\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\r\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\r\n }\r\n }\r\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\r\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\r\n }\r\n return result;\r\n })"]}}},"comorbidity_treatment_status":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n const invalidTypes = [\"no\", \"unknown\"]\r\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\r\n \r\n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\r\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\r\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\r\n }\r\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\r\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\r\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\r\n }\r\n }\r\n }\r\n return result;\r\n })"]}}},"comorbidity_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n const invalidTypes = [\"no\", \"unknown\"]\r\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\r\n \r\n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\r\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\r\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\r\n }\r\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\r\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\r\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\r\n }\r\n }\r\n }\r\n return result;\r\n })"]}}}},"created":{},"deleted":{}}}} diff --git a/scripts/data/schemas/diffs/1.24/1.24-diff-1.11.json b/scripts/data/schemas/diffs/1.24/1.24-diff-1.11.json new file mode 100644 index 00000000..3dd2c160 --- /dev/null +++ b/scripts/data/schemas/diffs/1.24/1.24-diff-1.11.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":[],"deleted":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \r\n const designation = $row.tumour_normal_designation.trim().toLowerCase();\r\n const specimen_type = $field.trim().toLowerCase();\r\n \r\n if (designation === \"normal\") {\r\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\r\n if (!validTypes.includes(specimen_type)) {\r\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\r\n }\r\n }\r\n else if (designation === \"tumour\") {\r\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\r\n if (invalidTypes.includes(specimen_type)) {\r\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\r\n }\r\n }\r\n }\r\n return result;\r\n })"]}}},"submitter_sample_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased"],"right":["Alive","Deceased","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"cause_of_death":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n \r\n if ($row.vital_status != null) {\r\n const vitalStatus = $row.vital_status.trim().toLowerCase();\r\n\r\n if (!currField && vitalStatus === \"deceased\") {\r\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\r\n }\r\n else if (currField && vitalStatus != \"deceased\"){\r\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\r\n }\r\n }\r\n else if (($row.vital_status === null) && (currField)) {\r\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\r\n }\r\n return result;\r\n })"]}}},"survival_time":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n \r\n if ($row.vital_status != null) {\r\n const vitalStatus = $row.vital_status.trim().toLowerCase();\r\n\r\n if (!currField && vitalStatus === \"deceased\") {\r\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\r\n }\r\n else if (currField && vitalStatus != \"deceased\"){\r\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\r\n }\r\n }\r\n else if (($row.vital_status === null) && (currField)) {\r\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\r\n }\r\n return result;\r\n })"]}}},"primary_site":{"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva"],"data":{"added":[],"deleted":["Unknown primary site"]}}}},"genetic_disorders":{"description":{"left":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","right":"Indicate presence of any hereditary genetic disorders. (Reference: Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)"},"restrictions":{"codeList":{"left":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"],"right":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Serrated Polyposis Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"],"data":{"added":[],"deleted":["None","Not applicable","Unknown"]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)","right":"Indicate the donor's age at which the first menstruation event occurred. (Reference: NCIt C19666)"}},"hrt_type":{"restrictions":{"codeList":{"left":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"],"right":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Other","Patch","Pill","Unknown"],"data":{"added":[],"deleted":["Not applicable"]}}}},"hrt_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n const type = $name.trim().toLowerCase().split('_duration')[0];\r\n const hormoneType = type + `_type`;\r\n \r\n if ($field != null && !(checkforEmpty($field))) {\r\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\r\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\r\n }\r\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\") {\r\n const submittedValue = $row[hormoneType].toLowerCase()\r\n result = {valid: false, message: `If '${$name}' is submitted, then '${hormoneType}' field cannot be '${submittedValue}'.`};\r\n }\r\n\r\n }\r\n return result;\r\n })"]}}},"contraception_type":{"restrictions":{"codeList":{"left":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"],"right":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Other","Progestin-only pill","Unknown","Vaginal ring"],"data":{"added":[],"deleted":["Not applicable","Oral contraceptive pill"]}}}},"contraception_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n const type = $name.trim().toLowerCase().split('_duration')[0];\r\n const hormoneType = type + `_type`;\r\n \r\n if ($field != null && !(checkforEmpty($field))) {\r\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\r\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\r\n }\r\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\") {\r\n const submittedValue = $row[hormoneType].toLowerCase()\r\n result = {valid: false, message: `If '${$name}' is submitted, then '${hormoneType}' field cannot be '${submittedValue}'.`};\r\n }\r\n\r\n }\r\n return result;\r\n })"]}}}},"created":{},"deleted":{"lost_to_followup_after_clinical_event_id":{"changeType":"deleted","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}}},"specimen":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"pathological_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\r\n\r\n \r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\r\n if (!($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n /* This is not a required field, so first ensure that it exists */\r\n else if ($field) {\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"pathological_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"pathological_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"pathological_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS"],"data":{"added":[],"deleted":["Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_stage_group')[0];\r\n\r\n const stagingSystem = stagingName + `_tumour_staging_system`;\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\r\n result.valid = false;\r\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\r\n result.message = msg;\r\n }\r\n else if (!($row[stagingSystem]) && $field) {\r\n result.valid = false;\r\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\r\n result.message = msg;\r\n }\r\n else if ($row[stagingSystem] && $field) {\r\n let codeList = [];\r\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage ii bulky',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ies',\r\n 'stage iae',\r\n 'stage ias',\r\n 'stage iaes',\r\n 'stage ib',\r\n 'stage ibe',\r\n 'stage ibs',\r\n 'stage ibes',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iies',\r\n 'stage iiae',\r\n 'stage iias',\r\n 'stage iiaes',\r\n 'stage iib',\r\n 'stage iibe',\r\n 'stage iibs',\r\n 'stage iibes',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iiies',\r\n 'stage iiiae',\r\n 'stage iiias',\r\n 'stage iiiaes',\r\n 'stage iiib',\r\n 'stage iiibe',\r\n 'stage iiibs',\r\n 'stage iiibes',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ive',\r\n 'stage ivs',\r\n 'stage ives',\r\n 'stage ivae',\r\n 'stage ivas',\r\n 'stage ivaes',\r\n 'stage ivb',\r\n 'stage ivbe',\r\n 'stage ivbs',\r\n 'stage ivbes'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\r\n $row[stagingSystem]\r\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n \r\n return result;\r\n })"]}}},"specimen_acquisition_interval":{"restrictions":{"range":{"left":null,"right":{"min":0}}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"data":{"added":[],"deleted":["Unknown"]}}}},"specimen_storage":{"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"data":{"added":[],"deleted":["Unknown"]}}}},"reference_pathology_confirmed":{"description":{"left":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)","right":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist."}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.tumour_grading_system && $field) {\r\n let codeList = [];\r\n const tieredGradingList = ['gx','g1','g2','g3'];\r\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\r\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\r\n case 'two-tier grading system':\r\n codeList = [\r\n 'low grade',\r\n 'high grade',\r\n ];\r\n break;\r\n case 'three-tier grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'four-tier grading system':\r\n codeList = [\r\n 'gx',\r\n 'g1',\r\n 'g2',\r\n 'g3',\r\n 'g4',\r\n ];\r\n break;\r\n case 'grading system for gists':\r\n codeList = [\r\n 'low',\r\n 'high',\r\n ];\r\n break;\r\n case 'grading system for gnets':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'isup grading system':\r\n codeList = [\r\n 'gx',\r\n 'g1',\r\n 'g2',\r\n 'g3',\r\n 'g4',\r\n ];\r\n break;\r\n case 'who grading system for cns tumours':\r\n codeList = [\r\n 'grade i',\r\n 'grade ii',\r\n 'grade iii',\r\n 'grade iv',\r\n ];\r\n break;\r\n case 'fnclcc grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'gleason grade group system':\r\n codeList = [\r\n 'grade group 1',\r\n 'grade group 2',\r\n 'grade group 3',\r\n 'grade group 4',\r\n 'grade group 5',\r\n ];\r\n break;\r\n case 'scarff-bloom-richardson grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'nuclear grading system for dcis':\r\n codeList = tieredGradingList;\r\n break;\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase())) {\r\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\r\n $row.tumour_grading_system\r\n }', 'tumour_grade' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\r\n result.valid = false;\r\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })"]}}},"percent_tumour_cells":{"restrictions":{"script":{"left":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"],"right":null}}},"percent_proliferating_cells":{"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}}},"percent_inflammatory_tissue":{"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}}},"percent_stromal_cells":{"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}}},"percent_necrosis":{"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}}}},"created":{},"deleted":{"specimen_laterality":{"changeType":"deleted","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"percent_tumour_cells_measurement_method":{"changeType":"deleted","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"number_lymph_nodes_examined":{"meta":{"notes":{"left":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n /* checks for a string just consisting of whitespacei */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\r\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\r\n \r\n if ($row.lymph_nodes_examined_status != null) {\r\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\r\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\r\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\r\n if (lymphNodesExaminedStatus === \"yes\") { \r\n if (parseInt($field) <= 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n else if (parseInt($field) > 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n \r\n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\r\n else if ($name === \"number_lymph_nodes_positive\") {\r\n if (lymphNodesExaminedStatus === \"yes\") {\r\n if (checkforEmpty($field) || $field == null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n else if (parseInt($field) < 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n else if ($field || $field != null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n }\r\n return result;\r\n})"]}}},"number_lymph_nodes_positive":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n /* checks for a string just consisting of whitespacei */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\r\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\r\n \r\n if ($row.lymph_nodes_examined_status != null) {\r\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\r\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\r\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\r\n if (lymphNodesExaminedStatus === \"yes\") { \r\n if (parseInt($field) <= 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n else if (parseInt($field) > 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n \r\n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\r\n else if ($name === \"number_lymph_nodes_positive\") {\r\n if (lymphNodesExaminedStatus === \"yes\") {\r\n if (checkforEmpty($field) || $field == null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n else if (parseInt($field) < 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n else if ($field || $field != null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n }\r\n return result;\r\n})"]}}},"clinical_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\r\n\r\n \r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\r\n if (!($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n /* This is not a required field, so first ensure that it exists */\r\n else if ($field) {\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"clinical_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"clinical_n_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null}}},"clinical_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"clinical_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS"],"data":{"added":[],"deleted":["Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_stage_group')[0];\r\n\r\n const stagingSystem = stagingName + `_tumour_staging_system`;\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\r\n result.valid = false;\r\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\r\n result.message = msg;\r\n }\r\n else if (!($row[stagingSystem]) && $field) {\r\n result.valid = false;\r\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\r\n result.message = msg;\r\n }\r\n else if ($row[stagingSystem] && $field) {\r\n let codeList = [];\r\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage ii bulky',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ies',\r\n 'stage iae',\r\n 'stage ias',\r\n 'stage iaes',\r\n 'stage ib',\r\n 'stage ibe',\r\n 'stage ibs',\r\n 'stage ibes',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iies',\r\n 'stage iiae',\r\n 'stage iias',\r\n 'stage iiaes',\r\n 'stage iib',\r\n 'stage iibe',\r\n 'stage iibs',\r\n 'stage iibes',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iiies',\r\n 'stage iiiae',\r\n 'stage iiias',\r\n 'stage iiiaes',\r\n 'stage iiib',\r\n 'stage iiibe',\r\n 'stage iiibs',\r\n 'stage iiibes',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ive',\r\n 'stage ivs',\r\n 'stage ives',\r\n 'stage ivae',\r\n 'stage ivas',\r\n 'stage ivaes',\r\n 'stage ivb',\r\n 'stage ivbe',\r\n 'stage ivbs',\r\n 'stage ivbes'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\r\n $row[stagingSystem]\r\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n \r\n return result;\r\n })"]}}},"performance_status":{"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"data":{"added":[],"deleted":["Unknown"]}}}}},"created":{},"deleted":{"laterality":{"changeType":"deleted","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_method":{"changeType":"deleted","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}}},"treatment":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":[],"deleted":["End of life care"]}}}},"is_primary_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]},"codeList":{"left":["Yes","No"],"right":["Yes","No","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"line_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\r\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\r\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\r\n if (isPrimaryTreatment === 'yes') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\r\n }\r\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\r\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\r\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\r\n }\r\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\r\n else if (isPrimaryTreatment === 'unknown') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'unknown'.`};\r\n }\r\n }\r\n return result;\r\n })"]}}},"treatment_start_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"treatment_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]}}},"days_per_cycle":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]}}},"number_of_cycles":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]}}},"treatment_intent":{"description":{"left":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","right":"Indicate the intended disease outcome for which the treatment is given. (Reference: NCIt C124307)"},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]},"codeList":{"left":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"],"right":["Curative","Palliative","Unknown"],"data":{"added":["Unknown"],"deleted":["Diagnostic","Forensic","Guidance","Preventative","Screening","Supportive"]}}}},"treatment_setting":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]},"codeList":{"left":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"],"right":["Adjuvant","Advanced/Metastatic","Neoadjuvant","Not applicable"],"data":{"added":["Not applicable"],"deleted":["Conditioning","Induction","Maintenance","Mobilization","Preventative","Radiosensitization","Salvage"]}}}},"response_to_treatment":{"description":{"left":"The donor's response to the applied treatment regimen.","right":"The donor's response to the applied treatment regimen. (Source: RECIST)"},"meta":{"dependsOn":{"left":"treatment.response_to_treatment_criteria_method","right":"treatment.treatment_type"},"notes":{"left":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]},"codeList":{"left":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"],"right":["Complete response","Disease progression","NED","Partial response","Stable disease"],"data":{"added":["Disease progression","NED"],"deleted":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease"]}}}},"outcome_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]}}},"toxicity_type":{"restrictions":{"codeList":{"left":["Hematological","Non-hematological","Not applicable","Unknown"],"right":["Hematological","Non-hematological"],"data":{"added":[],"deleted":["Not applicable","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($field != null && !(checkforEmpty($field))) {\r\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \r\n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\r\n \r\n /* toxicityType should only be submitted if treatment was terminated early due to acute toxicity ('outcome_of_treatment' is 'Treatment stopped due to acute toxicity'). */\r\n if (outcomeOfTreatment != \"treatment stopped due to acute toxicity\") {\r\n result = { valid: false, message: `The 'outcome_of_treatment' field should be 'Treatment stopped due to acute toxicity' if the '${$name}' field is submitted.`};\r\n }\r\n }\r\n else {\r\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\r\n }\r\n }\r\n return result;\r\n })"]}}},"hematological_toxicity":{"restrictions":{"codeList":{"left":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"right":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5"],"data":{"added":[],"deleted":["Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($field != null && !(checkforEmpty($field))) {\r\n if (($row.toxicity_type != null && !(checkforEmpty($row.toxicity_type)))) { \r\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\r\n \r\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\r\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\r\n }\r\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\r\n }\r\n }\r\n else {\r\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"]}}},"non-hematological_toxicity":{"restrictions":{"codeList":{"left":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"right":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"data":{"added":[],"deleted":["Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($field != null && !(checkforEmpty($field))) {\r\n if (($row.toxicity_type != null && !(checkforEmpty($row.toxicity_type)))) { \r\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\r\n \r\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\r\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\r\n }\r\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\r\n }\r\n }\r\n else {\r\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"]}}},"adverse_events":{"restrictions":{"codeList":{"left":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"right":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"data":{"added":[],"deleted":["None","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]}}},"clinical_trials_database":{"meta":{"notes":{"left":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added.","right":null}},"restrictions":{"codeList":{"left":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"],"right":["NCI Clinical Trials","EU Clinical Trials Register"],"data":{"added":[],"deleted":["Not applicable","Unknown"]}}}},"clinical_trial_number":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n //regex check for clinical trial number\r\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\r\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\r\n\r\n // list of valid clinical trial databases\r\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\r\n \r\n if ($row.clinical_trials_database && $field) {\r\n const trialNumber = $field.trim();\r\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\r\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\r\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\r\n }\r\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\r\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\r\n }\r\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\r\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database.`};\r\n }\r\n }\r\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\r\n result = {valid: true, message: \"Ok\"};\r\n }\r\n else if ($row.clinical_trials_database && !$field) {\r\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\r\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\r\n } \r\n }\r\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\r\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\r\n }\r\n return result;\r\n })"]}}}},"created":{},"deleted":{"response_to_treatment_criteria_method":{"changeType":"deleted","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}}}},"chemotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"dependsOn":{"left":"chemotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"dependsOn":{"left":"chemotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"chemotherapy_dosage_units":{"changeType":"created","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate the total actual drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true,"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"deleted","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"deleted","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"deleted","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"deleted","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"hormone_drug_dosage_units":{"changeType":"created","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true,"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"deleted","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"radiation":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"radiation_therapy_dosage":{"valueType":{"left":"number","right":"integer"}},"anatomical_site_irradiated":{"description":{"left":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)","right":"Indicate localization site where radiation therapy was administered."},"restrictions":{"codeList":{"left":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"right":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"data":{"added":["Bone","Extremities","Head-Neck","Peritoneum"],"deleted":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"]}}}}},"created":{},"deleted":{"radiation_boost":{"changeType":"deleted","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"deleted","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}}},"immunotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"dependsOn":{"left":"immunotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"dependsOn":{"left":"immunotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"},"displayName":{"left":"Chemotherapy Drug Name","right":"Immunotherapy Drug Name"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"deleted","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"surgery":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"deleted","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"deleted","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"deleted","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"deleted","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"deleted","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"deleted","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"deleted","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"deleted","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"deleted","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"deleted","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"deleted","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"deleted","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"deleted","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"deleted","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}}},"follow_up":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_follow_up_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"interval_of_followup":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"treatment.submitter_treatment_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"relapse_type":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n if ($row.disease_status_at_followup != null) {\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n }\r\n return result;\r\n })"]}}},"relapse_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n if ($row.disease_status_at_followup != null) {\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const intervalOfFollowup = parseInt($row.interval_of_followup);\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n relapseInterval = parseInt($field);\r\n if (relapseInterval > intervalOfFollowup) {\r\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\r\n }\r\n }\r\n }\r\n return result;\r\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"method_of_progression_status":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n if ($row.disease_status_at_followup != null) {\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n }\r\n return result;\r\n })"]}}},"anatomic_site_progression_or_recurrence":{"description":{"left":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","right":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344."},"meta":{"examples":{"left":"C50.1|C18","right":"C50.1,C18"},"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n if ($row.disease_status_at_followup != null) {\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n }\r\n return result;\r\n })"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\r\n\r\n \r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\r\n if (!($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n /* This is not a required field, so first ensure that it exists */\r\n else if ($field) {\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })","(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n if ($row.disease_status_at_followup != null) {\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n }\r\n return result;\r\n })"]}}},"recurrence_t_category":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"recurrence_n_category":{"meta":{"core":{"left":null,"right":true}}},"recurrence_m_category":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"recurrence_stage_group":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS"],"data":{"added":[],"deleted":["Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_stage_group')[0];\r\n\r\n const stagingSystem = stagingName + `_tumour_staging_system`;\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\r\n result.valid = false;\r\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\r\n result.message = msg;\r\n }\r\n else if (!($row[stagingSystem]) && $field) {\r\n result.valid = false;\r\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\r\n result.message = msg;\r\n }\r\n else if ($row[stagingSystem] && $field) {\r\n let codeList = [];\r\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage ii bulky',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ies',\r\n 'stage iae',\r\n 'stage ias',\r\n 'stage iaes',\r\n 'stage ib',\r\n 'stage ibe',\r\n 'stage ibs',\r\n 'stage ibes',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iies',\r\n 'stage iiae',\r\n 'stage iias',\r\n 'stage iiaes',\r\n 'stage iib',\r\n 'stage iibe',\r\n 'stage iibs',\r\n 'stage iibes',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iiies',\r\n 'stage iiiae',\r\n 'stage iiias',\r\n 'stage iiiaes',\r\n 'stage iiib',\r\n 'stage iiibe',\r\n 'stage iiibs',\r\n 'stage iiibes',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ive',\r\n 'stage ivs',\r\n 'stage ives',\r\n 'stage ivae',\r\n 'stage ivas',\r\n 'stage ivaes',\r\n 'stage ivb',\r\n 'stage ivbe',\r\n 'stage ivbs',\r\n 'stage ivbes'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\r\n $row[stagingSystem]\r\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n \r\n return result;\r\n })"]}}},"posttherapy_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\r\n\r\n \r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\r\n if (!($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n /* This is not a required field, so first ensure that it exists */\r\n else if ($field) {\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"posttherapy_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"posttherapy_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"posttherapy_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS"],"data":{"added":[],"deleted":["Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_stage_group')[0];\r\n\r\n const stagingSystem = stagingName + `_tumour_staging_system`;\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\r\n result.valid = false;\r\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\r\n result.message = msg;\r\n }\r\n else if (!($row[stagingSystem]) && $field) {\r\n result.valid = false;\r\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\r\n result.message = msg;\r\n }\r\n else if ($row[stagingSystem] && $field) {\r\n let codeList = [];\r\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage ii bulky',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ies',\r\n 'stage iae',\r\n 'stage ias',\r\n 'stage iaes',\r\n 'stage ib',\r\n 'stage ibe',\r\n 'stage ibs',\r\n 'stage ibes',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iies',\r\n 'stage iiae',\r\n 'stage iias',\r\n 'stage iiaes',\r\n 'stage iib',\r\n 'stage iibe',\r\n 'stage iibs',\r\n 'stage iibes',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iiies',\r\n 'stage iiiae',\r\n 'stage iiias',\r\n 'stage iiiaes',\r\n 'stage iiib',\r\n 'stage iiibe',\r\n 'stage iiibs',\r\n 'stage iiibes',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ive',\r\n 'stage ivs',\r\n 'stage ives',\r\n 'stage ivae',\r\n 'stage ivas',\r\n 'stage ivaes',\r\n 'stage ivb',\r\n 'stage ivbe',\r\n 'stage ivbs',\r\n 'stage ivbes'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\r\n $row[stagingSystem]\r\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n \r\n return result;\r\n })"]}}}},"created":{},"deleted":{}},"exposure":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"tobacco_smoking_status":{"restrictions":{"codeList":{"left":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"],"right":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Smoking history not documented"],"data":{"added":[],"deleted":["Not applicable"]}}}},"tobacco_type":{"restrictions":{"codeList":{"left":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"right":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Roll-ups","Snuff","Unknown","Waterpipe"],"data":{"added":[],"deleted":["Not applicable","Pipe"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n // check tobacco related fields\r\n if ($name === 'tobacco_type') {\r\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\r\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\r\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\r\n }\r\n else if ($row.tobacco_smoking_status.toLowerCase() === 'smoking history not documented') {\r\n result = { valid: false, message: `The 'tobacco_smoking_status' field (smoking status not documented) is inconsistent if donor smoked '${$row.tobacco_type}'.`};\r\n }\r\n else if ($row.tobacco_smoking_status.toLowerCase() === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if donor is a lifelong non-smoker.`}\r\n }\r\n }\r\n else {\r\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\r\n if (smokerCategories.includes($row.tobacco_smoking_status.toLowerCase())) {\r\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\r\n }\r\n }\r\n }\r\n }\r\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\r\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\r\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\r\n }\r\n }\r\n return result;\r\n })"]}}},"pack_years_smoked":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n // check tobacco related fields\r\n if ($name === 'tobacco_type') {\r\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\r\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\r\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\r\n }\r\n else if ($row.tobacco_smoking_status.toLowerCase() === 'smoking history not documented') {\r\n result = { valid: false, message: `The 'tobacco_smoking_status' field (smoking status not documented) is inconsistent if donor smoked '${$row.tobacco_type}'.`};\r\n }\r\n else if ($row.tobacco_smoking_status.toLowerCase() === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if donor is a lifelong non-smoker.`}\r\n }\r\n }\r\n else {\r\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\r\n if (smokerCategories.includes($row.tobacco_smoking_status.toLowerCase())) {\r\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\r\n }\r\n }\r\n }\r\n }\r\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\r\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\r\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\r\n }\r\n }\r\n return result;\r\n })"]}}},"alcohol_history":{"restrictions":{"codeList":{"left":["Yes","No","Not applicable","Unknown"],"right":["Yes","No","Unknown"],"data":{"added":[],"deleted":["Not applicable"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\r\n noOrUnknownAllowedCategories = [\"none\", \"occasional drinker (< once a month)\", \"unknown\"];\r\n \r\n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\r\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\r\n if ((!$field || $field == null || checkforEmpty($field)) && alcoholHistoryCategories.includes(alcoholConsumptionCategory)) {\r\n result = {valid:false, message: `If the donor is a '${alcoholConsumptionCategory}', then the 'alcohol_history' field must be submitted as well.`};\r\n }\r\n if ((!$field || $field === null || checkforEmpty($field) || $field.trim().toLowerCase() === 'no') && (!(noOrUnknownAllowedCategories.includes(alcoholConsumptionCategory)))) {\r\n result = {valid:false, message: `If the donor is a '${alcoholConsumptionCategory}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\r\n }\r\n }\r\n return result;\r\n })"]}}},"alcohol_consumption_category":{"restrictions":{"codeList":{"left":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"right":["Daily Drinker","None","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"data":{"added":[],"deleted":["Not applicable"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\r\n \r\n if (!$field || $field === null || checkforEmpty($field)) {\r\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\r\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\r\n }\r\n }\r\n else {\r\n alcoholConsumptionCategory = $field.trim().toLowerCase();\r\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\r\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\r\n }\r\n }\r\n return result;\r\n })"]}}},"alcohol_type":{"restrictions":{"codeList":{"left":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"right":["Beer","Liquor","Other","Unknown","Wine"],"data":{"added":[],"deleted":["Not applicable"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n exclusionTerms = [\"no\", \"none\", \"unknown\"]; \r\n requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\r\n \r\n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\r\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\r\n if ($field && $field != null && !(checkforEmpty($field))) {\r\n if (exclusionTerms.includes(alcoholConsumptionCategory)) {\r\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field should not be submitted.`};\r\n }\r\n }\r\n else {\r\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\r\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\r\n }\r\n }\r\n }\r\n if ($field && $field != null && !(checkforEmpty($field)) && (!$row.alcohol_consumption_category || $row.alcohol_consumption_category === null || checkforEmpty($row.alcohol_consumption_category))) {\r\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\r\n }\r\n return result;\r\n })"]}}},"opiate_use":{"restrictions":{"codeList":{"left":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"],"right":["Never","Unknown","Yes, currently","Yes, only in the past"],"data":{"added":[],"deleted":["Not applicable"]}}}},"hot_drinks_consumption":{"restrictions":{"codeList":{"left":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"],"right":["Never","Unknown","Yes, currently","Yes, only in the past"],"data":{"added":[],"deleted":["Not applicable"]}}}},"red_meat_frequency":{"restrictions":{"codeList":{"left":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"],"right":["Never","Less than once a month","1-3 times a month","Once or twice a week","Most days but not every day","Every day","Unknown"],"data":{"added":[],"deleted":["Not applicable"]}}}},"processed_meat_frequency":{"restrictions":{"codeList":{"left":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"],"right":["Never","Less than once a month","1-3 times a month","Once or twice a week","Most days but not every day","Every day","Unknown"],"data":{"added":[],"deleted":["Not applicable"]}}}},"soft_drinks_frequency":{"restrictions":{"codeList":{"left":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"],"right":["Never","Less than once a month","1-3 times a month","Once or twice a week","Most days but not every day","Every day","Unknown"],"data":{"added":[],"deleted":["Not applicable"]}}}},"exercise_frequency":{"restrictions":{"codeList":{"left":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"],"right":["Never","Less than once a month","1-3 times a month","Once or twice a week","Most days but not every day","Every day","Unknown"],"data":{"added":[],"deleted":["Not applicable"]}}}},"exercise_intensity":{"restrictions":{"codeList":{"left":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"right":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Vigorous: Increase in the heart beat substantially with heavy perspiration"],"data":{"added":[],"deleted":["Not applicable","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($field != null || !(checkforEmpty($field))) {\r\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency)) && $row.exercise_frequency.trim().toLowerCase() === \"never\") {\r\n result = {valid: false, message: `The 'exercise_frequency' field cannot be 'never' if the '${$name}' field is submitted.`};\r\n }\r\n } \r\n return result;\r\n })"]}}}},"created":{},"deleted":{}},"family_history":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"family_relative_id":{"meta":{"primaryId":{"left":true,"right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"age_of_relative_at_diagnosis":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n if ($row.relative_with_cancer_history != null) {\r\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\r\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\r\n };\r\n }\r\n }\r\n else {\r\n if (currField || currField != null) {\r\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"]}}},"cancer_type_code_of_relative":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n if ($row.relative_with_cancer_history != null) {\r\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\r\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\r\n };\r\n }\r\n }\r\n else {\r\n if (currField || currField != null) {\r\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"]}}},"cause_of_death_of_relative":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n if ($row.relative_vital_status && $row.relative_vital_status != null) {\r\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\r\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\r\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\r\n }\r\n }\r\n else {\r\n if ($field || $field != null) {\r\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\r\n }\r\n }\r\n return result;\r\n })"]}}},"relative_survival_time":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n if ($row.relative_with_cancer_history != null) {\r\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\r\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\r\n };\r\n }\r\n }\r\n else {\r\n if (currField || currField != null) {\r\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"]}}}},"created":{},"deleted":{}},"biomarker":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"meta":{"notes":{"left":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required.","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n let missing = true;\r\n\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\r\n \r\n if (!$field || checkforEmpty($field) || $field === null) { \r\n for (let idField of identifierFields) {\r\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\r\n continue;\r\n }\r\n else {\r\n missing = false;\r\n }\r\n }\r\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\r\n result = {\r\n valid: false,\r\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\r\n }\r\n }\r\n else if ($field && !(checkforEmpty($field)) && $field != null) {\r\n for (let idField of identifierFields) {\r\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\r\n result = {\r\n valid: false,\r\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\r\n break;\r\n }\r\n }\r\n }\r\n return result;\r\n })"]}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null},"notes":{"left":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required.","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n let missing = true;\r\n\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\r\n \r\n if (!$field || checkforEmpty($field) || $field === null) { \r\n for (let idField of identifierFields) {\r\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\r\n continue;\r\n }\r\n else {\r\n missing = false;\r\n }\r\n }\r\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\r\n result = {\r\n valid: false,\r\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\r\n }\r\n }\r\n else if ($field && !(checkforEmpty($field)) && $field != null) {\r\n for (let idField of identifierFields) {\r\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\r\n result = {\r\n valid: false,\r\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\r\n break;\r\n }\r\n }\r\n }\r\n return result;\r\n })"]}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"treatment.submitter_treatment_id","right":null},"notes":{"left":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required.","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n let missing = true;\r\n\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\r\n \r\n if (!$field || checkforEmpty($field) || $field === null) { \r\n for (let idField of identifierFields) {\r\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\r\n continue;\r\n }\r\n else {\r\n missing = false;\r\n }\r\n }\r\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\r\n result = {\r\n valid: false,\r\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\r\n }\r\n }\r\n else if ($field && !(checkforEmpty($field)) && $field != null) {\r\n for (let idField of identifierFields) {\r\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\r\n result = {\r\n valid: false,\r\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\r\n break;\r\n }\r\n }\r\n }\r\n return result;\r\n })"]}}},"submitter_follow_up_id":{"meta":{"foreignKey":{"left":"follow_up.submitter_follow_up_id","right":null},"notes":{"left":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required.","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n let missing = true;\r\n\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\r\n \r\n if (!$field || checkforEmpty($field) || $field === null) { \r\n for (let idField of identifierFields) {\r\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\r\n continue;\r\n }\r\n else {\r\n missing = false;\r\n }\r\n }\r\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\r\n result = {\r\n valid: false,\r\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\r\n }\r\n }\r\n else if ($field && !(checkforEmpty($field)) && $field != null) {\r\n for (let idField of identifierFields) {\r\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\r\n result = {\r\n valid: false,\r\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\r\n break;\r\n }\r\n }\r\n }\r\n return result;\r\n })"]}}},"test_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n let missing = true;\r\n\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\r\n \r\n if (!$field || checkforEmpty($field) || $field === null) { \r\n for (let idField of identifierFields) {\r\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\r\n continue;\r\n }\r\n else {\r\n missing = false;\r\n }\r\n }\r\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\r\n result = {\r\n valid: false,\r\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\r\n }\r\n }\r\n else if ($field && !(checkforEmpty($field)) && $field != null) {\r\n for (let idField of identifierFields) {\r\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\r\n result = {\r\n valid: false,\r\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\r\n break;\r\n }\r\n }\r\n }\r\n return result;\r\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}}},"created":{"ldl_level":{"changeType":"created","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldl_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}}},"deleted":{"ldh_level":{"changeType":"deleted","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}}}},"comorbidity":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"laterality_of_prior_malignancy":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n const invalidTypes = [\"no\", \"unknown\"]\r\n \r\n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\r\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\r\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"]}}},"age_at_comorbidity_diagnosis":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n const invalidTypes = [\"no\", \"unknown\"]\r\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\r\n \r\n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\r\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\r\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\r\n }\r\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\r\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\r\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\r\n }\r\n }\r\n }\r\n return result;\r\n })"]}}},"comorbidity_type_code":{"meta":{"notes":{"left":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n const invalidTypes = [\"no\", \"unknown\"]\r\n /* check if ICD-10 code is for neoplasms */\r\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\r\n\r\n \r\n if (neoplasmCode($row.comorbidity_type_code)) { \r\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\r\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\r\n }\r\n }\r\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\r\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\r\n }\r\n return result;\r\n })"]}}},"comorbidity_treatment_status":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n const invalidTypes = [\"no\", \"unknown\"]\r\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\r\n \r\n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\r\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\r\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\r\n }\r\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\r\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\r\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\r\n }\r\n }\r\n }\r\n return result;\r\n })"]}}},"comorbidity_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n const invalidTypes = [\"no\", \"unknown\"]\r\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\r\n \r\n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\r\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\r\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\r\n }\r\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\r\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\r\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\r\n }\r\n }\r\n }\r\n return result;\r\n })"]}}}},"created":{},"deleted":{}}}} diff --git a/scripts/data/schemas/diffs/1.24/1.24-diff-1.12.json b/scripts/data/schemas/diffs/1.24/1.24-diff-1.12.json new file mode 100644 index 00000000..fee38c51 --- /dev/null +++ b/scripts/data/schemas/diffs/1.24/1.24-diff-1.12.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":[],"deleted":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \r\n const designation = $row.tumour_normal_designation.trim().toLowerCase();\r\n const specimen_type = $field.trim().toLowerCase();\r\n \r\n if (designation === \"normal\") {\r\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\r\n if (!validTypes.includes(specimen_type)) {\r\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\r\n }\r\n }\r\n else if (designation === \"tumour\") {\r\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\r\n if (invalidTypes.includes(specimen_type)) {\r\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\r\n }\r\n }\r\n }\r\n return result;\r\n })"]}}},"submitter_sample_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased"],"right":["Alive","Deceased","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"cause_of_death":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n \r\n if ($row.vital_status != null) {\r\n const vitalStatus = $row.vital_status.trim().toLowerCase();\r\n\r\n if (!currField && vitalStatus === \"deceased\") {\r\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\r\n }\r\n else if (currField && vitalStatus != \"deceased\"){\r\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\r\n }\r\n }\r\n else if (($row.vital_status === null) && (currField)) {\r\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\r\n }\r\n return result;\r\n })"]}}},"survival_time":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n \r\n if ($row.vital_status != null) {\r\n const vitalStatus = $row.vital_status.trim().toLowerCase();\r\n\r\n if (!currField && vitalStatus === \"deceased\") {\r\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\r\n }\r\n else if (currField && vitalStatus != \"deceased\"){\r\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\r\n }\r\n }\r\n else if (($row.vital_status === null) && (currField)) {\r\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\r\n }\r\n return result;\r\n })"]}}},"primary_site":{"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva"],"data":{"added":[],"deleted":["Unknown primary site"]}}}},"genetic_disorders":{"description":{"left":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","right":"Indicate presence of any hereditary genetic disorders. (Reference: Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)"},"restrictions":{"codeList":{"left":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"],"right":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Serrated Polyposis Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"],"data":{"added":[],"deleted":["None","Not applicable","Unknown"]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)","right":"Indicate the donor's age at which the first menstruation event occurred. (Reference: NCIt C19666)"}},"hrt_type":{"restrictions":{"codeList":{"left":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"],"right":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Other","Patch","Pill","Unknown"],"data":{"added":[],"deleted":["Not applicable"]}}}},"hrt_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n const type = $name.trim().toLowerCase().split('_duration')[0];\r\n const hormoneType = type + `_type`;\r\n \r\n if ($field != null && !(checkforEmpty($field))) {\r\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\r\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\r\n }\r\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\") {\r\n const submittedValue = $row[hormoneType].toLowerCase()\r\n result = {valid: false, message: `If '${$name}' is submitted, then '${hormoneType}' field cannot be '${submittedValue}'.`};\r\n }\r\n\r\n }\r\n return result;\r\n })"]}}},"contraception_type":{"restrictions":{"codeList":{"left":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"],"right":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Other","Progestin-only pill","Unknown","Vaginal ring"],"data":{"added":[],"deleted":["Not applicable","Oral contraceptive pill"]}}}},"contraception_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n const type = $name.trim().toLowerCase().split('_duration')[0];\r\n const hormoneType = type + `_type`;\r\n \r\n if ($field != null && !(checkforEmpty($field))) {\r\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\r\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\r\n }\r\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\") {\r\n const submittedValue = $row[hormoneType].toLowerCase()\r\n result = {valid: false, message: `If '${$name}' is submitted, then '${hormoneType}' field cannot be '${submittedValue}'.`};\r\n }\r\n\r\n }\r\n return result;\r\n })"]}}}},"created":{},"deleted":{"lost_to_followup_after_clinical_event_id":{"changeType":"deleted","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}}},"specimen":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"pathological_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\r\n\r\n \r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\r\n if (!($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n /* This is not a required field, so first ensure that it exists */\r\n else if ($field) {\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"pathological_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"pathological_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"pathological_stage_group":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_stage_group')[0];\r\n\r\n const stagingSystem = stagingName + `_tumour_staging_system`;\r\n const tCategory = `${stagingName}_t_category`;\r\n const nCategory = `${stagingName}_n_category`;\r\n const mCategory = `${stagingName}_m_category`;\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\r\n result.valid = false;\r\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\r\n result.message = msg;\r\n }\r\n else if (!($row[stagingSystem]) && $field) {\r\n result.valid = false;\r\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\r\n result.message = msg;\r\n }\r\n else if ($row[stagingSystem] && $field) {\r\n let codeList = [];\r\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage ii bulky',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ies',\r\n 'stage iae',\r\n 'stage ias',\r\n 'stage iaes',\r\n 'stage ib',\r\n 'stage ibe',\r\n 'stage ibs',\r\n 'stage ibes',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iies',\r\n 'stage iiae',\r\n 'stage iias',\r\n 'stage iiaes',\r\n 'stage iib',\r\n 'stage iibe',\r\n 'stage iibs',\r\n 'stage iibes',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iiies',\r\n 'stage iiiae',\r\n 'stage iiias',\r\n 'stage iiiaes',\r\n 'stage iiib',\r\n 'stage iiibe',\r\n 'stage iiibs',\r\n 'stage iiibes',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ive',\r\n 'stage ivs',\r\n 'stage ives',\r\n 'stage ivae',\r\n 'stage ivas',\r\n 'stage ivaes',\r\n 'stage ivb',\r\n 'stage ivbe',\r\n 'stage ivbs',\r\n 'stage ivbes'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\r\n $row[stagingSystem]\r\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\r\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\r\n result = {\r\n valid: false,\r\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\r\n };\r\n }\r\n }\r\n }\r\n return result;\r\n })"]}}},"specimen_acquisition_interval":{"restrictions":{"range":{"left":null,"right":{"min":0}}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"data":{"added":[],"deleted":["Unknown"]}}}},"specimen_storage":{"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"data":{"added":[],"deleted":["Unknown"]}}}},"reference_pathology_confirmed":{"description":{"left":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)","right":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist."}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.tumour_grading_system && $field) {\r\n let codeList = [];\r\n const tieredGradingList = ['gx','g1','g2','g3'];\r\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\r\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\r\n case 'two-tier grading system':\r\n codeList = [\r\n 'low grade',\r\n 'high grade',\r\n ];\r\n break;\r\n case 'three-tier grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'four-tier grading system':\r\n codeList = [\r\n 'gx',\r\n 'g1',\r\n 'g2',\r\n 'g3',\r\n 'g4',\r\n ];\r\n break;\r\n case 'grading system for gists':\r\n codeList = [\r\n 'low',\r\n 'high',\r\n ];\r\n break;\r\n case 'grading system for gnets':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'isup grading system':\r\n codeList = [\r\n 'gx',\r\n 'g1',\r\n 'g2',\r\n 'g3',\r\n 'g4',\r\n ];\r\n break;\r\n case 'who grading system for cns tumours':\r\n codeList = [\r\n 'grade i',\r\n 'grade ii',\r\n 'grade iii',\r\n 'grade iv',\r\n ];\r\n break;\r\n case 'fnclcc grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'gleason grade group system':\r\n codeList = [\r\n 'grade group 1',\r\n 'grade group 2',\r\n 'grade group 3',\r\n 'grade group 4',\r\n 'grade group 5',\r\n ];\r\n break;\r\n case 'scarff-bloom-richardson grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'nuclear grading system for dcis':\r\n codeList = tieredGradingList;\r\n break;\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase())) {\r\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\r\n $row.tumour_grading_system\r\n }', 'tumour_grade' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\r\n result.valid = false;\r\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })"]}}},"percent_tumour_cells":{"restrictions":{"script":{"left":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"],"right":null}}},"percent_proliferating_cells":{"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}}},"percent_inflammatory_tissue":{"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}}},"percent_stromal_cells":{"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}}},"percent_necrosis":{"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}}}},"created":{},"deleted":{"specimen_laterality":{"changeType":"deleted","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"percent_tumour_cells_measurement_method":{"changeType":"deleted","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"number_lymph_nodes_examined":{"meta":{"notes":{"left":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n /* checks for a string just consisting of whitespacei */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\r\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\r\n \r\n if ($row.lymph_nodes_examined_status != null) {\r\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\r\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\r\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\r\n if (lymphNodesExaminedStatus === \"yes\") { \r\n if (parseInt($field) <= 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n else if (parseInt($field) > 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n \r\n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\r\n else if ($name === \"number_lymph_nodes_positive\") {\r\n if (lymphNodesExaminedStatus === \"yes\") {\r\n if (checkforEmpty($field) || $field == null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n else if (parseInt($field) < 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n else if ($field || $field != null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n }\r\n return result;\r\n})"]}}},"number_lymph_nodes_positive":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n /* checks for a string just consisting of whitespacei */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\r\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\r\n \r\n if ($row.lymph_nodes_examined_status != null) {\r\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\r\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\r\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\r\n if (lymphNodesExaminedStatus === \"yes\") { \r\n if (parseInt($field) <= 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n else if (parseInt($field) > 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n \r\n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\r\n else if ($name === \"number_lymph_nodes_positive\") {\r\n if (lymphNodesExaminedStatus === \"yes\") {\r\n if (checkforEmpty($field) || $field == null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n else if (parseInt($field) < 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n else if ($field || $field != null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n }\r\n return result;\r\n})"]}}},"clinical_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\r\n\r\n \r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\r\n if (!($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n /* This is not a required field, so first ensure that it exists */\r\n else if ($field) {\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"clinical_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"clinical_n_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null}}},"clinical_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"clinical_stage_group":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_stage_group')[0];\r\n\r\n const stagingSystem = stagingName + `_tumour_staging_system`;\r\n const tCategory = `${stagingName}_t_category`;\r\n const nCategory = `${stagingName}_n_category`;\r\n const mCategory = `${stagingName}_m_category`;\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\r\n result.valid = false;\r\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\r\n result.message = msg;\r\n }\r\n else if (!($row[stagingSystem]) && $field) {\r\n result.valid = false;\r\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\r\n result.message = msg;\r\n }\r\n else if ($row[stagingSystem] && $field) {\r\n let codeList = [];\r\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage ii bulky',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ies',\r\n 'stage iae',\r\n 'stage ias',\r\n 'stage iaes',\r\n 'stage ib',\r\n 'stage ibe',\r\n 'stage ibs',\r\n 'stage ibes',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iies',\r\n 'stage iiae',\r\n 'stage iias',\r\n 'stage iiaes',\r\n 'stage iib',\r\n 'stage iibe',\r\n 'stage iibs',\r\n 'stage iibes',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iiies',\r\n 'stage iiiae',\r\n 'stage iiias',\r\n 'stage iiiaes',\r\n 'stage iiib',\r\n 'stage iiibe',\r\n 'stage iiibs',\r\n 'stage iiibes',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ive',\r\n 'stage ivs',\r\n 'stage ives',\r\n 'stage ivae',\r\n 'stage ivas',\r\n 'stage ivaes',\r\n 'stage ivb',\r\n 'stage ivbe',\r\n 'stage ivbs',\r\n 'stage ivbes'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\r\n $row[stagingSystem]\r\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\r\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\r\n result = {\r\n valid: false,\r\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\r\n };\r\n }\r\n }\r\n }\r\n return result;\r\n })"]}}},"performance_status":{"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"data":{"added":[],"deleted":["Unknown"]}}}}},"created":{},"deleted":{"laterality":{"changeType":"deleted","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_method":{"changeType":"deleted","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}}},"treatment":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":[],"deleted":["End of life care"]}}}},"is_primary_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]},"codeList":{"left":["Yes","No"],"right":["Yes","No","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"line_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\r\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\r\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\r\n if (isPrimaryTreatment === 'yes') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\r\n }\r\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\r\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\r\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\r\n }\r\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\r\n else if (isPrimaryTreatment === 'unknown') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'unknown'.`};\r\n }\r\n }\r\n return result;\r\n })"]}}},"treatment_start_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"treatment_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]}}},"days_per_cycle":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]}}},"number_of_cycles":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]}}},"treatment_intent":{"description":{"left":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","right":"Indicate the intended disease outcome for which the treatment is given. (Reference: NCIt C124307)"},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]},"codeList":{"left":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"],"right":["Curative","Palliative","Unknown"],"data":{"added":["Unknown"],"deleted":["Diagnostic","Forensic","Guidance","Preventative","Screening","Supportive"]}}}},"treatment_setting":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]},"codeList":{"left":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"],"right":["Adjuvant","Advanced/Metastatic","Neoadjuvant","Not applicable"],"data":{"added":["Not applicable"],"deleted":["Conditioning","Induction","Maintenance","Mobilization","Preventative","Radiosensitization","Salvage"]}}}},"response_to_treatment":{"description":{"left":"The donor's response to the applied treatment regimen.","right":"The donor's response to the applied treatment regimen. (Source: RECIST)"},"meta":{"dependsOn":{"left":"treatment.response_to_treatment_criteria_method","right":"treatment.treatment_type"},"notes":{"left":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]},"codeList":{"left":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"],"right":["Complete response","Disease progression","NED","Partial response","Stable disease"],"data":{"added":["Disease progression","NED"],"deleted":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease"]}}}},"outcome_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]}}},"toxicity_type":{"restrictions":{"codeList":{"left":["Hematological","Non-hematological","Not applicable","Unknown"],"right":["Hematological","Non-hematological"],"data":{"added":[],"deleted":["Not applicable","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($field != null && !(checkforEmpty($field))) {\r\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \r\n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\r\n \r\n /* toxicityType should only be submitted if treatment was terminated early due to acute toxicity ('outcome_of_treatment' is 'Treatment stopped due to acute toxicity'). */\r\n if (outcomeOfTreatment != \"treatment stopped due to acute toxicity\") {\r\n result = { valid: false, message: `The 'outcome_of_treatment' field should be 'Treatment stopped due to acute toxicity' if the '${$name}' field is submitted.`};\r\n }\r\n }\r\n else {\r\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\r\n }\r\n }\r\n return result;\r\n })"]}}},"hematological_toxicity":{"restrictions":{"codeList":{"left":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"right":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5"],"data":{"added":[],"deleted":["Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($field != null && !(checkforEmpty($field))) {\r\n if (($row.toxicity_type != null && !(checkforEmpty($row.toxicity_type)))) { \r\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\r\n \r\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\r\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\r\n }\r\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\r\n }\r\n }\r\n else {\r\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"]}}},"non-hematological_toxicity":{"restrictions":{"codeList":{"left":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"right":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"data":{"added":[],"deleted":["Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($field != null && !(checkforEmpty($field))) {\r\n if (($row.toxicity_type != null && !(checkforEmpty($row.toxicity_type)))) { \r\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\r\n \r\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\r\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\r\n }\r\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\r\n }\r\n }\r\n else {\r\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"]}}},"adverse_events":{"restrictions":{"codeList":{"left":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"right":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"data":{"added":[],"deleted":["None","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]}}},"clinical_trials_database":{"meta":{"notes":{"left":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added.","right":null}},"restrictions":{"codeList":{"left":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"],"right":["NCI Clinical Trials","EU Clinical Trials Register"],"data":{"added":[],"deleted":["Not applicable","Unknown"]}}}},"clinical_trial_number":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n //regex check for clinical trial number\r\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\r\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\r\n\r\n // list of valid clinical trial databases\r\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\r\n \r\n if ($row.clinical_trials_database && $field) {\r\n const trialNumber = $field.trim();\r\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\r\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\r\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\r\n }\r\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\r\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\r\n }\r\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\r\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database.`};\r\n }\r\n }\r\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\r\n result = {valid: true, message: \"Ok\"};\r\n }\r\n else if ($row.clinical_trials_database && !$field) {\r\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\r\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\r\n } \r\n }\r\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\r\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\r\n }\r\n return result;\r\n })"]}}}},"created":{},"deleted":{"response_to_treatment_criteria_method":{"changeType":"deleted","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}}}},"chemotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"dependsOn":{"left":"chemotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"dependsOn":{"left":"chemotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"chemotherapy_dosage_units":{"changeType":"created","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate the total actual drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true,"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"deleted","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"deleted","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"deleted","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"deleted","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"hormone_drug_dosage_units":{"changeType":"created","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true,"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"deleted","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"radiation":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"radiation_therapy_dosage":{"valueType":{"left":"number","right":"integer"}},"anatomical_site_irradiated":{"description":{"left":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)","right":"Indicate localization site where radiation therapy was administered."},"restrictions":{"codeList":{"left":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"right":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"data":{"added":["Bone","Extremities","Head-Neck","Peritoneum"],"deleted":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"]}}}}},"created":{},"deleted":{"radiation_boost":{"changeType":"deleted","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"deleted","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}}},"immunotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"dependsOn":{"left":"immunotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"dependsOn":{"left":"immunotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"},"displayName":{"left":"Chemotherapy Drug Name","right":"Immunotherapy Drug Name"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"deleted","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"surgery":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"deleted","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"deleted","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"deleted","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"deleted","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"deleted","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"deleted","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"deleted","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"deleted","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"deleted","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"deleted","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"deleted","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"deleted","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"deleted","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"deleted","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}}},"follow_up":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_follow_up_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"interval_of_followup":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"treatment.submitter_treatment_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"relapse_type":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n if ($row.disease_status_at_followup != null) {\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n }\r\n return result;\r\n })"]}}},"relapse_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n if ($row.disease_status_at_followup != null) {\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const intervalOfFollowup = parseInt($row.interval_of_followup);\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n relapseInterval = parseInt($field);\r\n if (relapseInterval > intervalOfFollowup) {\r\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\r\n }\r\n }\r\n }\r\n return result;\r\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"method_of_progression_status":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n if ($row.disease_status_at_followup != null) {\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n }\r\n return result;\r\n })"]}}},"anatomic_site_progression_or_recurrence":{"description":{"left":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","right":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344."},"meta":{"examples":{"left":"C50.1|C18","right":"C50.1,C18"},"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n if ($row.disease_status_at_followup != null) {\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n }\r\n return result;\r\n })"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\r\n\r\n \r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\r\n if (!($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n /* This is not a required field, so first ensure that it exists */\r\n else if ($field) {\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })","(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n if ($row.disease_status_at_followup != null) {\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n }\r\n return result;\r\n })"]}}},"recurrence_t_category":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"recurrence_n_category":{"meta":{"core":{"left":null,"right":true}}},"recurrence_m_category":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"recurrence_stage_group":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_stage_group')[0];\r\n\r\n const stagingSystem = stagingName + `_tumour_staging_system`;\r\n const tCategory = `${stagingName}_t_category`;\r\n const nCategory = `${stagingName}_n_category`;\r\n const mCategory = `${stagingName}_m_category`;\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\r\n result.valid = false;\r\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\r\n result.message = msg;\r\n }\r\n else if (!($row[stagingSystem]) && $field) {\r\n result.valid = false;\r\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\r\n result.message = msg;\r\n }\r\n else if ($row[stagingSystem] && $field) {\r\n let codeList = [];\r\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage ii bulky',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ies',\r\n 'stage iae',\r\n 'stage ias',\r\n 'stage iaes',\r\n 'stage ib',\r\n 'stage ibe',\r\n 'stage ibs',\r\n 'stage ibes',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iies',\r\n 'stage iiae',\r\n 'stage iias',\r\n 'stage iiaes',\r\n 'stage iib',\r\n 'stage iibe',\r\n 'stage iibs',\r\n 'stage iibes',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iiies',\r\n 'stage iiiae',\r\n 'stage iiias',\r\n 'stage iiiaes',\r\n 'stage iiib',\r\n 'stage iiibe',\r\n 'stage iiibs',\r\n 'stage iiibes',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ive',\r\n 'stage ivs',\r\n 'stage ives',\r\n 'stage ivae',\r\n 'stage ivas',\r\n 'stage ivaes',\r\n 'stage ivb',\r\n 'stage ivbe',\r\n 'stage ivbs',\r\n 'stage ivbes'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\r\n $row[stagingSystem]\r\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\r\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\r\n result = {\r\n valid: false,\r\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\r\n };\r\n }\r\n }\r\n }\r\n return result;\r\n })"]}}},"posttherapy_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\r\n\r\n \r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\r\n if (!($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n /* This is not a required field, so first ensure that it exists */\r\n else if ($field) {\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"posttherapy_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"posttherapy_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"posttherapy_stage_group":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_stage_group')[0];\r\n\r\n const stagingSystem = stagingName + `_tumour_staging_system`;\r\n const tCategory = `${stagingName}_t_category`;\r\n const nCategory = `${stagingName}_n_category`;\r\n const mCategory = `${stagingName}_m_category`;\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\r\n result.valid = false;\r\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\r\n result.message = msg;\r\n }\r\n else if (!($row[stagingSystem]) && $field) {\r\n result.valid = false;\r\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\r\n result.message = msg;\r\n }\r\n else if ($row[stagingSystem] && $field) {\r\n let codeList = [];\r\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage ii bulky',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ies',\r\n 'stage iae',\r\n 'stage ias',\r\n 'stage iaes',\r\n 'stage ib',\r\n 'stage ibe',\r\n 'stage ibs',\r\n 'stage ibes',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iies',\r\n 'stage iiae',\r\n 'stage iias',\r\n 'stage iiaes',\r\n 'stage iib',\r\n 'stage iibe',\r\n 'stage iibs',\r\n 'stage iibes',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iiies',\r\n 'stage iiiae',\r\n 'stage iiias',\r\n 'stage iiiaes',\r\n 'stage iiib',\r\n 'stage iiibe',\r\n 'stage iiibs',\r\n 'stage iiibes',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ive',\r\n 'stage ivs',\r\n 'stage ives',\r\n 'stage ivae',\r\n 'stage ivas',\r\n 'stage ivaes',\r\n 'stage ivb',\r\n 'stage ivbe',\r\n 'stage ivbs',\r\n 'stage ivbes'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\r\n $row[stagingSystem]\r\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\r\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\r\n result = {\r\n valid: false,\r\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\r\n };\r\n }\r\n }\r\n }\r\n return result;\r\n })"]}}}},"created":{},"deleted":{}},"exposure":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"tobacco_smoking_status":{"restrictions":{"codeList":{"left":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"],"right":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Smoking history not documented"],"data":{"added":[],"deleted":["Not applicable"]}}}},"tobacco_type":{"restrictions":{"codeList":{"left":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"right":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"data":{"added":[],"deleted":["Not applicable"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n // check tobacco related fields\r\n if ($name === 'tobacco_type') {\r\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\r\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\r\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\r\n }\r\n else if ($row.tobacco_smoking_status.toLowerCase() === 'smoking history not documented') {\r\n result = { valid: false, message: `The 'tobacco_smoking_status' field (smoking status not documented) is inconsistent if donor smoked '${$row.tobacco_type}'.`};\r\n }\r\n else if ($row.tobacco_smoking_status.toLowerCase() === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if donor is a lifelong non-smoker.`}\r\n }\r\n }\r\n else {\r\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\r\n if (smokerCategories.includes($row.tobacco_smoking_status.toLowerCase())) {\r\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\r\n }\r\n }\r\n }\r\n }\r\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\r\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\r\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\r\n }\r\n }\r\n return result;\r\n })"]}}},"pack_years_smoked":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n // check tobacco related fields\r\n if ($name === 'tobacco_type') {\r\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\r\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\r\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\r\n }\r\n else if ($row.tobacco_smoking_status.toLowerCase() === 'smoking history not documented') {\r\n result = { valid: false, message: `The 'tobacco_smoking_status' field (smoking status not documented) is inconsistent if donor smoked '${$row.tobacco_type}'.`};\r\n }\r\n else if ($row.tobacco_smoking_status.toLowerCase() === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if donor is a lifelong non-smoker.`}\r\n }\r\n }\r\n else {\r\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\r\n if (smokerCategories.includes($row.tobacco_smoking_status.toLowerCase())) {\r\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\r\n }\r\n }\r\n }\r\n }\r\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\r\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\r\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\r\n }\r\n }\r\n return result;\r\n })"]}}},"alcohol_history":{"restrictions":{"codeList":{"left":["Yes","No","Not applicable","Unknown"],"right":["Yes","No","Unknown"],"data":{"added":[],"deleted":["Not applicable"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\r\n noOrUnknownAllowedCategories = [\"none\", \"occasional drinker (< once a month)\", \"unknown\"];\r\n \r\n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\r\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\r\n if ((!$field || $field == null || checkforEmpty($field)) && alcoholHistoryCategories.includes(alcoholConsumptionCategory)) {\r\n result = {valid:false, message: `If the donor is a '${alcoholConsumptionCategory}', then the 'alcohol_history' field must be submitted as well.`};\r\n }\r\n if ((!$field || $field === null || checkforEmpty($field) || $field.trim().toLowerCase() === 'no') && (!(noOrUnknownAllowedCategories.includes(alcoholConsumptionCategory)))) {\r\n result = {valid:false, message: `If the donor is a '${alcoholConsumptionCategory}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\r\n }\r\n }\r\n return result;\r\n })"]}}},"alcohol_consumption_category":{"restrictions":{"codeList":{"left":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"right":["Daily Drinker","None","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"data":{"added":[],"deleted":["Not applicable"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\r\n \r\n if (!$field || $field === null || checkforEmpty($field)) {\r\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\r\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\r\n }\r\n }\r\n else {\r\n alcoholConsumptionCategory = $field.trim().toLowerCase();\r\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\r\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\r\n }\r\n }\r\n return result;\r\n })"]}}},"alcohol_type":{"restrictions":{"codeList":{"left":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"right":["Beer","Liquor","Other","Unknown","Wine"],"data":{"added":[],"deleted":["Not applicable"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n exclusionTerms = [\"no\", \"none\", \"unknown\"]; \r\n requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\r\n \r\n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\r\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\r\n if ($field && $field != null && !(checkforEmpty($field))) {\r\n if (exclusionTerms.includes(alcoholConsumptionCategory)) {\r\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field should not be submitted.`};\r\n }\r\n }\r\n else {\r\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\r\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\r\n }\r\n }\r\n }\r\n if ($field && $field != null && !(checkforEmpty($field)) && (!$row.alcohol_consumption_category || $row.alcohol_consumption_category === null || checkforEmpty($row.alcohol_consumption_category))) {\r\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\r\n }\r\n return result;\r\n })"]}}},"opiate_use":{"restrictions":{"codeList":{"left":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"],"right":["Never","Unknown","Yes, currently","Yes, only in the past"],"data":{"added":[],"deleted":["Not applicable"]}}}},"hot_drinks_consumption":{"restrictions":{"codeList":{"left":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"],"right":["Never","Unknown","Yes, currently","Yes, only in the past"],"data":{"added":[],"deleted":["Not applicable"]}}}},"red_meat_frequency":{"restrictions":{"codeList":{"left":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"],"right":["Never","Less than once a month","1-3 times a month","Once or twice a week","Most days but not every day","Every day","Unknown"],"data":{"added":[],"deleted":["Not applicable"]}}}},"processed_meat_frequency":{"restrictions":{"codeList":{"left":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"],"right":["Never","Less than once a month","1-3 times a month","Once or twice a week","Most days but not every day","Every day","Unknown"],"data":{"added":[],"deleted":["Not applicable"]}}}},"soft_drinks_frequency":{"restrictions":{"codeList":{"left":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"],"right":["Never","Less than once a month","1-3 times a month","Once or twice a week","Most days but not every day","Every day","Unknown"],"data":{"added":[],"deleted":["Not applicable"]}}}},"exercise_frequency":{"restrictions":{"codeList":{"left":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"],"right":["Never","Less than once a month","1-3 times a month","Once or twice a week","Most days but not every day","Every day","Unknown"],"data":{"added":[],"deleted":["Not applicable"]}}}},"exercise_intensity":{"restrictions":{"codeList":{"left":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"right":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Vigorous: Increase in the heart beat substantially with heavy perspiration"],"data":{"added":[],"deleted":["Not applicable","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($field != null || !(checkforEmpty($field))) {\r\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency)) && $row.exercise_frequency.trim().toLowerCase() === \"never\") {\r\n result = {valid: false, message: `The 'exercise_frequency' field cannot be 'never' if the '${$name}' field is submitted.`};\r\n }\r\n } \r\n return result;\r\n })"]}}}},"created":{},"deleted":{}},"family_history":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"family_relative_id":{"meta":{"primaryId":{"left":true,"right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"age_of_relative_at_diagnosis":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n if ($row.relative_with_cancer_history != null) {\r\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\r\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\r\n };\r\n }\r\n }\r\n else {\r\n if (currField || currField != null) {\r\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"]}}},"cancer_type_code_of_relative":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n if ($row.relative_with_cancer_history != null) {\r\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\r\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\r\n };\r\n }\r\n }\r\n else {\r\n if (currField || currField != null) {\r\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"]}}},"cause_of_death_of_relative":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n if ($row.relative_vital_status && $row.relative_vital_status != null) {\r\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\r\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\r\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\r\n }\r\n }\r\n else {\r\n if ($field || $field != null) {\r\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\r\n }\r\n }\r\n return result;\r\n })"]}}},"relative_survival_time":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n if ($row.relative_with_cancer_history != null) {\r\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\r\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\r\n };\r\n }\r\n }\r\n else {\r\n if (currField || currField != null) {\r\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"]}}}},"created":{},"deleted":{}},"biomarker":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"meta":{"notes":{"left":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required.","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n let missing = true;\r\n\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\r\n \r\n if (!$field || checkforEmpty($field) || $field === null) { \r\n for (let idField of identifierFields) {\r\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\r\n continue;\r\n }\r\n else {\r\n missing = false;\r\n }\r\n }\r\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\r\n result = {\r\n valid: false,\r\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\r\n }\r\n }\r\n else if ($field && !(checkforEmpty($field)) && $field != null) {\r\n for (let idField of identifierFields) {\r\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\r\n result = {\r\n valid: false,\r\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\r\n break;\r\n }\r\n }\r\n }\r\n return result;\r\n })"]}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null},"notes":{"left":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required.","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n let missing = true;\r\n\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\r\n \r\n if (!$field || checkforEmpty($field) || $field === null) { \r\n for (let idField of identifierFields) {\r\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\r\n continue;\r\n }\r\n else {\r\n missing = false;\r\n }\r\n }\r\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\r\n result = {\r\n valid: false,\r\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\r\n }\r\n }\r\n else if ($field && !(checkforEmpty($field)) && $field != null) {\r\n for (let idField of identifierFields) {\r\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\r\n result = {\r\n valid: false,\r\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\r\n break;\r\n }\r\n }\r\n }\r\n return result;\r\n })"]}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"treatment.submitter_treatment_id","right":null},"notes":{"left":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required.","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n let missing = true;\r\n\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\r\n \r\n if (!$field || checkforEmpty($field) || $field === null) { \r\n for (let idField of identifierFields) {\r\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\r\n continue;\r\n }\r\n else {\r\n missing = false;\r\n }\r\n }\r\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\r\n result = {\r\n valid: false,\r\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\r\n }\r\n }\r\n else if ($field && !(checkforEmpty($field)) && $field != null) {\r\n for (let idField of identifierFields) {\r\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\r\n result = {\r\n valid: false,\r\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\r\n break;\r\n }\r\n }\r\n }\r\n return result;\r\n })"]}}},"submitter_follow_up_id":{"meta":{"foreignKey":{"left":"follow_up.submitter_follow_up_id","right":null},"notes":{"left":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required.","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n let missing = true;\r\n\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\r\n \r\n if (!$field || checkforEmpty($field) || $field === null) { \r\n for (let idField of identifierFields) {\r\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\r\n continue;\r\n }\r\n else {\r\n missing = false;\r\n }\r\n }\r\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\r\n result = {\r\n valid: false,\r\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\r\n }\r\n }\r\n else if ($field && !(checkforEmpty($field)) && $field != null) {\r\n for (let idField of identifierFields) {\r\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\r\n result = {\r\n valid: false,\r\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\r\n break;\r\n }\r\n }\r\n }\r\n return result;\r\n })"]}}},"test_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n let missing = true;\r\n\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\r\n \r\n if (!$field || checkforEmpty($field) || $field === null) { \r\n for (let idField of identifierFields) {\r\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\r\n continue;\r\n }\r\n else {\r\n missing = false;\r\n }\r\n }\r\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\r\n result = {\r\n valid: false,\r\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\r\n }\r\n }\r\n else if ($field && !(checkforEmpty($field)) && $field != null) {\r\n for (let idField of identifierFields) {\r\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\r\n result = {\r\n valid: false,\r\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\r\n break;\r\n }\r\n }\r\n }\r\n return result;\r\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}}},"created":{},"deleted":{}},"comorbidity":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"laterality_of_prior_malignancy":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n const invalidTypes = [\"no\", \"unknown\"]\r\n \r\n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\r\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\r\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"]}}},"age_at_comorbidity_diagnosis":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n const invalidTypes = [\"no\", \"unknown\"]\r\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\r\n \r\n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\r\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\r\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\r\n }\r\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\r\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\r\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\r\n }\r\n }\r\n }\r\n return result;\r\n })"]}}},"comorbidity_type_code":{"meta":{"notes":{"left":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n const invalidTypes = [\"no\", \"unknown\"]\r\n /* check if ICD-10 code is for neoplasms */\r\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\r\n\r\n \r\n if (neoplasmCode($row.comorbidity_type_code)) { \r\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\r\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\r\n }\r\n }\r\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\r\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\r\n }\r\n return result;\r\n })"]}}},"comorbidity_treatment_status":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n const invalidTypes = [\"no\", \"unknown\"]\r\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\r\n \r\n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\r\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\r\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\r\n }\r\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\r\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\r\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\r\n }\r\n }\r\n }\r\n return result;\r\n })"]}}},"comorbidity_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n const invalidTypes = [\"no\", \"unknown\"]\r\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\r\n \r\n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\r\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\r\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\r\n }\r\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\r\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\r\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\r\n }\r\n }\r\n }\r\n return result;\r\n })"]}}}},"created":{},"deleted":{}}}} diff --git a/scripts/data/schemas/diffs/1.24/1.24-diff-1.13.json b/scripts/data/schemas/diffs/1.24/1.24-diff-1.13.json new file mode 100644 index 00000000..a7644bec --- /dev/null +++ b/scripts/data/schemas/diffs/1.24/1.24-diff-1.13.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":[],"deleted":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"]}}}},"submitter_sample_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"primary_site":{"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva"],"data":{"added":[],"deleted":["Unknown primary site"]}}}},"genetic_disorders":{"description":{"left":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","right":"Indicate presence of any hereditary genetic disorders. (Reference: Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)"},"restrictions":{"codeList":{"left":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"],"right":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Serrated Polyposis Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"],"data":{"added":[],"deleted":["None","Not applicable","Unknown"]}}}},"hrt_type":{"restrictions":{"codeList":{"left":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"],"right":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Other","Patch","Pill","Unknown"],"data":{"added":[],"deleted":["Not applicable"]}}}},"hrt_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\") {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If '${$name}' is submitted, then '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n\n }\n return result;\n })"]}}},"contraception_type":{"restrictions":{"codeList":{"left":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"],"right":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Other","Progestin-only pill","Unknown","Vaginal ring"],"data":{"added":[],"deleted":["Not applicable","Oral contraceptive pill"]}}}},"contraception_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\") {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If '${$name}' is submitted, then '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n\n }\n return result;\n })"]}}}},"created":{},"deleted":{"lost_to_followup_after_clinical_event_id":{"changeType":"deleted","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}}},"specimen":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"pathological_tumour_staging_system":{"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["Revised International staging system (R-ISS)"]}}}},"pathological_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX"],"data":{"added":[],"deleted":["Not applicable"]}}}},"specimen_acquisition_interval":{"restrictions":{"range":{"left":null,"right":{"min":0}}}},"specimen_laterality":{"description":{"left":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","right":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR 2007875)"},"restrictions":{"codeList":{"left":["Left","Not applicable","Right","Unknown"],"right":["Left","Right","Unknown"],"data":{"added":[],"deleted":["Not applicable"]}}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"data":{"added":[],"deleted":["Unknown"]}}}},"specimen_storage":{"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"data":{"added":[],"deleted":["Unknown"]}}}},"reference_pathology_confirmed":{"description":{"left":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)","right":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist."}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"percent_tumour_cells":{"restrictions":{"script":{"left":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"],"right":null}}}},"created":{},"deleted":{"percent_tumour_cells_measurement_method":{"changeType":"deleted","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"laterality":{"description":{"left":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","right":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR 827)"}},"clinical_tumour_staging_system":{"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["Revised International staging system (R-ISS)"]}}}},"clinical_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX"],"data":{"added":[],"deleted":["Not applicable"]}}}},"performance_status":{"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"data":{"added":[],"deleted":["Unknown"]}}}}},"created":{},"deleted":{"lymph_nodes_examined_method":{"changeType":"deleted","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}}},"treatment":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":[],"deleted":["End of life care"]}}}},"is_primary_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Yes","No"],"right":["Yes","No","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"line_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'unknown') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'unknown'.`};\n }\n }\n return result;\n })"]}}},"treatment_start_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"treatment_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]}}},"days_per_cycle":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]}}},"number_of_cycles":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_intent":{"description":{"left":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","right":"Indicate the intended disease outcome for which the treatment is given. (Reference: NCIt C124307)"},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"],"right":["Curative","Palliative","Unknown"],"data":{"added":["Unknown"],"deleted":["Diagnostic","Forensic","Guidance","Preventative","Screening","Supportive"]}}}},"treatment_setting":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"],"right":["Adjuvant","Advanced/Metastatic","Neoadjuvant","Not applicable"],"data":{"added":["Not applicable"],"deleted":["Conditioning","Induction","Maintenance","Mobilization","Preventative","Radiosensitization","Salvage"]}}}},"response_to_treatment":{"description":{"left":"The donor's response to the applied treatment regimen.","right":"The donor's response to the applied treatment regimen. (Source: RECIST)"},"meta":{"dependsOn":{"left":"treatment.response_to_treatment_criteria_method","right":"treatment.treatment_type"},"notes":{"left":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"],"right":["Complete response","Disease progression","NED","Partial response","Stable disease"],"data":{"added":["Disease progression","NED"],"deleted":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease"]}}}},"outcome_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]}}},"toxicity_type":{"restrictions":{"codeList":{"left":["Hematological","Non-hematological","Not applicable","Unknown"],"right":["Hematological","Non-hematological"],"data":{"added":[],"deleted":["Not applicable","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n \n /* toxicityType should only be submitted if treatment was terminated early due to acute toxicity ('outcome_of_treatment' is 'Treatment stopped due to acute toxicity'). */\n if (outcomeOfTreatment != \"treatment stopped due to acute toxicity\") {\n result = { valid: false, message: `The 'outcome_of_treatment' field should be 'Treatment stopped due to acute toxicity' if the '${$name}' field is submitted.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"]}}},"hematological_toxicity":{"restrictions":{"codeList":{"left":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"right":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5"],"data":{"added":[],"deleted":["Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n if (($row.toxicity_type != null && !(checkforEmpty($row.toxicity_type)))) { \n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n \n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}},"non-hematological_toxicity":{"restrictions":{"codeList":{"left":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"right":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"data":{"added":[],"deleted":["Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n if (($row.toxicity_type != null && !(checkforEmpty($row.toxicity_type)))) { \n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n \n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}},"adverse_events":{"restrictions":{"codeList":{"left":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"right":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"data":{"added":[],"deleted":["None","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]}}},"clinical_trials_database":{"meta":{"notes":{"left":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added.","right":null}},"restrictions":{"codeList":{"left":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"],"right":["NCI Clinical Trials","EU Clinical Trials Register"],"data":{"added":[],"deleted":["Not applicable","Unknown"]}}}},"clinical_trial_number":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"]}}}},"created":{},"deleted":{"response_to_treatment_criteria_method":{"changeType":"deleted","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}}}},"chemotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"dependsOn":{"left":"chemotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"dependsOn":{"left":"chemotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"chemotherapy_dosage_units":{"changeType":"created","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate the total actual drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true,"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"deleted","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"hormone_drug_dosage_units":{"changeType":"created","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true,"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"deleted","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"radiation":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{"radiation_boost":{"changeType":"deleted","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"deleted","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}}},"immunotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"dependsOn":{"left":"immunotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"dependsOn":{"left":"immunotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"},"displayName":{"left":"Chemotherapy Drug Name","right":"Immunotherapy Drug Name"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"deleted","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"surgery":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"deleted","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"deleted","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"deleted","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"deleted","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"deleted","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"deleted","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"deleted","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"deleted","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"deleted","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"deleted","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"deleted","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"deleted","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"deleted","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"deleted","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}}},"follow_up":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_follow_up_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"interval_of_followup":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"treatment.submitter_treatment_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"relapse_type":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"]}}},"relapse_interval":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"method_of_progression_status":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"]}}},"anatomic_site_progression_or_recurrence":{"description":{"left":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","right":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344."},"meta":{"examples":{"left":"C50.1|C18","right":"C50.1,C18"},"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["Revised International staging system (R-ISS)"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"]}}},"recurrence_t_category":{"meta":{"core":{"left":null,"right":true}}},"recurrence_n_category":{"meta":{"core":{"left":null,"right":true}}},"recurrence_m_category":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX"],"data":{"added":[],"deleted":["Not applicable"]}}}},"recurrence_stage_group":{"meta":{"core":{"left":null,"right":true}}},"posttherapy_tumour_staging_system":{"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["Revised International staging system (R-ISS)"]}}}},"posttherapy_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX"],"data":{"added":[],"deleted":["Not applicable"]}}}}},"created":{},"deleted":{}},"exposure":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"tobacco_smoking_status":{"restrictions":{"codeList":{"left":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"],"right":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Smoking history not documented"],"data":{"added":[],"deleted":["Not applicable"]}}}},"tobacco_type":{"restrictions":{"codeList":{"left":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"right":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"data":{"added":[],"deleted":["Not applicable"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else if ($row.tobacco_smoking_status.toLowerCase() === 'smoking history not documented') {\n result = { valid: false, message: `The 'tobacco_smoking_status' field (smoking status not documented) is inconsistent if donor smoked '${$row.tobacco_type}'.`};\n }\n else if ($row.tobacco_smoking_status.toLowerCase() === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if donor is a lifelong non-smoker.`}\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}}},"pack_years_smoked":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else if ($row.tobacco_smoking_status.toLowerCase() === 'smoking history not documented') {\n result = { valid: false, message: `The 'tobacco_smoking_status' field (smoking status not documented) is inconsistent if donor smoked '${$row.tobacco_type}'.`};\n }\n else if ($row.tobacco_smoking_status.toLowerCase() === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if donor is a lifelong non-smoker.`}\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}}},"alcohol_history":{"restrictions":{"codeList":{"left":["Yes","No","Not applicable","Unknown"],"right":["Yes","No","Unknown"],"data":{"added":[],"deleted":["Not applicable"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n noOrUnknownAllowedCategories = [\"none\", \"occasional drinker (< once a month)\", \"unknown\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ((!$field || $field == null || checkforEmpty($field)) && alcoholHistoryCategories.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `If the donor is a '${alcoholConsumptionCategory}', then the 'alcohol_history' field must be submitted as well.`};\n }\n if ((!$field || $field === null || checkforEmpty($field) || $field.trim().toLowerCase() === 'no') && (!(noOrUnknownAllowedCategories.includes(alcoholConsumptionCategory)))) {\n result = {valid:false, message: `If the donor is a '${alcoholConsumptionCategory}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n }\n return result;\n })"]}}},"alcohol_consumption_category":{"restrictions":{"codeList":{"left":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"right":["Daily Drinker","None","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"data":{"added":[],"deleted":["Not applicable"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}}},"alcohol_type":{"restrictions":{"codeList":{"left":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"right":["Beer","Liquor","Other","Unknown","Wine"],"data":{"added":[],"deleted":["Not applicable"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n exclusionTerms = [\"no\", \"none\", \"unknown\"]; \n requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (exclusionTerms.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field should not be submitted.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n if ($field && $field != null && !(checkforEmpty($field)) && (!$row.alcohol_consumption_category || $row.alcohol_consumption_category === null || checkforEmpty($row.alcohol_consumption_category))) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n return result;\n })"]}}},"opiate_use":{"restrictions":{"codeList":{"left":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"],"right":["Never","Unknown","Yes, currently","Yes, only in the past"],"data":{"added":[],"deleted":["Not applicable"]}}}},"hot_drinks_consumption":{"restrictions":{"codeList":{"left":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"],"right":["Never","Unknown","Yes, currently","Yes, only in the past"],"data":{"added":[],"deleted":["Not applicable"]}}}},"red_meat_frequency":{"restrictions":{"codeList":{"left":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"],"right":["Never","Less than once a month","1-3 times a month","Once or twice a week","Most days but not every day","Every day","Unknown"],"data":{"added":[],"deleted":["Not applicable"]}}}},"processed_meat_frequency":{"restrictions":{"codeList":{"left":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"],"right":["Never","Less than once a month","1-3 times a month","Once or twice a week","Most days but not every day","Every day","Unknown"],"data":{"added":[],"deleted":["Not applicable"]}}}},"soft_drinks_frequency":{"restrictions":{"codeList":{"left":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"],"right":["Never","Less than once a month","1-3 times a month","Once or twice a week","Most days but not every day","Every day","Unknown"],"data":{"added":[],"deleted":["Not applicable"]}}}},"exercise_frequency":{"restrictions":{"codeList":{"left":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"],"right":["Never","Less than once a month","1-3 times a month","Once or twice a week","Most days but not every day","Every day","Unknown"],"data":{"added":[],"deleted":["Not applicable"]}}}},"exercise_intensity":{"restrictions":{"codeList":{"left":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"right":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Vigorous: Increase in the heart beat substantially with heavy perspiration"],"data":{"added":[],"deleted":["Not applicable","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null || !(checkforEmpty($field))) {\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency)) && $row.exercise_frequency.trim().toLowerCase() === \"never\") {\n result = {valid: false, message: `The 'exercise_frequency' field cannot be 'never' if the '${$name}' field is submitted.`};\n }\n } \n return result;\n })"]}}}},"created":{},"deleted":{}},"family_history":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"family_relative_id":{"meta":{"primaryId":{"left":true,"right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"biomarker":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"treatment.submitter_treatment_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_follow_up_id":{"meta":{"foreignKey":{"left":"follow_up.submitter_follow_up_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"test_interval":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}}},"created":{},"deleted":{}},"comorbidity":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}}}} diff --git a/scripts/data/schemas/diffs/1.24/1.24-diff-1.14.json b/scripts/data/schemas/diffs/1.24/1.24-diff-1.14.json new file mode 100644 index 00000000..e25dd016 --- /dev/null +++ b/scripts/data/schemas/diffs/1.24/1.24-diff-1.14.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":[],"deleted":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"]}}}},"submitter_sample_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"primary_site":{"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva"],"data":{"added":[],"deleted":["Unknown primary site"]}}}}},"created":{},"deleted":{"lost_to_followup_after_clinical_event_id":{"changeType":"deleted","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}}},"specimen":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"pathological_tumour_staging_system":{"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["Revised International staging system (R-ISS)"]}}}},"pathological_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX"],"data":{"added":[],"deleted":["Not applicable"]}}}},"specimen_acquisition_interval":{"restrictions":{"range":{"left":null,"right":{"min":0}}}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"percent_tumour_cells":{"restrictions":{"script":{"left":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"],"right":null}}}},"created":{},"deleted":{"percent_tumour_cells_measurement_method":{"changeType":"deleted","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"clinical_tumour_staging_system":{"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["Revised International staging system (R-ISS)"]}}}},"clinical_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX"],"data":{"added":[],"deleted":["Not applicable"]}}}}},"created":{},"deleted":{"lymph_nodes_examined_method":{"changeType":"deleted","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}}},"treatment":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":[],"deleted":["End of life care"]}}}},"is_primary_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Yes","No"],"right":["Yes","No","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"line_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'unknown') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'unknown'.`};\n }\n }\n return result;\n })"]}}},"treatment_start_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"treatment_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]}}},"days_per_cycle":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]}}},"number_of_cycles":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_intent":{"description":{"left":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","right":"Indicate the intended disease outcome for which the treatment is given. (Reference: NCIt C124307)"},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"],"right":["Curative","Palliative","Unknown"],"data":{"added":["Unknown"],"deleted":["Diagnostic","Forensic","Guidance","Preventative","Screening","Supportive"]}}}},"treatment_setting":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"],"right":["Adjuvant","Advanced/Metastatic","Neoadjuvant","Not applicable"],"data":{"added":["Not applicable"],"deleted":["Conditioning","Induction","Maintenance","Mobilization","Preventative","Radiosensitization","Salvage"]}}}},"response_to_treatment":{"description":{"left":"The donor's response to the applied treatment regimen.","right":"The donor's response to the applied treatment regimen. (Source: RECIST)"},"meta":{"dependsOn":{"left":"treatment.response_to_treatment_criteria_method","right":"treatment.treatment_type"},"notes":{"left":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"],"right":["Complete response","Disease progression","NED","Partial response","Stable disease"],"data":{"added":["Disease progression","NED"],"deleted":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease"]}}}},"outcome_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]}}},"adverse_events":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]}}}},"created":{},"deleted":{"response_to_treatment_criteria_method":{"changeType":"deleted","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}}}},"chemotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"dependsOn":{"left":"chemotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"dependsOn":{"left":"chemotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"chemotherapy_dosage_units":{"changeType":"created","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate the total actual drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true,"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"deleted","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"hormone_drug_dosage_units":{"changeType":"created","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true,"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"deleted","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"radiation":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{"radiation_boost":{"changeType":"deleted","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"deleted","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}}},"immunotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"dependsOn":{"left":"immunotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"dependsOn":{"left":"immunotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"},"displayName":{"left":"Chemotherapy Drug Name","right":"Immunotherapy Drug Name"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"deleted","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"surgery":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"surgery_type":{"restrictions":{"codeList":{"left":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"],"right":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"],"data":{"added":[],"deleted":["Hemithyroidectomy","Near-total thyroidectomy","Subtotal thyroidectomy","Total thyroidectomy"]}}}}},"created":{},"deleted":{}},"follow_up":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_follow_up_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"interval_of_followup":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"treatment.submitter_treatment_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"relapse_type":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"]}}},"relapse_interval":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"method_of_progression_status":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"]}}},"anatomic_site_progression_or_recurrence":{"description":{"left":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","right":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344."},"meta":{"examples":{"left":"C50.1|C18","right":"C50.1,C18"},"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["Revised International staging system (R-ISS)"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"]}}},"recurrence_t_category":{"meta":{"core":{"left":null,"right":true}}},"recurrence_n_category":{"meta":{"core":{"left":null,"right":true}}},"recurrence_m_category":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX"],"data":{"added":[],"deleted":["Not applicable"]}}}},"recurrence_stage_group":{"meta":{"core":{"left":null,"right":true}}},"posttherapy_tumour_staging_system":{"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["Revised International staging system (R-ISS)"]}}}},"posttherapy_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX"],"data":{"added":[],"deleted":["Not applicable"]}}}}},"created":{},"deleted":{}},"exposure":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"family_history":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"family_relative_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"biomarker":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"treatment.submitter_treatment_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_follow_up_id":{"meta":{"foreignKey":{"left":"follow_up.submitter_follow_up_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"test_interval":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}}},"created":{},"deleted":{}},"comorbidity":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}}}} diff --git a/scripts/data/schemas/diffs/1.24/1.24-diff-1.15.json b/scripts/data/schemas/diffs/1.24/1.24-diff-1.15.json new file mode 100644 index 00000000..a8cd910d --- /dev/null +++ b/scripts/data/schemas/diffs/1.24/1.24-diff-1.15.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":[],"deleted":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"]}}}},"submitter_sample_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"primary_site":{"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva"],"data":{"added":[],"deleted":["Unknown primary site"]}}}}},"created":{},"deleted":{"lost_to_followup_after_clinical_event_id":{"changeType":"deleted","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}}},"specimen":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"pathological_tumour_staging_system":{"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["Revised International staging system (R-ISS)"]}}}},"pathological_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX"],"data":{"added":[],"deleted":["Not applicable"]}}}},"specimen_acquisition_interval":{"restrictions":{"range":{"left":null,"right":{"min":0}}}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"percent_tumour_cells":{"restrictions":{"script":{"left":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"],"right":null}}}},"created":{},"deleted":{"percent_tumour_cells_measurement_method":{"changeType":"deleted","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"clinical_tumour_staging_system":{"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["Revised International staging system (R-ISS)"]}}}},"clinical_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX"],"data":{"added":[],"deleted":["Not applicable"]}}}}},"created":{},"deleted":{"lymph_nodes_examined_method":{"changeType":"deleted","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}}},"treatment":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":[],"deleted":["End of life care"]}}}},"is_primary_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Yes","No"],"right":["Yes","No","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"line_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'unknown') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'unknown'.`};\n }\n }\n return result;\n })"]}}},"treatment_start_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"treatment_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]}}},"days_per_cycle":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]}}},"number_of_cycles":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_intent":{"description":{"left":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","right":"Indicate the intended disease outcome for which the treatment is given. (Reference: NCIt C124307)"},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"],"right":["Curative","Palliative","Unknown"],"data":{"added":["Unknown"],"deleted":["Diagnostic","Forensic","Guidance","Preventative","Screening","Supportive"]}}}},"treatment_setting":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"],"right":["Adjuvant","Advanced/Metastatic","Neoadjuvant","Not applicable"],"data":{"added":["Not applicable"],"deleted":["Conditioning","Induction","Maintenance","Mobilization","Preventative","Radiosensitization","Salvage"]}}}},"response_to_treatment":{"description":{"left":"The donor's response to the applied treatment regimen.","right":"The donor's response to the applied treatment regimen. (Source: RECIST)"},"meta":{"dependsOn":{"left":"treatment.response_to_treatment_criteria_method","right":"treatment.treatment_type"},"notes":{"left":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"],"right":["Complete response","Disease progression","NED","Partial response","Stable disease"],"data":{"added":["Disease progression","NED"],"deleted":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease"]}}}},"outcome_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]}}},"adverse_events":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]}}}},"created":{},"deleted":{"response_to_treatment_criteria_method":{"changeType":"deleted","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}}}},"chemotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"dependsOn":{"left":"chemotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"dependsOn":{"left":"chemotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"chemotherapy_dosage_units":{"changeType":"created","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate the total actual drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true,"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"deleted","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"hormone_drug_dosage_units":{"changeType":"created","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true,"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"deleted","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"radiation":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{"radiation_boost":{"changeType":"deleted","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"deleted","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}}},"immunotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"dependsOn":{"left":"immunotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"dependsOn":{"left":"immunotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"},"displayName":{"left":"Chemotherapy Drug Name","right":"Immunotherapy Drug Name"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"deleted","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"surgery":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"follow_up":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_follow_up_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"interval_of_followup":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"treatment.submitter_treatment_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"relapse_type":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"]}}},"relapse_interval":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"method_of_progression_status":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"]}}},"anatomic_site_progression_or_recurrence":{"description":{"left":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","right":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344."},"meta":{"examples":{"left":"C50.1|C18","right":"C50.1,C18"},"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["Revised International staging system (R-ISS)"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"]}}},"recurrence_t_category":{"meta":{"core":{"left":null,"right":true}}},"recurrence_n_category":{"meta":{"core":{"left":null,"right":true}}},"recurrence_m_category":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX"],"data":{"added":[],"deleted":["Not applicable"]}}}},"recurrence_stage_group":{"meta":{"core":{"left":null,"right":true}}},"posttherapy_tumour_staging_system":{"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["Revised International staging system (R-ISS)"]}}}},"posttherapy_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX"],"data":{"added":[],"deleted":["Not applicable"]}}}}},"created":{},"deleted":{}},"exposure":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"family_history":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"family_relative_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"biomarker":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"treatment.submitter_treatment_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_follow_up_id":{"meta":{"foreignKey":{"left":"follow_up.submitter_follow_up_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"test_interval":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}}},"created":{},"deleted":{}},"comorbidity":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}}}} diff --git a/scripts/data/schemas/diffs/1.24/1.24-diff-1.16.json b/scripts/data/schemas/diffs/1.24/1.24-diff-1.16.json new file mode 100644 index 00000000..19ded27b --- /dev/null +++ b/scripts/data/schemas/diffs/1.24/1.24-diff-1.16.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":[],"deleted":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"]}}}},"submitter_sample_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{"lost_to_followup_after_clinical_event_id":{"changeType":"deleted","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}}},"specimen":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"specimen_acquisition_interval":{"restrictions":{"range":{"left":null,"right":{"min":0}}}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"percent_tumour_cells":{"restrictions":{"script":{"left":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"],"right":null}}}},"created":{},"deleted":{"percent_tumour_cells_measurement_method":{"changeType":"deleted","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"lymph_nodes_examined_method":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable'];\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n return result;\n})"]}}}},"created":{},"deleted":{}},"treatment":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":[],"deleted":["End of life care"]}}}},"is_primary_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}},"treatment_start_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"treatment_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}},"days_per_cycle":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}},"number_of_cycles":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}},"treatment_intent":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}},"treatment_setting":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}},"response_to_treatment_criteria_method":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}},"response_to_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"]},"codeList":{"left":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"],"right":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed stable disease","Progressive disease","Stable disease"],"data":{"added":[],"deleted":["Physician assessed progressive disease"]}}}},"outcome_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}},"adverse_events":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}}},"created":{},"deleted":{}},"chemotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"dependsOn":{"left":"chemotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"dependsOn":{"left":"chemotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"chemotherapy_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"data":{"added":[],"deleted":["mg"]}}}},"prescribed_cumulative_drug_dose":{"meta":{"validationDependency":{"left":true,"right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"]}}},"actual_cumulative_drug_dose":{"meta":{"validationDependency":{"left":true,"right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"]}}}},"created":{},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"hormone_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"data":{"added":[],"deleted":["mg"]}}}}},"created":{},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"radiation":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{"radiation_boost":{"changeType":"deleted","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"deleted","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}}},"immunotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"dependsOn":{"left":"immunotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"dependsOn":{"left":"immunotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"},"displayName":{"left":"Chemotherapy Drug Name","right":"Immunotherapy Drug Name"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"immunotherapy_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"data":{"added":[],"deleted":["mg"]}}}}},"created":{},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"surgery":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"follow_up":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_follow_up_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"interval_of_followup":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"relapse_interval":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"anatomic_site_progression_or_recurrence":{"description":{"left":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","right":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344."},"meta":{"examples":{"left":"C50.1|C18","right":"C50.1,C18"},"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}}}},"created":{},"deleted":{}},"exposure":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"family_history":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"family_relative_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"biomarker":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_follow_up_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"test_interval":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}}},"created":{},"deleted":{}},"comorbidity":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}}}} diff --git a/scripts/data/schemas/diffs/1.24/1.24-diff-1.17.json b/scripts/data/schemas/diffs/1.24/1.24-diff-1.17.json new file mode 100644 index 00000000..0d7fb04b --- /dev/null +++ b/scripts/data/schemas/diffs/1.24/1.24-diff-1.17.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":[],"deleted":["Cell line - derived from metastatic tumour","Xenograft - derived from metastatic tumour"]}}}},"submitter_sample_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{"lost_to_followup_after_clinical_event_id":{"changeType":"deleted","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}}},"specimen":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"specimen_acquisition_interval":{"restrictions":{"range":{"left":null,"right":{"min":0}}}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"percent_tumour_cells":{"restrictions":{"script":{"left":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"],"right":null}}}},"created":{},"deleted":{}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"lymph_nodes_examined_method":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"]}}}},"created":{},"deleted":{}},"treatment":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":[],"deleted":["End of life care"]}}}},"is_primary_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}},"treatment_start_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"treatment_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}},"days_per_cycle":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}},"number_of_cycles":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}},"treatment_intent":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}},"treatment_setting":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}},"response_to_treatment_criteria_method":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}},"response_to_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"]},"codeList":{"left":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"],"right":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed stable disease","Progressive disease","Stable disease"],"data":{"added":[],"deleted":["Physician assessed progressive disease"]}}}},"outcome_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}},"adverse_events":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}}},"created":{},"deleted":{}},"chemotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"dependsOn":{"left":"chemotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"dependsOn":{"left":"chemotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"chemotherapy_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"data":{"added":[],"deleted":["mg"]}}}},"prescribed_cumulative_drug_dose":{"meta":{"validationDependency":{"left":true,"right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"]}}},"actual_cumulative_drug_dose":{"meta":{"validationDependency":{"left":true,"right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"]}}}},"created":{},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"hormone_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"data":{"added":[],"deleted":["mg"]}}}}},"created":{},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"radiation":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{"radiation_boost":{"changeType":"deleted","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"deleted","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}}},"immunotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"dependsOn":{"left":"immunotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"dependsOn":{"left":"immunotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"},"displayName":{"left":"Chemotherapy Drug Name","right":"Immunotherapy Drug Name"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"immunotherapy_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"data":{"added":[],"deleted":["mg"]}}}}},"created":{},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"surgery":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"follow_up":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_follow_up_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"interval_of_followup":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"relapse_interval":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}}},"created":{},"deleted":{}},"exposure":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"family_history":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"family_relative_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"biomarker":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_follow_up_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"test_interval":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}}},"created":{},"deleted":{}},"comorbidity":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}}}} diff --git a/scripts/data/schemas/diffs/1.24/1.24-diff-1.18.json b/scripts/data/schemas/diffs/1.24/1.24-diff-1.18.json new file mode 100644 index 00000000..c430a039 --- /dev/null +++ b/scripts/data/schemas/diffs/1.24/1.24-diff-1.18.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":[],"deleted":["Cell line - derived from metastatic tumour","Xenograft - derived from metastatic tumour"]}}}},"submitter_sample_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{"lost_to_followup_after_clinical_event_id":{"changeType":"deleted","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}}},"specimen":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"specimen_acquisition_interval":{"restrictions":{"range":{"left":null,"right":{"min":0}}}},"percent_tumour_cells":{"restrictions":{"script":{"left":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"],"right":null}}}},"created":{},"deleted":{}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"treatment":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":[],"deleted":["End of life care"]}}}},"is_primary_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}},"treatment_start_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"treatment_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}},"days_per_cycle":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}},"number_of_cycles":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}},"treatment_intent":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}},"treatment_setting":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}},"response_to_treatment_criteria_method":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}},"response_to_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"]},"codeList":{"left":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"],"right":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed stable disease","Progressive disease","Stable disease"],"data":{"added":[],"deleted":["Physician assessed progressive disease"]}}}},"outcome_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}},"adverse_events":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}}},"created":{},"deleted":{}},"chemotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"dependsOn":{"left":"chemotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"dependsOn":{"left":"chemotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"chemotherapy_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"data":{"added":[],"deleted":["mg"]}}}}},"created":{},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"hormone_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"data":{"added":[],"deleted":["mg"]}}}}},"created":{},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"radiation":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{"radiation_boost":{"changeType":"deleted","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"deleted","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}}},"immunotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"dependsOn":{"left":"immunotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"dependsOn":{"left":"immunotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"},"displayName":{"left":"Chemotherapy Drug Name","right":"Immunotherapy Drug Name"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"immunotherapy_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"data":{"added":[],"deleted":["mg"]}}}}},"created":{},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"surgery":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"follow_up":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_follow_up_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"interval_of_followup":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"relapse_interval":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}}},"created":{},"deleted":{}},"exposure":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"family_history":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"family_relative_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"biomarker":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_follow_up_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"test_interval":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}}},"created":{},"deleted":{}},"comorbidity":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}}}} diff --git a/scripts/data/schemas/diffs/1.24/1.24-diff-1.19.json b/scripts/data/schemas/diffs/1.24/1.24-diff-1.19.json new file mode 100644 index 00000000..2a1a5fcf --- /dev/null +++ b/scripts/data/schemas/diffs/1.24/1.24-diff-1.19.json @@ -0,0 +1 @@ +{"schemas":{"specimen":{"updated":{"specimen_acquisition_interval":{"restrictions":{"range":{"left":null,"right":{"min":0}}}},"percent_tumour_cells":{"restrictions":{"script":{"left":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"],"right":null}}}},"created":{},"deleted":{}},"treatment":{"updated":{"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":[],"deleted":["End of life care"]}}}},"is_primary_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}},"treatment_start_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"treatment_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}},"days_per_cycle":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}},"number_of_cycles":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}},"treatment_intent":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}},"treatment_setting":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}},"response_to_treatment_criteria_method":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}},"response_to_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"]}}},"outcome_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}},"adverse_events":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}}},"created":{},"deleted":{}},"chemotherapy":{"updated":{"drug_rxnormcui":{"meta":{"dependsOn":{"left":"chemotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"dependsOn":{"left":"chemotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"chemotherapy_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"data":{"added":[],"deleted":["mg"]}}}}},"created":{},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"hormone_therapy":{"updated":{"drug_rxnormcui":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"hormone_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"data":{"added":[],"deleted":["mg"]}}}}},"created":{},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"radiation":{"updated":{},"created":{},"deleted":{"radiation_boost":{"changeType":"deleted","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"deleted","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}}},"immunotherapy":{"updated":{"drug_rxnormcui":{"meta":{"dependsOn":{"left":"immunotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"dependsOn":{"left":"immunotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"},"displayName":{"left":"Chemotherapy Drug Name","right":"Immunotherapy Drug Name"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"immunotherapy_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"data":{"added":[],"deleted":["mg"]}}}}},"created":{},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"follow_up":{"updated":{"interval_of_followup":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"relapse_interval":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}}},"created":{},"deleted":{}},"biomarker":{"updated":{"test_interval":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}}},"created":{},"deleted":{}}}} diff --git a/scripts/data/schemas/diffs/1.24/1.24-diff-1.2.json b/scripts/data/schemas/diffs/1.24/1.24-diff-1.2.json new file mode 100644 index 00000000..bfb42c89 --- /dev/null +++ b/scripts/data/schemas/diffs/1.24/1.24-diff-1.2.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":[],"deleted":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n const row = $row;\n let result = {valid: true, message: \"Ok\"};\n \n const designation = row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\"){\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when tumour_normal_designation is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when tumour_normal_designation is set to Tumour.\"};\n }\n }\n return result;\n })"]}}},"submitter_sample_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased"],"right":["Alive","Deceased","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"cause_of_death":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })"]}}},"survival_time":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })"]},"range":{"left":{"exclusiveMin":0},"right":null}}},"primary_site":{"meta":{"notes":{"left":"To include multiple values, separate values with a pipe delimiter '|' within your file.","right":null},"examples":{"left":"Breast|Ovary","right":null}},"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Not Reported","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva","Unknown"],"data":{"added":["Not Reported","Unknown"],"deleted":["Unknown primary site"]}}}},"height":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"weight":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"bmi":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"menopause_status":{"description":{"left":"Indicate the donor's menopause status at the time of primary diagnosis. (Reference: caDSR CDE ID 2434914)","right":"Indicate the donor's menopause status at the time of primary diagnosis. (Codelist reference: NCI CDE ID: 2434914)"},"restrictions":{"codeList":{"left":["Not applicable","Perimenopausal","Postmenopausal","Premenopausal","Unknown"],"right":["Indeterminate or unknown","Not applicable","Perimenopausal","Postmenopausal","Premenopausal"],"data":{"added":["Indeterminate or unknown"],"deleted":["Unknown"]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)","right":"Indicate the donor's age of menarche, the first occurrence of menstruation."},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"number_of_pregnancies":{"description":{"left":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)","right":"Indicate the number of pregnancies a donor has had."},"restrictions":{"range":{"left":{"min":0},"right":null}}},"number_of_children":{"description":{"left":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)","right":"Indicate the number of children the donor has birthed."},"restrictions":{"range":{"left":{"min":0},"right":null}}}},"created":{"prior_malignancy":{"changeType":"created","description":"Prior malignancy affecting donor.","name":"prior_malignancy","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy","examples":"C41.1, C16.9, C00.5, D46.9"}},"cancer_type_prior_malignancy":{"changeType":"created","description":"The code to represent the cancer type of a prior malignancy using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","name":"cancer_type_prior_malignancy","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"valueType":"string","meta":{"displayName":"Cancer Type Prior Malignancy"}},"age_at_prior_malignancy":{"changeType":"created","description":"If donor has history of prior malignancy, indicate age at previous diagnosis, in years.","name":"age_at_prior_malignancy","valueType":"integer","meta":{"displayName":"Age at Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"created","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Codelist reference: NCI CDE: 4122391)","name":"laterality_of_prior_malignancy","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality at Prior Malignancy"}}},"deleted":{"genetic_disorders":{"changeType":"deleted","description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},"hrt_type":{"changeType":"deleted","description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},"hrt_duration":{"changeType":"deleted","description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},"contraception_type":{"changeType":"deleted","description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},"contraception_duration":{"changeType":"deleted","description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},"lost_to_followup_after_clinical_event_id":{"changeType":"deleted","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}}},"specimen":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null},"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"pathological_tumour_staging_system":{"meta":{"validationDependency":{"left":true,"right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"pathological_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"pathological_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"pathological_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.pathological_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.pathological_tumour_staging_system && $row.pathological_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'pathological_tumour_staging_system' is set to '${\n $row.pathological_tumour_staging_system\n }', 'pathological_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"data":{"added":[],"deleted":["Unknown"]}}}},"specimen_storage":{"description":{"left":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured.","right":"Indicate the method of specimen storage for specimens that were not extracted freshly or immediately cultured."},"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"data":{"added":[],"deleted":["Unknown"]}}}},"reference_pathology_confirmed":{"description":{"left":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)","right":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist."}},"tumour_grading_system":{"meta":{"validationDependency":{"left":true,"right":null}}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = \"'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.\";\n result.message = msg;\n }\n }\n return result;\n })"]}}},"percent_tumour_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)","right":"Indicate a value, in decimals, that represents the percentage of infiltration by tumour cells in a specimen."},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null},"script":{"left":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"],"right":null}}},"percent_proliferating_cells":{"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_inflammatory_tissue":{"description":{"left":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)","right":"Indicate a value, in decimals, that represents local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_stromal_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)","right":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a malignant tumour specimen but are not malignant such as fibroblasts, vascular structures, etc."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_necrosis":{"description":{"left":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)","right":"Indicate a value, in decimals, that represents the percentage of cell death in a malignant tumour specimen."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}}},"created":{},"deleted":{"specimen_laterality":{"changeType":"deleted","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"percent_tumour_cells_measurement_method":{"changeType":"deleted","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"age_at_diagnosis":{"restrictions":{"range":{"left":{"exclusiveMin":0,"max":90},"right":null}}},"number_lymph_nodes_examined":{"description":{"left":"The total number of lymph nodes tested for the presence of cancer. (Reference: caDSR CDE ID 3)","right":"The total number of lymph nodes tested for the presence of cancer. (Reference: NCI CDE ID: 3)"},"meta":{"dependsOn":{"left":"primary_diagnosis.lymph_nodes_examined_status","right":null},"notes":{"left":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":null},"range":{"left":{"min":0},"right":null}}},"number_lymph_nodes_positive":{"description":{"left":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: caDSR CDE ID 6113694)","right":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: NCI CDE ID: 6113694)"},"meta":{"dependsOn":{"left":"primary_diagnosis.lymph_nodes_examined_status","right":null},"notes":{"left":"This field is only required if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":null},"range":{"left":{"min":0},"right":null},"required":{"left":null,"right":true}}},"clinical_tumour_staging_system":{"meta":{"validationDependency":{"left":true,"right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}},"required":{"left":null,"right":true}}},"clinical_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"clinical_n_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null}}},"clinical_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"clinical_stage_group":{"description":{"left":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage.","right":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.)."},"meta":{"examples":{"left":"Stage I, Stage IIB","right":null}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.clinical_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'clinical_tumour_staging_system' is set to '${\n $row.clinical_tumour_staging_system\n }', 'clinical_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })"]},"required":{"left":null,"right":true}}},"presenting_symptoms":{"restrictions":{"codeList":{"left":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Loss of Appetite","Nausea","None","Not Reported","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Swelling in the Neck","Unknown","Vomiting","Weight Loss"],"right":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Loss of Appetite","Nausea","None","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Unknown","Vomiting","Weight Loss"],"data":{"added":[],"deleted":["Not Reported","Swelling in the Neck"]}}}},"performance_status":{"description":{"left":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status).","right":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference source: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status)."},"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"data":{"added":[],"deleted":["Unknown"]}}}}},"created":{},"deleted":{"laterality":{"changeType":"deleted","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_status":{"changeType":"deleted","name":"lymph_nodes_examined_status","description":"Indicate if lymph nodes were examined for metastases.","valueType":"string","restrictions":{"required":true,"codeList":["Cannot be determined","No","No lymph nodes found in resected specimen","Not applicable","Yes"]},"meta":{"core":true,"displayName":"Lymph Nodes Examined Status"}},"lymph_nodes_examined_method":{"changeType":"deleted","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}}},"treatment":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null},"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":[],"deleted":["End of life care"]}}}},"is_primary_treatment":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"codeList":{"left":["Yes","No"],"right":["Yes","No","Unknown"],"data":{"added":["Unknown"],"deleted":[]}},"required":{"left":null,"right":true}}},"line_of_treatment":{"meta":{"dependsOn":{"left":"treatment.is_primary_treatment","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"],"right":null}}},"treatment_start_interval":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"treatment_duration":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null},"required":{"left":null,"right":true}}},"days_per_cycle":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null}}},"number_of_cycles":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null}}},"treatment_intent":{"description":{"left":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","right":"Indicate the intended disease outcome for which the treatment is given. (Reference: CDISC [NCIt code: C124307])"},"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"codeList":{"left":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"],"right":["Curative","Palliative","Unknown"],"data":{"added":["Unknown"],"deleted":["Diagnostic","Forensic","Guidance","Preventative","Screening","Supportive"]}},"required":{"left":null,"right":true}}},"treatment_setting":{"description":{"left":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: NCIt C124308)","right":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: CDISC [NCIt code: C124308])"},"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"codeList":{"left":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"],"right":["Adjuvant","Advanced/Metastatic","Neoadjuvant","Not applicable"],"data":{"added":["Not applicable"],"deleted":["Conditioning","Induction","Maintenance","Mobilization","Preventative","Radiosensitization","Salvage"]}},"required":{"left":null,"right":true}}},"response_to_treatment":{"description":{"left":"The donor's response to the applied treatment regimen.","right":"The donor's response to the applied treatment regimen. (Source: RECIST)"},"meta":{"dependsOn":{"left":"treatment.response_to_treatment_criteria_method","right":null},"notes":{"left":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"right":null},"codeList":{"left":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"],"right":["Complete response","Disease progression","NED","Partial response","Stable disease"],"data":{"added":["Disease progression","NED"],"deleted":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease"]}},"required":{"left":null,"right":true}}},"outcome_of_treatment":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null}}},"toxicity_type":{"description":{"left":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity.","right":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hemotological toxicity or non-hemotological toxicity."},"meta":{"dependsOn":{"left":"treatment.outcome_of_treatment","right":null}},"restrictions":{"codeList":{"left":["Hematological","Non-hematological","Not applicable","Unknown"],"right":["Hemotological","Non-hemotological"],"data":{"added":["Hemotological","Non-hemotological"],"deleted":["Hematological","Non-hematological","Not applicable","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"],"right":null}}},"adverse_events":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"codeList":{"left":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"right":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"data":{"added":[],"deleted":["None","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null}}},"clinical_trials_database":{"meta":{"notes":{"left":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added.","right":null}},"restrictions":{"codeList":{"left":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"],"right":["NCI Clinical Trials","EU Clinical Trials Register"],"data":{"added":[],"deleted":["Not applicable","Unknown"]}}}},"clinical_trial_number":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: 'The submitted NCI clinical trial number is in incorrect format.'};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: \"The submitted EudraCT clinical trial number is in incorrect format.\"};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: \"The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database.\"};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: \"'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.\"};\n } \n }\n return result;\n })"]}}}},"created":{"age_at_consent_for_treatment":{"changeType":"created","name":"age_at_consent_for_treatment","description":"Indicate the age of donor when consent was given for treatment.","valueType":"integer","meta":{"displayName":"Age At Consent For Treatment"}},"hemotological_toxicity":{"changeType":"created","name":"hemotological_toxicity","description":"Indicate the hemotological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5"]},"meta":{"displayName":"Hemotological Toxicity","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"response_to_treatment_criteria_method":{"changeType":"deleted","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},"hematological_toxicity":{"changeType":"deleted","name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"non-hematological_toxicity":{"changeType":"deleted","name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"chemotherapy":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"dependsOn":{"left":"chemotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"description":{"left":"Name of agent or drug administered to donor as part of the treatment regimen.","right":"Name of agent or drug administered to patient as part of the treatment regimen."},"meta":{"dependsOn":{"left":"chemotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"chemotherapy_dosage_units":{"changeType":"created","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate the total drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"deleted","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"deleted","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"deleted","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"deleted","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"description":{"left":"Name of agent or drug administered to donor as part of the treatment regimen.","right":"Name of agent or drug administered to patient as part of the treatment regimen."},"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"hormone_drug_dosage_units":{"changeType":"created","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"deleted","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"radiation":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"radiation_therapy_fractions":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"radiation_therapy_dosage":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"anatomical_site_irradiated":{"description":{"left":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)","right":"Indicate localization site where radiation therapy was administered."},"restrictions":{"codeList":{"left":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"right":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"data":{"added":["Bone","Extremities","Head-Neck","Peritoneum"],"deleted":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"]}}}}},"created":{},"deleted":{"radiation_boost":{"changeType":"deleted","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"deleted","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}}},"immunotherapy":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"immunotherapy_type":{"changeType":"deleted","name":"immunotherapy_type","valueType":"string","description":"Indicate the type of immunotherapy administered to donor.","meta":{"displayName":"Immunotherapy Type","core":true},"restrictions":{"required":true,"codeList":["Cell-based","Immune checkpoint inhibitors","Monoclonal antibodies other than immune checkpoint inhibitors","Other immunomodulatory substances"]}},"drug_rxnormcui":{"changeType":"deleted","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"deleted","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"deleted","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"surgery":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"deleted","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"deleted","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"deleted","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"deleted","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"deleted","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"deleted","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"deleted","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"deleted","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"deleted","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"deleted","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"deleted","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"deleted","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"deleted","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"deleted","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}}},"follow_up":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_follow_up_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null},"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"treatment.submitter_treatment_id","right":null},"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"weight_at_followup":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"relapse_type":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })"]}}},"relapse_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `'${$name}' cannot be greater than the 'interval_of_followup'.` }\n }\n }\n return result;\n })"]}}},"method_of_progression_status":{"description":{"left":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Reference: caDSR CDE ID 6161031)","right":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Codelist reference: NCI CDE ID: 6161031)"},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })"]}}},"recurrence_t_category":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"recurrence_n_category":{"meta":{"core":{"left":null,"right":true}}},"recurrence_m_category":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"recurrence_stage_group":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.recurrence_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.recurrence_tumour_staging_system && $row.recurrence_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'recurrence_tumour_staging_system' is set to '${\n $row.recurrence_tumour_staging_system\n }', 'recurrence_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"posttherapy_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"posttherapy_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"posttherapy_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"posttherapy_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.posttherapy_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.posttherapy_tumour_staging_system && $row.posttherapy_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'posttherapy_tumour_staging_system' is set to '${\n $row.posttherapy_tumour_staging_system\n }', 'posttherapy_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })"]}}}},"created":{"anatomic_site_progression_or_recurrences":{"changeType":"created","description":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1,C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}}},"deleted":{"anatomic_site_progression_or_recurrence":{"changeType":"deleted","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"exposure":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"deleted","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"deleted","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"deleted","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"deleted","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"deleted","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"deleted","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"deleted","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"deleted","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"deleted","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"deleted","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"deleted","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}}},"family_history":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"family_relative_id":{"changeType":"deleted","description":"Unique identifier of the relative, assigned by the data provider.","name":"family_relative_id","valueType":"string","meta":{"displayName":"Family Relative ID","primaryId":true,"notes":"This field is required to ensure that family members are identified in unique records. Ids can be as simple as an incremented numeral to ensure uniqueness."},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"relative_with_cancer_history":{"changeType":"deleted","description":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","name":"relative_with_cancer_history","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Relative with Cancer History"}},"relationship_type":{"changeType":"deleted","description":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","name":"relationship_type","restrictions":{"codeList":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"]},"valueType":"string","meta":{"displayName":"Relationship Type"}},"gender_of_relative":{"changeType":"deleted","description":"The self-reported gender of related individual.","name":"gender_of_relative","restrictions":{"codeList":["Female","Male","Other","Unknown"]},"valueType":"string","meta":{"displayName":"Gender of Relative"}},"age_of_relative_at_diagnosis":{"changeType":"deleted","description":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","name":"age_of_relative_at_diagnosis","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","displayName":"Age Of Relative At Diagnosis"}},"cancer_type_code_of_relative":{"changeType":"deleted","name":"cancer_type_code_of_relative","valueType":"string","description":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"examples":"C41.1,C16.9,C00.5,D46.9","dependsOn":"family_history.relative_with_cancer_history","displayName":"Cancer Type Code (ICD-10) of Relative"}},"relative_vital_status":{"changeType":"deleted","description":"Relative's last known state of living or deceased.","name":"relative_vital_status","restrictions":{"codeList":["Alive","Deceased","Unknown"]},"valueType":"string","meta":{"displayName":"Vital Status of Relative"}},"cause_of_death_of_relative":{"changeType":"deleted","description":"Indicate the cause of the death of the relative.","name":"cause_of_death_of_relative","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]},"valueType":"string","meta":{"dependsOn":"family_history.relative_vital_status","displayName":"Cause of Death of Relative"}},"relative_survival_time":{"changeType":"deleted","description":"Indicate how long, in days, the relative survived from the time they were diagnosed with cancer.","name":"relative_survival_time","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","units":"days","displayName":"Survival Time Of Relative"}}}},"biomarker":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"deleted","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"deleted","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"deleted","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"deleted","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"deleted","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"deleted","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"deleted","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"deleted","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"deleted","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"deleted","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"deleted","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"deleted","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"deleted","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"deleted","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"deleted","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"deleted","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}}},"comorbidity":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"deleted","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"deleted","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"deleted","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"deleted","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"deleted","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"deleted","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}}}}} diff --git a/scripts/data/schemas/diffs/1.24/1.24-diff-1.20.json b/scripts/data/schemas/diffs/1.24/1.24-diff-1.20.json new file mode 100644 index 00000000..6f6f97a7 --- /dev/null +++ b/scripts/data/schemas/diffs/1.24/1.24-diff-1.20.json @@ -0,0 +1 @@ +{"schemas":{"specimen":{"updated":{"specimen_acquisition_interval":{"restrictions":{"range":{"left":null,"right":{"min":0}}}},"percent_tumour_cells":{"restrictions":{"script":{"left":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"],"right":null}}}},"created":{},"deleted":{}},"treatment":{"updated":{"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":[],"deleted":["End of life care"]}}}},"treatment_start_interval":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}}},"created":{},"deleted":{}},"chemotherapy":{"updated":{"drug_rxnormcui":{"meta":{"dependsOn":{"left":"chemotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"dependsOn":{"left":"chemotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"chemotherapy_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"data":{"added":[],"deleted":["mg"]}}}}},"created":{},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"hormone_therapy":{"updated":{"drug_rxnormcui":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"hormone_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"data":{"added":[],"deleted":["mg"]}}}}},"created":{},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"radiation":{"updated":{},"created":{},"deleted":{"radiation_boost":{"changeType":"deleted","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"deleted","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}}},"immunotherapy":{"updated":{"drug_rxnormcui":{"meta":{"dependsOn":{"left":"immunotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"dependsOn":{"left":"immunotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"},"displayName":{"left":"Chemotherapy Drug Name","right":"Immunotherapy Drug Name"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"immunotherapy_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"data":{"added":[],"deleted":["mg"]}}}}},"created":{},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"follow_up":{"updated":{"interval_of_followup":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"relapse_interval":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}}},"created":{},"deleted":{}},"biomarker":{"updated":{"test_interval":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}}},"created":{},"deleted":{}}}} diff --git a/scripts/data/schemas/diffs/1.24/1.24-diff-1.21.json b/scripts/data/schemas/diffs/1.24/1.24-diff-1.21.json new file mode 100644 index 00000000..e48b5d12 --- /dev/null +++ b/scripts/data/schemas/diffs/1.24/1.24-diff-1.21.json @@ -0,0 +1 @@ +{"schemas":{"specimen":{"updated":{"specimen_acquisition_interval":{"restrictions":{"range":{"left":null,"right":{"min":0}}}}},"created":{},"deleted":{}},"treatment":{"updated":{"treatment_start_interval":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}}},"created":{},"deleted":{}},"chemotherapy":{"updated":{"drug_rxnormcui":{"meta":{"dependsOn":{"left":"chemotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"dependsOn":{"left":"chemotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"chemotherapy_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"data":{"added":[],"deleted":["mg"]}}}}},"created":{},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"hormone_therapy":{"updated":{"drug_rxnormcui":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"hormone_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"data":{"added":[],"deleted":["mg"]}}}}},"created":{},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"radiation":{"updated":{},"created":{},"deleted":{"radiation_boost":{"changeType":"deleted","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"deleted","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}}},"immunotherapy":{"updated":{"drug_rxnormcui":{"meta":{"dependsOn":{"left":"immunotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"dependsOn":{"left":"immunotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"},"displayName":{"left":"Chemotherapy Drug Name","right":"Immunotherapy Drug Name"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"immunotherapy_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"data":{"added":[],"deleted":["mg"]}}}}},"created":{},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"follow_up":{"updated":{"interval_of_followup":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"relapse_interval":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}}},"created":{},"deleted":{}},"biomarker":{"updated":{"test_interval":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}}},"created":{},"deleted":{}}}} diff --git a/scripts/data/schemas/diffs/1.24/1.24-diff-1.22.json b/scripts/data/schemas/diffs/1.24/1.24-diff-1.22.json new file mode 100644 index 00000000..6a2284e9 --- /dev/null +++ b/scripts/data/schemas/diffs/1.24/1.24-diff-1.22.json @@ -0,0 +1 @@ +{"schemas":{"specimen":{"updated":{"specimen_acquisition_interval":{"restrictions":{"range":{"left":null,"right":{"min":0}}}}},"created":{},"deleted":{}},"treatment":{"updated":{"treatment_start_interval":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}}},"created":{},"deleted":{}},"chemotherapy":{"updated":{"drug_rxnormcui":{"meta":{"dependsOn":{"left":"chemotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"dependsOn":{"left":"chemotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"hormone_therapy":{"updated":{"drug_rxnormcui":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"radiation":{"updated":{},"created":{},"deleted":{"radiation_boost":{"changeType":"deleted","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"deleted","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}}},"immunotherapy":{"updated":{"drug_rxnormcui":{"meta":{"dependsOn":{"left":"immunotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"dependsOn":{"left":"immunotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"},"displayName":{"left":"Chemotherapy Drug Name","right":"Immunotherapy Drug Name"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"follow_up":{"updated":{"interval_of_followup":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"relapse_interval":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}}},"created":{},"deleted":{}},"biomarker":{"updated":{"test_interval":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}}},"created":{},"deleted":{}}}} diff --git a/scripts/data/schemas/diffs/1.24/1.24-diff-1.23.json b/scripts/data/schemas/diffs/1.24/1.24-diff-1.23.json new file mode 100644 index 00000000..a94ac2bb --- /dev/null +++ b/scripts/data/schemas/diffs/1.24/1.24-diff-1.23.json @@ -0,0 +1 @@ +{"schemas":{"treatment":{"updated":{"treatment_start_interval":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}}},"created":{},"deleted":{}},"chemotherapy":{"updated":{"drug_rxnormcui":{"meta":{"dependsOn":{"left":"chemotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"dependsOn":{"left":"chemotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"hormone_therapy":{"updated":{"drug_rxnormcui":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"immunotherapy":{"updated":{"drug_rxnormcui":{"meta":{"dependsOn":{"left":"immunotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"dependsOn":{"left":"immunotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"},"displayName":{"left":"Chemotherapy Drug Name","right":"Immunotherapy Drug Name"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"follow_up":{"updated":{"interval_of_followup":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"relapse_interval":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}}},"created":{},"deleted":{}},"biomarker":{"updated":{"test_interval":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}}},"created":{},"deleted":{}}}} diff --git a/scripts/data/schemas/diffs/1.24/1.24-diff-1.3.json b/scripts/data/schemas/diffs/1.24/1.24-diff-1.3.json new file mode 100644 index 00000000..bf3fa9e8 --- /dev/null +++ b/scripts/data/schemas/diffs/1.24/1.24-diff-1.3.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":[],"deleted":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n const row = $row;\n let result = {valid: true, message: \"Ok\"};\n \n const designation = row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\"){\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when tumour_normal_designation is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when tumour_normal_designation is set to Tumour.\"};\n }\n }\n return result;\n })"]}}},"submitter_sample_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased"],"right":["Alive","Deceased","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"cause_of_death":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })"]}}},"survival_time":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })"]},"range":{"left":{"exclusiveMin":0},"right":null}}},"primary_site":{"meta":{"notes":{"left":"To include multiple values, separate values with a pipe delimiter '|' within your file.","right":null},"examples":{"left":"Breast|Ovary","right":null}},"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Not Reported","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva","Unknown"],"data":{"added":["Not Reported","Unknown"],"deleted":["Unknown primary site"]}}}},"height":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"weight":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"bmi":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"menopause_status":{"description":{"left":"Indicate the donor's menopause status at the time of primary diagnosis. (Reference: caDSR CDE ID 2434914)","right":"Indicate the donor's menopause status at the time of primary diagnosis. (Codelist reference: NCI CDE ID: 2434914)"},"restrictions":{"codeList":{"left":["Not applicable","Perimenopausal","Postmenopausal","Premenopausal","Unknown"],"right":["Indeterminate or unknown","Not applicable","Perimenopausal","Postmenopausal","Premenopausal"],"data":{"added":["Indeterminate or unknown"],"deleted":["Unknown"]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)","right":"Indicate the donor's age of menarche, the first occurrence of menstruation."},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"number_of_pregnancies":{"description":{"left":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)","right":"Indicate the number of pregnancies a donor has had."},"restrictions":{"range":{"left":{"min":0},"right":null}}},"number_of_children":{"description":{"left":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)","right":"Indicate the number of children the donor has birthed."},"restrictions":{"range":{"left":{"min":0},"right":null}}}},"created":{"prior_malignancy":{"changeType":"created","description":"Prior malignancy affecting donor.","name":"prior_malignancy","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy","examples":"C41.1, C16.9, C00.5, D46.9"}},"cancer_type_prior_malignancy":{"changeType":"created","description":"The code to represent the cancer type of a prior malignancy using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","name":"cancer_type_prior_malignancy","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"valueType":"string","meta":{"displayName":"Cancer Type Prior Malignancy"}},"age_at_prior_malignancy":{"changeType":"created","description":"If donor has history of prior malignancy, indicate age at previous diagnosis, in years.","name":"age_at_prior_malignancy","valueType":"integer","meta":{"displayName":"Age at Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"created","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Codelist reference: NCI CDE: 4122391)","name":"laterality_of_prior_malignancy","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality at Prior Malignancy"}}},"deleted":{"genetic_disorders":{"changeType":"deleted","description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},"hrt_type":{"changeType":"deleted","description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},"hrt_duration":{"changeType":"deleted","description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},"contraception_type":{"changeType":"deleted","description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},"contraception_duration":{"changeType":"deleted","description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},"lost_to_followup_after_clinical_event_id":{"changeType":"deleted","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}}},"specimen":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null},"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"pathological_tumour_staging_system":{"meta":{"validationDependency":{"left":true,"right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"pathological_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"pathological_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"pathological_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.pathological_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.pathological_tumour_staging_system && $row.pathological_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'pathological_tumour_staging_system' is set to '${\n $row.pathological_tumour_staging_system\n }', 'pathological_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"data":{"added":[],"deleted":["Unknown"]}}}},"specimen_storage":{"description":{"left":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured.","right":"Indicate the method of specimen storage for specimens that were not extracted freshly or immediately cultured."},"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"data":{"added":[],"deleted":["Unknown"]}}}},"reference_pathology_confirmed":{"description":{"left":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)","right":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist."}},"tumour_grading_system":{"meta":{"validationDependency":{"left":true,"right":null}}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = \"'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.\";\n result.message = msg;\n }\n }\n return result;\n })"]}}},"percent_tumour_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)","right":"Indicate a value, in decimals, that represents the percentage of infiltration by tumour cells in a specimen."},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null},"script":{"left":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"],"right":null}}},"percent_proliferating_cells":{"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_inflammatory_tissue":{"description":{"left":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)","right":"Indicate a value, in decimals, that represents local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_stromal_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)","right":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a malignant tumour specimen but are not malignant such as fibroblasts, vascular structures, etc."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_necrosis":{"description":{"left":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)","right":"Indicate a value, in decimals, that represents the percentage of cell death in a malignant tumour specimen."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}}},"created":{},"deleted":{"specimen_laterality":{"changeType":"deleted","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"percent_tumour_cells_measurement_method":{"changeType":"deleted","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"age_at_diagnosis":{"restrictions":{"range":{"left":{"exclusiveMin":0,"max":90},"right":null}}},"number_lymph_nodes_examined":{"description":{"left":"The total number of lymph nodes tested for the presence of cancer. (Reference: caDSR CDE ID 3)","right":"The total number of lymph nodes tested for the presence of cancer. (Reference: NCI CDE ID: 3)"},"meta":{"dependsOn":{"left":"primary_diagnosis.lymph_nodes_examined_status","right":null},"notes":{"left":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":null},"range":{"left":{"min":0},"right":null}}},"number_lymph_nodes_positive":{"description":{"left":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: caDSR CDE ID 6113694)","right":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: NCI CDE ID: 6113694)"},"meta":{"dependsOn":{"left":"primary_diagnosis.lymph_nodes_examined_status","right":null},"notes":{"left":"This field is only required if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":null},"range":{"left":{"min":0},"right":null},"required":{"left":null,"right":true}}},"clinical_tumour_staging_system":{"meta":{"validationDependency":{"left":true,"right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}},"required":{"left":null,"right":true}}},"clinical_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"clinical_n_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null}}},"clinical_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"clinical_stage_group":{"description":{"left":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage.","right":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.)."},"meta":{"examples":{"left":"Stage I, Stage IIB","right":null}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.clinical_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'clinical_tumour_staging_system' is set to '${\n $row.clinical_tumour_staging_system\n }', 'clinical_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })"]},"required":{"left":null,"right":true}}},"performance_status":{"description":{"left":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status).","right":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference source: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status)."},"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"data":{"added":[],"deleted":["Unknown"]}}}}},"created":{},"deleted":{"laterality":{"changeType":"deleted","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_status":{"changeType":"deleted","name":"lymph_nodes_examined_status","description":"Indicate if lymph nodes were examined for metastases.","valueType":"string","restrictions":{"required":true,"codeList":["Cannot be determined","No","No lymph nodes found in resected specimen","Not applicable","Yes"]},"meta":{"core":true,"displayName":"Lymph Nodes Examined Status"}},"lymph_nodes_examined_method":{"changeType":"deleted","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}}},"treatment":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null},"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":[],"deleted":["End of life care"]}}}},"is_primary_treatment":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"codeList":{"left":["Yes","No"],"right":["Yes","No","Unknown"],"data":{"added":["Unknown"],"deleted":[]}},"required":{"left":null,"right":true}}},"line_of_treatment":{"meta":{"dependsOn":{"left":"treatment.is_primary_treatment","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"],"right":null}}},"treatment_start_interval":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"treatment_duration":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null},"required":{"left":null,"right":true}}},"days_per_cycle":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null}}},"number_of_cycles":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null}}},"treatment_intent":{"description":{"left":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","right":"Indicate the intended disease outcome for which the treatment is given. (Reference: CDISC [NCIt code: C124307])"},"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"codeList":{"left":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"],"right":["Curative","Palliative","Unknown"],"data":{"added":["Unknown"],"deleted":["Diagnostic","Forensic","Guidance","Preventative","Screening","Supportive"]}},"required":{"left":null,"right":true}}},"treatment_setting":{"description":{"left":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: NCIt C124308)","right":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: CDISC [NCIt code: C124308])"},"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"codeList":{"left":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"],"right":["Adjuvant","Advanced/Metastatic","Neoadjuvant","Not applicable"],"data":{"added":["Not applicable"],"deleted":["Conditioning","Induction","Maintenance","Mobilization","Preventative","Radiosensitization","Salvage"]}},"required":{"left":null,"right":true}}},"response_to_treatment":{"description":{"left":"The donor's response to the applied treatment regimen.","right":"The donor's response to the applied treatment regimen. (Source: RECIST)"},"meta":{"dependsOn":{"left":"treatment.response_to_treatment_criteria_method","right":null},"notes":{"left":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"right":null},"codeList":{"left":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"],"right":["Complete response","Disease progression","NED","Partial response","Stable disease"],"data":{"added":["Disease progression","NED"],"deleted":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease"]}},"required":{"left":null,"right":true}}},"outcome_of_treatment":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null}}},"toxicity_type":{"description":{"left":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity.","right":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hemotological toxicity or non-hemotological toxicity."},"meta":{"dependsOn":{"left":"treatment.outcome_of_treatment","right":null}},"restrictions":{"codeList":{"left":["Hematological","Non-hematological","Not applicable","Unknown"],"right":["Hemotological","Non-hemotological"],"data":{"added":["Hemotological","Non-hemotological"],"deleted":["Hematological","Non-hematological","Not applicable","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"],"right":null}}},"adverse_events":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"codeList":{"left":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"right":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"data":{"added":[],"deleted":["None","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null}}},"clinical_trials_database":{"meta":{"notes":{"left":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added.","right":null}},"restrictions":{"codeList":{"left":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"],"right":["NCI Clinical Trials","EU Clinical Trials Register"],"data":{"added":[],"deleted":["Not applicable","Unknown"]}}}},"clinical_trial_number":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: 'The submitted NCI clinical trial number is in incorrect format.'};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: \"The submitted EudraCT clinical trial number is in incorrect format.\"};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: \"The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database.\"};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: \"'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.\"};\n } \n }\n return result;\n })"]}}}},"created":{"age_at_consent_for_treatment":{"changeType":"created","name":"age_at_consent_for_treatment","description":"Indicate the age of donor when consent was given for treatment.","valueType":"integer","meta":{"displayName":"Age At Consent For Treatment"}},"hemotological_toxicity":{"changeType":"created","name":"hemotological_toxicity","description":"Indicate the hemotological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5"]},"meta":{"displayName":"Hemotological Toxicity","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"response_to_treatment_criteria_method":{"changeType":"deleted","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},"hematological_toxicity":{"changeType":"deleted","name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"non-hematological_toxicity":{"changeType":"deleted","name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"chemotherapy":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"dependsOn":{"left":"chemotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"description":{"left":"Name of agent or drug administered to donor as part of the treatment regimen.","right":"Name of agent or drug administered to patient as part of the treatment regimen."},"meta":{"dependsOn":{"left":"chemotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"chemotherapy_dosage_units":{"changeType":"created","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate the total actual drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"deleted","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"deleted","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"deleted","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"deleted","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"description":{"left":"Name of agent or drug administered to donor as part of the treatment regimen.","right":"Name of agent or drug administered to patient as part of the treatment regimen."},"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"hormone_drug_dosage_units":{"changeType":"created","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"deleted","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"radiation":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"radiation_therapy_fractions":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"radiation_therapy_dosage":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"anatomical_site_irradiated":{"description":{"left":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)","right":"Indicate localization site where radiation therapy was administered."},"restrictions":{"codeList":{"left":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"right":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"data":{"added":["Bone","Extremities","Head-Neck","Peritoneum"],"deleted":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"]}}}}},"created":{},"deleted":{"radiation_boost":{"changeType":"deleted","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"deleted","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}}},"immunotherapy":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"immunotherapy_type":{"changeType":"deleted","name":"immunotherapy_type","valueType":"string","description":"Indicate the type of immunotherapy administered to donor.","meta":{"displayName":"Immunotherapy Type","core":true},"restrictions":{"required":true,"codeList":["Cell-based","Immune checkpoint inhibitors","Monoclonal antibodies other than immune checkpoint inhibitors","Other immunomodulatory substances"]}},"drug_rxnormcui":{"changeType":"deleted","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"deleted","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"deleted","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"surgery":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"deleted","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"deleted","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"deleted","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"deleted","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"deleted","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"deleted","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"deleted","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"deleted","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"deleted","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"deleted","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"deleted","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"deleted","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"deleted","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"deleted","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}}},"follow_up":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_follow_up_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null},"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"treatment.submitter_treatment_id","right":null},"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"weight_at_followup":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"relapse_type":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })"]}}},"relapse_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `'${$name}' cannot be greater than the 'interval_of_followup'.` }\n }\n }\n return result;\n })"]}}},"method_of_progression_status":{"description":{"left":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Reference: caDSR CDE ID 6161031)","right":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Codelist reference: NCI CDE ID: 6161031)"},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })"]}}},"recurrence_t_category":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"recurrence_n_category":{"meta":{"core":{"left":null,"right":true}}},"recurrence_m_category":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"recurrence_stage_group":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.recurrence_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.recurrence_tumour_staging_system && $row.recurrence_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'recurrence_tumour_staging_system' is set to '${\n $row.recurrence_tumour_staging_system\n }', 'recurrence_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"posttherapy_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"posttherapy_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"posttherapy_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"posttherapy_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.posttherapy_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.posttherapy_tumour_staging_system && $row.posttherapy_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'posttherapy_tumour_staging_system' is set to '${\n $row.posttherapy_tumour_staging_system\n }', 'posttherapy_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })"]}}}},"created":{"anatomic_site_progression_or_recurrences":{"changeType":"created","description":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1,C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}}},"deleted":{"anatomic_site_progression_or_recurrence":{"changeType":"deleted","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"exposure":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"deleted","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"deleted","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"deleted","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"deleted","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"deleted","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"deleted","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"deleted","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"deleted","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"deleted","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"deleted","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"deleted","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}}},"family_history":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"family_relative_id":{"changeType":"deleted","description":"Unique identifier of the relative, assigned by the data provider.","name":"family_relative_id","valueType":"string","meta":{"displayName":"Family Relative ID","primaryId":true,"notes":"This field is required to ensure that family members are identified in unique records. Ids can be as simple as an incremented numeral to ensure uniqueness."},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"relative_with_cancer_history":{"changeType":"deleted","description":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","name":"relative_with_cancer_history","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Relative with Cancer History"}},"relationship_type":{"changeType":"deleted","description":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","name":"relationship_type","restrictions":{"codeList":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"]},"valueType":"string","meta":{"displayName":"Relationship Type"}},"gender_of_relative":{"changeType":"deleted","description":"The self-reported gender of related individual.","name":"gender_of_relative","restrictions":{"codeList":["Female","Male","Other","Unknown"]},"valueType":"string","meta":{"displayName":"Gender of Relative"}},"age_of_relative_at_diagnosis":{"changeType":"deleted","description":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","name":"age_of_relative_at_diagnosis","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","displayName":"Age Of Relative At Diagnosis"}},"cancer_type_code_of_relative":{"changeType":"deleted","name":"cancer_type_code_of_relative","valueType":"string","description":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"examples":"C41.1,C16.9,C00.5,D46.9","dependsOn":"family_history.relative_with_cancer_history","displayName":"Cancer Type Code (ICD-10) of Relative"}},"relative_vital_status":{"changeType":"deleted","description":"Relative's last known state of living or deceased.","name":"relative_vital_status","restrictions":{"codeList":["Alive","Deceased","Unknown"]},"valueType":"string","meta":{"displayName":"Vital Status of Relative"}},"cause_of_death_of_relative":{"changeType":"deleted","description":"Indicate the cause of the death of the relative.","name":"cause_of_death_of_relative","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]},"valueType":"string","meta":{"dependsOn":"family_history.relative_vital_status","displayName":"Cause of Death of Relative"}},"relative_survival_time":{"changeType":"deleted","description":"Indicate how long, in days, the relative survived from the time they were diagnosed with cancer.","name":"relative_survival_time","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","units":"days","displayName":"Survival Time Of Relative"}}}},"biomarker":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"deleted","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"deleted","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"deleted","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"deleted","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"deleted","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"deleted","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"deleted","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"deleted","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"deleted","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"deleted","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"deleted","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"deleted","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"deleted","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"deleted","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"deleted","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"deleted","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}}},"comorbidity":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"deleted","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"deleted","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"deleted","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"deleted","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"deleted","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"deleted","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}}}}} diff --git a/scripts/data/schemas/diffs/1.24/1.24-diff-1.4.json b/scripts/data/schemas/diffs/1.24/1.24-diff-1.4.json new file mode 100644 index 00000000..a3038130 --- /dev/null +++ b/scripts/data/schemas/diffs/1.24/1.24-diff-1.4.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":[],"deleted":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n const row = $row;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n const designation = row.tumour_normal_designation.trim().toLowerCase();\r\n const specimen_type = $field.trim().toLowerCase();\r\n \r\n if (designation === \"normal\"){\r\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\r\n if (!validTypes.includes(specimen_type)){\r\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when tumour_normal_designation is set to Normal.\"};\r\n }\r\n }\r\n else if (designation === \"tumour\") {\r\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\r\n if (invalidTypes.includes(specimen_type)){\r\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when tumour_normal_designation is set to Tumour.\"};\r\n }\r\n }\r\n return result;\r\n })"]}}},"submitter_sample_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased"],"right":["Alive","Deceased","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"cause_of_death":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n const vitalStatus = $row.vital_status.trim().toLowerCase();\r\n \r\n if (!currField && vitalStatus === \"deceased\"){\r\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\r\n }\r\n else if (currField && vitalStatus != \"deceased\"){\r\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\r\n }\r\n return result;\r\n })"]}}},"survival_time":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n const vitalStatus = $row.vital_status.trim().toLowerCase();\r\n \r\n if (!currField && vitalStatus === \"deceased\"){\r\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\r\n }\r\n else if (currField && vitalStatus != \"deceased\"){\r\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\r\n }\r\n return result;\r\n })"]},"range":{"left":{"exclusiveMin":0},"right":null}}},"primary_site":{"meta":{"notes":{"left":"To include multiple values, separate values with a pipe delimiter '|' within your file.","right":null},"examples":{"left":"Breast|Ovary","right":null}},"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Not Reported","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva","Unknown"],"data":{"added":["Not Reported","Unknown"],"deleted":["Unknown primary site"]}}}},"height":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"weight":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"bmi":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"menopause_status":{"description":{"left":"Indicate the donor's menopause status at the time of primary diagnosis. (Reference: caDSR CDE ID 2434914)","right":"Indicate the donor's menopause status at the time of primary diagnosis. (Codelist reference: NCI CDE ID: 2434914)"},"restrictions":{"codeList":{"left":["Not applicable","Perimenopausal","Postmenopausal","Premenopausal","Unknown"],"right":["Indeterminate or unknown","Not applicable","Perimenopausal","Postmenopausal","Premenopausal"],"data":{"added":["Indeterminate or unknown"],"deleted":["Unknown"]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)","right":"Indicate the donor's age of menarche, the first occurrence of menstruation."},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"number_of_pregnancies":{"description":{"left":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)","right":"Indicate the number of pregnancies a donor has had."},"restrictions":{"range":{"left":{"min":0},"right":null}}},"number_of_children":{"description":{"left":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)","right":"Indicate the number of children the donor has birthed."},"restrictions":{"range":{"left":{"min":0},"right":null}}}},"created":{"prior_malignancy":{"changeType":"created","description":"Prior malignancy affecting donor.","name":"prior_malignancy","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy","examples":"C41.1, C16.9, C00.5, D46.9"}},"cancer_type_prior_malignancy":{"changeType":"created","description":"The code to represent the cancer type of a prior malignancy using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","name":"cancer_type_prior_malignancy","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"valueType":"string","meta":{"displayName":"Cancer Type Prior Malignancy"}},"age_at_prior_malignancy":{"changeType":"created","description":"If donor has history of prior malignancy, indicate age at previous diagnosis, in years.","name":"age_at_prior_malignancy","valueType":"integer","meta":{"displayName":"Age at Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"created","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Codelist reference: NCI CDE: 4122391)","name":"laterality_of_prior_malignancy","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality at Prior Malignancy"}}},"deleted":{"genetic_disorders":{"changeType":"deleted","description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},"hrt_type":{"changeType":"deleted","description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},"hrt_duration":{"changeType":"deleted","description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},"contraception_type":{"changeType":"deleted","description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},"contraception_duration":{"changeType":"deleted","description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},"lost_to_followup_after_clinical_event_id":{"changeType":"deleted","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}}},"specimen":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null},"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"pathological_tumour_staging_system":{"meta":{"validationDependency":{"left":true,"right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n /* This is not a required field, so first ensure that it exists */\r\n if ($field) {\r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"pathological_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"pathological_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"pathological_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.pathological_tumour_staging_system && $field) {\r\n let codeList = [];\r\n switch ($row.pathological_tumour_staging_system && $row.pathological_tumour_staging_system.trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb',\r\n 'stage ive',\r\n 'stage ivs'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When 'pathological_tumour_staging_system' is set to '${\r\n $row.pathological_tumour_staging_system\r\n }', 'pathological_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })"]}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"data":{"added":[],"deleted":["Unknown"]}}}},"specimen_storage":{"description":{"left":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured.","right":"Indicate the method of specimen storage for specimens that were not extracted freshly or immediately cultured."},"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"data":{"added":[],"deleted":["Unknown"]}}}},"reference_pathology_confirmed":{"description":{"left":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)","right":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist."}},"tumour_grading_system":{"meta":{"validationDependency":{"left":true,"right":null}}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.tumour_grading_system && $field) {\r\n let codeList = [];\r\n const tieredGradingList = ['gx','g1','g2','g3'];\r\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\r\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\r\n case 'two-tier grading system':\r\n codeList = [\r\n 'low grade',\r\n 'high grade',\r\n ];\r\n break;\r\n case 'three-tier grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'four-tier grading system':\r\n codeList = [\r\n 'gx',\r\n 'g1',\r\n 'g2',\r\n 'g3',\r\n 'g4',\r\n ];\r\n break;\r\n case 'grading system for gists':\r\n codeList = [\r\n 'low',\r\n 'high',\r\n ];\r\n break;\r\n case 'grading system for gnets':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'isup grading system':\r\n codeList = [\r\n 'gx',\r\n 'g1',\r\n 'g2',\r\n 'g3',\r\n 'g4',\r\n ];\r\n break;\r\n case 'who grading system for cns tumours':\r\n codeList = [\r\n 'grade i',\r\n 'grade ii',\r\n 'grade iii',\r\n 'grade iv',\r\n ];\r\n break;\r\n case 'fnclcc grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'gleason grade group system':\r\n codeList = [\r\n 'grade group 1',\r\n 'grade group 2',\r\n 'grade group 3',\r\n 'grade group 4',\r\n 'grade group 5',\r\n ];\r\n break;\r\n case 'scarff-bloom-richardson grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'nuclear grading system for dcis':\r\n codeList = tieredGradingList;\r\n break;\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase())) {\r\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\r\n $row.tumour_grading_system\r\n }', 'tumour_grade' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\r\n result.valid = false;\r\n const msg = \"'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.\";\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })"]}}},"percent_tumour_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)","right":"Indicate a value, in decimals, that represents the percentage of infiltration by tumour cells in a specimen."},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null},"script":{"left":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"],"right":null}}},"percent_proliferating_cells":{"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_inflammatory_tissue":{"description":{"left":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)","right":"Indicate a value, in decimals, that represents local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_stromal_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)","right":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a malignant tumour specimen but are not malignant such as fibroblasts, vascular structures, etc."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_necrosis":{"description":{"left":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)","right":"Indicate a value, in decimals, that represents the percentage of cell death in a malignant tumour specimen."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}}},"created":{},"deleted":{"specimen_laterality":{"changeType":"deleted","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"percent_tumour_cells_measurement_method":{"changeType":"deleted","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"age_at_diagnosis":{"restrictions":{"range":{"left":{"exclusiveMin":0,"max":90},"right":null}}},"number_lymph_nodes_examined":{"description":{"left":"The total number of lymph nodes tested for the presence of cancer. (Reference: caDSR CDE ID 3)","right":"The total number of lymph nodes tested for the presence of cancer. (Reference: NCI CDE ID: 3)"},"meta":{"dependsOn":{"left":"primary_diagnosis.lymph_nodes_examined_status","right":null},"notes":{"left":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":null},"range":{"left":{"min":0},"right":null}}},"number_lymph_nodes_positive":{"description":{"left":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: caDSR CDE ID 6113694)","right":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: NCI CDE ID: 6113694)"},"meta":{"dependsOn":{"left":"primary_diagnosis.lymph_nodes_examined_status","right":null},"notes":{"left":"This field is only required if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":null},"range":{"left":{"min":0},"right":null},"required":{"left":null,"right":true}}},"clinical_tumour_staging_system":{"meta":{"validationDependency":{"left":true,"right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n /* This is not a required field, so first ensure that it exists */\r\n if ($field) {\r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}},"required":{"left":null,"right":true}}},"clinical_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"clinical_n_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null}}},"clinical_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"clinical_stage_group":{"description":{"left":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage.","right":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.)."},"meta":{"examples":{"left":"Stage I, Stage IIB","right":null}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.clinical_tumour_staging_system && $field) {\r\n let codeList = [];\r\n switch ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system.trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb',\r\n 'stage ive',\r\n 'stage ivs'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When 'clinical_tumour_staging_system' is set to '${\r\n $row.clinical_tumour_staging_system\r\n }', 'clinical_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })"]},"required":{"left":null,"right":true}}},"performance_status":{"description":{"left":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status).","right":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference source: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status)."},"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"data":{"added":[],"deleted":["Unknown"]}}}}},"created":{},"deleted":{"laterality":{"changeType":"deleted","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_status":{"changeType":"deleted","name":"lymph_nodes_examined_status","description":"Indicate if lymph nodes were examined for metastases.","valueType":"string","restrictions":{"required":true,"codeList":["Cannot be determined","No","No lymph nodes found in resected specimen","Not applicable","Yes"]},"meta":{"core":true,"displayName":"Lymph Nodes Examined Status"}},"lymph_nodes_examined_method":{"changeType":"deleted","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}}},"treatment":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null},"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":[],"deleted":["End of life care"]}}}},"is_primary_treatment":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"codeList":{"left":["Yes","No"],"right":["Yes","No","Unknown"],"data":{"added":["Unknown"],"deleted":[]}},"required":{"left":null,"right":true}}},"line_of_treatment":{"meta":{"dependsOn":{"left":"treatment.is_primary_treatment","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"],"right":null}}},"treatment_start_interval":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"treatment_duration":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null},"required":{"left":null,"right":true}}},"days_per_cycle":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null}}},"number_of_cycles":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null}}},"treatment_intent":{"description":{"left":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","right":"Indicate the intended disease outcome for which the treatment is given. (Reference: CDISC [NCIt code: C124307])"},"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"codeList":{"left":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"],"right":["Curative","Palliative","Unknown"],"data":{"added":["Unknown"],"deleted":["Diagnostic","Forensic","Guidance","Preventative","Screening","Supportive"]}},"required":{"left":null,"right":true}}},"treatment_setting":{"description":{"left":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: NCIt C124308)","right":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: CDISC [NCIt code: C124308])"},"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"codeList":{"left":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"],"right":["Adjuvant","Advanced/Metastatic","Neoadjuvant","Not applicable"],"data":{"added":["Not applicable"],"deleted":["Conditioning","Induction","Maintenance","Mobilization","Preventative","Radiosensitization","Salvage"]}},"required":{"left":null,"right":true}}},"response_to_treatment":{"description":{"left":"The donor's response to the applied treatment regimen.","right":"The donor's response to the applied treatment regimen. (Source: RECIST)"},"meta":{"dependsOn":{"left":"treatment.response_to_treatment_criteria_method","right":null},"notes":{"left":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"right":null},"codeList":{"left":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"],"right":["Complete response","Disease progression","NED","Partial response","Stable disease"],"data":{"added":["Disease progression","NED"],"deleted":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease"]}},"required":{"left":null,"right":true}}},"outcome_of_treatment":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null}}},"toxicity_type":{"description":{"left":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity.","right":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hemotological toxicity or non-hemotological toxicity."},"meta":{"dependsOn":{"left":"treatment.outcome_of_treatment","right":null}},"restrictions":{"codeList":{"left":["Hematological","Non-hematological","Not applicable","Unknown"],"right":["Hemotological","Non-hemotological"],"data":{"added":["Hemotological","Non-hemotological"],"deleted":["Hematological","Non-hematological","Not applicable","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"],"right":null}}},"adverse_events":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"codeList":{"left":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"right":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"data":{"added":[],"deleted":["None","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null}}},"clinical_trials_database":{"meta":{"notes":{"left":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added.","right":null}},"restrictions":{"codeList":{"left":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"],"right":["NCI Clinical Trials","EU Clinical Trials Register"],"data":{"added":[],"deleted":["Not applicable","Unknown"]}}}},"clinical_trial_number":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n //regex check for clinical trial number\r\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\r\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\r\n\r\n // list of valid clinical trial databases\r\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\r\n \r\n if ($row.clinical_trials_database && $field) {\r\n const trialNumber = $field.trim();\r\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\r\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\r\n result = {valid: false, message: 'The submitted NCI clinical trial number is in incorrect format.'};\r\n }\r\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\r\n result = {valid: false, message: \"The submitted EudraCT clinical trial number is in incorrect format.\"};\r\n }\r\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\r\n result = {valid: false, message: \"The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database.\"};\r\n }\r\n }\r\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\r\n result = {valid: true, message: \"Ok\"};\r\n }\r\n else if ($row.clinical_trials_database && !$field) {\r\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\r\n result = {valid: false, message: \"'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.\"};\r\n } \r\n }\r\n return result;\r\n })"]}}}},"created":{"age_at_consent_for_treatment":{"changeType":"created","name":"age_at_consent_for_treatment","description":"Indicate the age of donor when consent was given for treatment.","valueType":"integer","meta":{"displayName":"Age At Consent For Treatment"}},"hemotological_toxicity":{"changeType":"created","name":"hemotological_toxicity","description":"Indicate the hemotological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5"]},"meta":{"displayName":"Hemotological Toxicity","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"response_to_treatment_criteria_method":{"changeType":"deleted","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},"hematological_toxicity":{"changeType":"deleted","name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"non-hematological_toxicity":{"changeType":"deleted","name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"chemotherapy":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"dependsOn":{"left":"chemotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"description":{"left":"Name of agent or drug administered to donor as part of the treatment regimen.","right":"Name of agent or drug administered to patient as part of the treatment regimen."},"meta":{"dependsOn":{"left":"chemotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"chemotherapy_dosage_units":{"changeType":"created","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate the total actual drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"deleted","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"deleted","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"deleted","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"deleted","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"description":{"left":"Name of agent or drug administered to donor as part of the treatment regimen.","right":"Name of agent or drug administered to patient as part of the treatment regimen."},"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"hormone_drug_dosage_units":{"changeType":"created","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"deleted","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"radiation":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"radiation_therapy_fractions":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"radiation_therapy_dosage":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"anatomical_site_irradiated":{"description":{"left":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)","right":"Indicate localization site where radiation therapy was administered."},"restrictions":{"codeList":{"left":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"right":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"data":{"added":["Bone","Extremities","Head-Neck","Peritoneum"],"deleted":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"]}}}}},"created":{},"deleted":{"radiation_boost":{"changeType":"deleted","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"deleted","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}}},"immunotherapy":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"immunotherapy_type":{"changeType":"deleted","name":"immunotherapy_type","valueType":"string","description":"Indicate the type of immunotherapy administered to donor.","meta":{"displayName":"Immunotherapy Type","core":true},"restrictions":{"required":true,"codeList":["Cell-based","Immune checkpoint inhibitors","Monoclonal antibodies other than immune checkpoint inhibitors","Other immunomodulatory substances"]}},"drug_rxnormcui":{"changeType":"deleted","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"deleted","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"deleted","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"surgery":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"deleted","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"deleted","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"deleted","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"deleted","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"deleted","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"deleted","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"deleted","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"deleted","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"deleted","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"deleted","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"deleted","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"deleted","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"deleted","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"deleted","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}}},"follow_up":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_follow_up_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null},"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"treatment.submitter_treatment_id","right":null},"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"weight_at_followup":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"relapse_type":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })"]}}},"relapse_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const intervalOfFollowup = parseInt($row.interval_of_followup);\r\n\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n relapseInterval = parseInt($field);\r\n if (relapseInterval > intervalOfFollowup) {\r\n result = {valid: false, message: `'${$name}' cannot be greater than the 'interval_of_followup'.` }\r\n }\r\n }\r\n return result;\r\n })"]}}},"method_of_progression_status":{"description":{"left":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Reference: caDSR CDE ID 6161031)","right":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Codelist reference: NCI CDE ID: 6161031)"},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n /* This is not a required field, so first ensure that it exists */\r\n if ($field) {\r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })","(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })"]}}},"recurrence_t_category":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"recurrence_n_category":{"meta":{"core":{"left":null,"right":true}}},"recurrence_m_category":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"recurrence_stage_group":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.recurrence_tumour_staging_system && $field) {\r\n let codeList = [];\r\n switch ($row.recurrence_tumour_staging_system && $row.recurrence_tumour_staging_system.trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb',\r\n 'stage ive',\r\n 'stage ivs'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When 'recurrence_tumour_staging_system' is set to '${\r\n $row.recurrence_tumour_staging_system\r\n }', 'recurrence_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })"]}}},"posttherapy_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n /* This is not a required field, so first ensure that it exists */\r\n if ($field) {\r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"posttherapy_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"posttherapy_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"posttherapy_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.posttherapy_tumour_staging_system && $field) {\r\n let codeList = [];\r\n switch ($row.posttherapy_tumour_staging_system && $row.posttherapy_tumour_staging_system.trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb',\r\n 'stage ive',\r\n 'stage ivs'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When 'posttherapy_tumour_staging_system' is set to '${\r\n $row.posttherapy_tumour_staging_system\r\n }', 'posttherapy_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })"]}}}},"created":{"anatomic_site_progression_or_recurrences":{"changeType":"created","description":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1,C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}}},"deleted":{"anatomic_site_progression_or_recurrence":{"changeType":"deleted","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"exposure":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"deleted","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"deleted","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"deleted","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"deleted","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"deleted","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"deleted","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"deleted","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"deleted","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"deleted","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"deleted","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"deleted","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}}},"family_history":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"family_relative_id":{"changeType":"deleted","description":"Unique identifier of the relative, assigned by the data provider.","name":"family_relative_id","valueType":"string","meta":{"displayName":"Family Relative ID","primaryId":true,"notes":"This field is required to ensure that family members are identified in unique records. Ids can be as simple as an incremented numeral to ensure uniqueness."},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"relative_with_cancer_history":{"changeType":"deleted","description":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","name":"relative_with_cancer_history","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Relative with Cancer History"}},"relationship_type":{"changeType":"deleted","description":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","name":"relationship_type","restrictions":{"codeList":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"]},"valueType":"string","meta":{"displayName":"Relationship Type"}},"gender_of_relative":{"changeType":"deleted","description":"The self-reported gender of related individual.","name":"gender_of_relative","restrictions":{"codeList":["Female","Male","Other","Unknown"]},"valueType":"string","meta":{"displayName":"Gender of Relative"}},"age_of_relative_at_diagnosis":{"changeType":"deleted","description":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","name":"age_of_relative_at_diagnosis","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","displayName":"Age Of Relative At Diagnosis"}},"cancer_type_code_of_relative":{"changeType":"deleted","name":"cancer_type_code_of_relative","valueType":"string","description":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"examples":"C41.1,C16.9,C00.5,D46.9","dependsOn":"family_history.relative_with_cancer_history","displayName":"Cancer Type Code (ICD-10) of Relative"}},"relative_vital_status":{"changeType":"deleted","description":"Relative's last known state of living or deceased.","name":"relative_vital_status","restrictions":{"codeList":["Alive","Deceased","Unknown"]},"valueType":"string","meta":{"displayName":"Vital Status of Relative"}},"cause_of_death_of_relative":{"changeType":"deleted","description":"Indicate the cause of the death of the relative.","name":"cause_of_death_of_relative","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]},"valueType":"string","meta":{"dependsOn":"family_history.relative_vital_status","displayName":"Cause of Death of Relative"}},"relative_survival_time":{"changeType":"deleted","description":"Indicate how long, in days, the relative survived from the time they were diagnosed with cancer.","name":"relative_survival_time","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","units":"days","displayName":"Survival Time Of Relative"}}}},"biomarker":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"deleted","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"deleted","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"deleted","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"deleted","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"deleted","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"deleted","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"deleted","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"deleted","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"deleted","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"deleted","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"deleted","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"deleted","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"deleted","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"deleted","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"deleted","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"deleted","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}}},"comorbidity":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"deleted","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"deleted","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"deleted","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"deleted","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"deleted","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"deleted","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}}}}} diff --git a/scripts/data/schemas/diffs/1.24/1.24-diff-1.5.json b/scripts/data/schemas/diffs/1.24/1.24-diff-1.5.json new file mode 100644 index 00000000..9487a234 --- /dev/null +++ b/scripts/data/schemas/diffs/1.24/1.24-diff-1.5.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":[],"deleted":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n const row = $row;\n let result = {valid: true, message: \"Ok\"};\n \n const designation = row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\"){\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when tumour_normal_designation is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when tumour_normal_designation is set to Tumour.\"};\n }\n }\n return result;\n })"]}}},"submitter_sample_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased"],"right":["Alive","Deceased","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"cause_of_death":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })"]}}},"survival_time":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })"]},"range":{"left":{"exclusiveMin":0},"right":null}}},"primary_site":{"meta":{"notes":{"left":"To include multiple values, separate values with a pipe delimiter '|' within your file.","right":null},"examples":{"left":"Breast|Ovary","right":null}},"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Not Reported","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva","Unknown"],"data":{"added":["Not Reported","Unknown"],"deleted":["Unknown primary site"]}}}},"height":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"weight":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"bmi":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"menopause_status":{"description":{"left":"Indicate the donor's menopause status at the time of primary diagnosis. (Reference: caDSR CDE ID 2434914)","right":"Indicate the donor's menopause status at the time of primary diagnosis. (Codelist reference: NCI CDE ID: 2434914)"},"restrictions":{"codeList":{"left":["Not applicable","Perimenopausal","Postmenopausal","Premenopausal","Unknown"],"right":["Indeterminate or unknown","Not applicable","Perimenopausal","Postmenopausal","Premenopausal"],"data":{"added":["Indeterminate or unknown"],"deleted":["Unknown"]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)","right":"Indicate the donor's age of menarche, the first occurrence of menstruation."},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"number_of_pregnancies":{"description":{"left":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)","right":"Indicate the number of pregnancies a donor has had."},"restrictions":{"range":{"left":{"min":0},"right":null}}},"number_of_children":{"description":{"left":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)","right":"Indicate the number of children the donor has birthed."},"restrictions":{"range":{"left":{"min":0},"right":null}}}},"created":{"prior_malignancy":{"changeType":"created","description":"Prior malignancy affecting donor.","name":"prior_malignancy","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy","examples":"C41.1, C16.9, C00.5, D46.9"}},"cancer_type_prior_malignancy":{"changeType":"created","description":"The code to represent the cancer type of a prior malignancy using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","name":"cancer_type_prior_malignancy","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"valueType":"string","meta":{"displayName":"Cancer Type Prior Malignancy"}},"age_at_prior_malignancy":{"changeType":"created","description":"If donor has history of prior malignancy, indicate age at previous diagnosis, in years.","name":"age_at_prior_malignancy","valueType":"integer","meta":{"displayName":"Age at Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"created","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Codelist reference: NCI CDE: 4122391)","name":"laterality_of_prior_malignancy","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality at Prior Malignancy"}}},"deleted":{"genetic_disorders":{"changeType":"deleted","description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},"hrt_type":{"changeType":"deleted","description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},"hrt_duration":{"changeType":"deleted","description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},"contraception_type":{"changeType":"deleted","description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},"contraception_duration":{"changeType":"deleted","description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},"lost_to_followup_after_clinical_event_id":{"changeType":"deleted","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}}},"specimen":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"pathological_tumour_staging_system":{"meta":{"validationDependency":{"left":true,"right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"pathological_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"pathological_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"pathological_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.pathological_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.pathological_tumour_staging_system && $row.pathological_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'pathological_tumour_staging_system' is set to '${\n $row.pathological_tumour_staging_system\n }', 'pathological_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"data":{"added":[],"deleted":["Unknown"]}}}},"specimen_storage":{"description":{"left":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured.","right":"Indicate the method of specimen storage for specimens that were not extracted freshly or immediately cultured."},"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"data":{"added":[],"deleted":["Unknown"]}}}},"reference_pathology_confirmed":{"description":{"left":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)","right":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist."}},"tumour_grading_system":{"meta":{"validationDependency":{"left":true,"right":null}}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = \"'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.\";\n result.message = msg;\n }\n }\n return result;\n })"]}}},"percent_tumour_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)","right":"Indicate a value, in decimals, that represents the percentage of infiltration by tumour cells in a specimen."},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null},"script":{"left":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"],"right":null}}},"percent_proliferating_cells":{"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_inflammatory_tissue":{"description":{"left":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)","right":"Indicate a value, in decimals, that represents local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_stromal_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)","right":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a malignant tumour specimen but are not malignant such as fibroblasts, vascular structures, etc."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_necrosis":{"description":{"left":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)","right":"Indicate a value, in decimals, that represents the percentage of cell death in a malignant tumour specimen."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}}},"created":{},"deleted":{"specimen_laterality":{"changeType":"deleted","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"percent_tumour_cells_measurement_method":{"changeType":"deleted","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"age_at_diagnosis":{"restrictions":{"range":{"left":{"exclusiveMin":0,"max":90},"right":null}}},"number_lymph_nodes_examined":{"description":{"left":"The total number of lymph nodes tested for the presence of cancer. (Reference: caDSR CDE ID 3)","right":"The total number of lymph nodes tested for the presence of cancer. (Reference: NCI CDE ID: 3)"},"meta":{"dependsOn":{"left":"primary_diagnosis.lymph_nodes_examined_status","right":null},"notes":{"left":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":null},"range":{"left":{"min":0},"right":null}}},"number_lymph_nodes_positive":{"description":{"left":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: caDSR CDE ID 6113694)","right":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: NCI CDE ID: 6113694)"},"meta":{"dependsOn":{"left":"primary_diagnosis.lymph_nodes_examined_status","right":null},"notes":{"left":"This field is only required if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":null},"range":{"left":{"min":0},"right":null},"required":{"left":null,"right":true}}},"clinical_tumour_staging_system":{"meta":{"validationDependency":{"left":true,"right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}},"required":{"left":null,"right":true}}},"clinical_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"clinical_n_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null}}},"clinical_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"clinical_stage_group":{"description":{"left":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage.","right":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.)."},"meta":{"examples":{"left":"Stage I, Stage IIB","right":null}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.clinical_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'clinical_tumour_staging_system' is set to '${\n $row.clinical_tumour_staging_system\n }', 'clinical_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })"]},"required":{"left":null,"right":true}}},"performance_status":{"description":{"left":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status).","right":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference source: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status)."},"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"data":{"added":[],"deleted":["Unknown"]}}}}},"created":{},"deleted":{"laterality":{"changeType":"deleted","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_status":{"changeType":"deleted","name":"lymph_nodes_examined_status","description":"Indicate if lymph nodes were examined for metastases.","valueType":"string","restrictions":{"required":true,"codeList":["Cannot be determined","No","No lymph nodes found in resected specimen","Not applicable","Yes"]},"meta":{"core":true,"displayName":"Lymph Nodes Examined Status"}},"lymph_nodes_examined_method":{"changeType":"deleted","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}}},"treatment":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":[],"deleted":["End of life care"]}}}},"is_primary_treatment":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"codeList":{"left":["Yes","No"],"right":["Yes","No","Unknown"],"data":{"added":["Unknown"],"deleted":[]}},"required":{"left":null,"right":true}}},"line_of_treatment":{"meta":{"dependsOn":{"left":"treatment.is_primary_treatment","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"],"right":null}}},"treatment_start_interval":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"treatment_duration":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null},"required":{"left":null,"right":true}}},"days_per_cycle":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null}}},"number_of_cycles":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null}}},"treatment_intent":{"description":{"left":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","right":"Indicate the intended disease outcome for which the treatment is given. (Reference: CDISC [NCIt code: C124307])"},"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"codeList":{"left":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"],"right":["Curative","Palliative","Unknown"],"data":{"added":["Unknown"],"deleted":["Diagnostic","Forensic","Guidance","Preventative","Screening","Supportive"]}},"required":{"left":null,"right":true}}},"treatment_setting":{"description":{"left":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: NCIt C124308)","right":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: CDISC [NCIt code: C124308])"},"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"codeList":{"left":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"],"right":["Adjuvant","Advanced/Metastatic","Neoadjuvant","Not applicable"],"data":{"added":["Not applicable"],"deleted":["Conditioning","Induction","Maintenance","Mobilization","Preventative","Radiosensitization","Salvage"]}},"required":{"left":null,"right":true}}},"response_to_treatment":{"description":{"left":"The donor's response to the applied treatment regimen.","right":"The donor's response to the applied treatment regimen. (Source: RECIST)"},"meta":{"dependsOn":{"left":"treatment.response_to_treatment_criteria_method","right":null},"notes":{"left":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"right":null},"codeList":{"left":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"],"right":["Complete response","Disease progression","NED","Partial response","Stable disease"],"data":{"added":["Disease progression","NED"],"deleted":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease"]}},"required":{"left":null,"right":true}}},"outcome_of_treatment":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null}}},"toxicity_type":{"description":{"left":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity.","right":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hemotological toxicity or non-hemotological toxicity."},"meta":{"dependsOn":{"left":"treatment.outcome_of_treatment","right":null}},"restrictions":{"codeList":{"left":["Hematological","Non-hematological","Not applicable","Unknown"],"right":["Hemotological","Non-hemotological"],"data":{"added":["Hemotological","Non-hemotological"],"deleted":["Hematological","Non-hematological","Not applicable","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"],"right":null}}},"adverse_events":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"codeList":{"left":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"right":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"data":{"added":[],"deleted":["None","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null}}},"clinical_trials_database":{"meta":{"notes":{"left":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added.","right":null}},"restrictions":{"codeList":{"left":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"],"right":["NCI Clinical Trials","EU Clinical Trials Register"],"data":{"added":[],"deleted":["Not applicable","Unknown"]}}}},"clinical_trial_number":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: 'The submitted NCI clinical trial number is in incorrect format.'};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: \"The submitted EudraCT clinical trial number is in incorrect format.\"};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: \"The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database.\"};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: \"'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.\"};\n } \n }\n return result;\n })"]}}}},"created":{"age_at_consent_for_treatment":{"changeType":"created","name":"age_at_consent_for_treatment","description":"Indicate the age of donor when consent was given for treatment.","valueType":"integer","meta":{"displayName":"Age At Consent For Treatment"}},"hemotological_toxicity":{"changeType":"created","name":"hemotological_toxicity","description":"Indicate the hemotological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5"]},"meta":{"displayName":"Hemotological Toxicity","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"response_to_treatment_criteria_method":{"changeType":"deleted","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},"hematological_toxicity":{"changeType":"deleted","name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"non-hematological_toxicity":{"changeType":"deleted","name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"chemotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"dependsOn":{"left":"chemotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"description":{"left":"Name of agent or drug administered to donor as part of the treatment regimen.","right":"Name of agent or drug administered to patient as part of the treatment regimen."},"meta":{"dependsOn":{"left":"chemotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"chemotherapy_dosage_units":{"changeType":"created","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate the total actual drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"deleted","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"deleted","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"deleted","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"deleted","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"description":{"left":"Name of agent or drug administered to donor as part of the treatment regimen.","right":"Name of agent or drug administered to patient as part of the treatment regimen."},"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"hormone_drug_dosage_units":{"changeType":"created","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"deleted","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"radiation":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"radiation_therapy_fractions":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"radiation_therapy_dosage":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"anatomical_site_irradiated":{"description":{"left":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)","right":"Indicate localization site where radiation therapy was administered."},"restrictions":{"codeList":{"left":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"right":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"data":{"added":["Bone","Extremities","Head-Neck","Peritoneum"],"deleted":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"]}}}}},"created":{},"deleted":{"radiation_boost":{"changeType":"deleted","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"deleted","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}}},"immunotherapy":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"immunotherapy_type":{"changeType":"deleted","name":"immunotherapy_type","valueType":"string","description":"Indicate the type of immunotherapy administered to donor.","meta":{"displayName":"Immunotherapy Type","core":true},"restrictions":{"required":true,"codeList":["Cell-based","Immune checkpoint inhibitors","Monoclonal antibodies other than immune checkpoint inhibitors","Other immunomodulatory substances"]}},"drug_rxnormcui":{"changeType":"deleted","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"deleted","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"deleted","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"surgery":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"deleted","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"deleted","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"deleted","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"deleted","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"deleted","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"deleted","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"deleted","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"deleted","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"deleted","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"deleted","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"deleted","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"deleted","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"deleted","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"deleted","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}}},"follow_up":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_follow_up_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"treatment.submitter_treatment_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"weight_at_followup":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"relapse_type":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })"]}}},"relapse_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `'${$name}' cannot be greater than the 'interval_of_followup'.` }\n }\n }\n return result;\n })"]}}},"method_of_progression_status":{"description":{"left":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Reference: caDSR CDE ID 6161031)","right":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Codelist reference: NCI CDE ID: 6161031)"},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })"]}}},"recurrence_t_category":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"recurrence_n_category":{"meta":{"core":{"left":null,"right":true}}},"recurrence_m_category":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"recurrence_stage_group":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.recurrence_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.recurrence_tumour_staging_system && $row.recurrence_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'recurrence_tumour_staging_system' is set to '${\n $row.recurrence_tumour_staging_system\n }', 'recurrence_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"posttherapy_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"posttherapy_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"posttherapy_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"posttherapy_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.posttherapy_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.posttherapy_tumour_staging_system && $row.posttherapy_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'posttherapy_tumour_staging_system' is set to '${\n $row.posttherapy_tumour_staging_system\n }', 'posttherapy_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })"]}}}},"created":{"anatomic_site_progression_or_recurrences":{"changeType":"created","description":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1,C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}}},"deleted":{"anatomic_site_progression_or_recurrence":{"changeType":"deleted","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"exposure":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"deleted","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"deleted","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"deleted","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"deleted","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"deleted","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"deleted","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"deleted","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"deleted","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"deleted","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"deleted","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"deleted","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}}},"family_history":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"family_relative_id":{"changeType":"deleted","description":"Unique identifier of the relative, assigned by the data provider.","name":"family_relative_id","valueType":"string","meta":{"displayName":"Family Relative ID","primaryId":true,"notes":"This field is required to ensure that family members are identified in unique records. Ids can be as simple as an incremented numeral to ensure uniqueness."},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"relative_with_cancer_history":{"changeType":"deleted","description":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","name":"relative_with_cancer_history","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Relative with Cancer History"}},"relationship_type":{"changeType":"deleted","description":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","name":"relationship_type","restrictions":{"codeList":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"]},"valueType":"string","meta":{"displayName":"Relationship Type"}},"gender_of_relative":{"changeType":"deleted","description":"The self-reported gender of related individual.","name":"gender_of_relative","restrictions":{"codeList":["Female","Male","Other","Unknown"]},"valueType":"string","meta":{"displayName":"Gender of Relative"}},"age_of_relative_at_diagnosis":{"changeType":"deleted","description":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","name":"age_of_relative_at_diagnosis","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","displayName":"Age Of Relative At Diagnosis"}},"cancer_type_code_of_relative":{"changeType":"deleted","name":"cancer_type_code_of_relative","valueType":"string","description":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"examples":"C41.1,C16.9,C00.5,D46.9","dependsOn":"family_history.relative_with_cancer_history","displayName":"Cancer Type Code (ICD-10) of Relative"}},"relative_vital_status":{"changeType":"deleted","description":"Relative's last known state of living or deceased.","name":"relative_vital_status","restrictions":{"codeList":["Alive","Deceased","Unknown"]},"valueType":"string","meta":{"displayName":"Vital Status of Relative"}},"cause_of_death_of_relative":{"changeType":"deleted","description":"Indicate the cause of the death of the relative.","name":"cause_of_death_of_relative","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]},"valueType":"string","meta":{"dependsOn":"family_history.relative_vital_status","displayName":"Cause of Death of Relative"}},"relative_survival_time":{"changeType":"deleted","description":"Indicate how long, in days, the relative survived from the time they were diagnosed with cancer.","name":"relative_survival_time","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","units":"days","displayName":"Survival Time Of Relative"}}}},"biomarker":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"deleted","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"deleted","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"deleted","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"deleted","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"deleted","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"deleted","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"deleted","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"deleted","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"deleted","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"deleted","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"deleted","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"deleted","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"deleted","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"deleted","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"deleted","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"deleted","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}}},"comorbidity":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"deleted","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"deleted","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"deleted","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"deleted","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"deleted","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"deleted","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}}}}} diff --git a/scripts/data/schemas/diffs/1.24/1.24-diff-1.7.json b/scripts/data/schemas/diffs/1.24/1.24-diff-1.7.json new file mode 100644 index 00000000..9aac1793 --- /dev/null +++ b/scripts/data/schemas/diffs/1.24/1.24-diff-1.7.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":[],"deleted":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n const row = $row;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n const designation = row.tumour_normal_designation.trim().toLowerCase();\r\n const specimen_type = $field.trim().toLowerCase();\r\n \r\n if (designation === \"normal\"){\r\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\r\n if (!validTypes.includes(specimen_type)){\r\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when tumour_normal_designation is set to Normal.\"};\r\n }\r\n }\r\n else if (designation === \"tumour\") {\r\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\r\n if (invalidTypes.includes(specimen_type)){\r\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when tumour_normal_designation is set to Tumour.\"};\r\n }\r\n }\r\n return result;\r\n })"]}}},"submitter_sample_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased"],"right":["Alive","Deceased","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"cause_of_death":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n const vitalStatus = $row.vital_status.trim().toLowerCase();\r\n \r\n if (!currField && vitalStatus === \"deceased\"){\r\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\r\n }\r\n else if (currField && vitalStatus != \"deceased\"){\r\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\r\n }\r\n return result;\r\n })"]}}},"survival_time":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n const vitalStatus = $row.vital_status.trim().toLowerCase();\r\n \r\n if (!currField && vitalStatus === \"deceased\"){\r\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\r\n }\r\n else if (currField && vitalStatus != \"deceased\"){\r\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\r\n }\r\n return result;\r\n })"]},"range":{"left":{"exclusiveMin":0},"right":null}}},"primary_site":{"meta":{"notes":{"left":"To include multiple values, separate values with a pipe delimiter '|' within your file.","right":null},"examples":{"left":"Breast|Ovary","right":null}},"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Not Reported","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva","Unknown"],"data":{"added":["Not Reported","Unknown"],"deleted":["Unknown primary site"]}}}},"height":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"weight":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"bmi":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)","right":"Indicate the donor's age of menarche, the first occurrence of menstruation."},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"number_of_pregnancies":{"description":{"left":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)","right":"Indicate the number of pregnancies a donor has had."},"restrictions":{"range":{"left":{"min":0},"right":null}}},"number_of_children":{"description":{"left":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)","right":"Indicate the number of children the donor has birthed."},"restrictions":{"range":{"left":{"min":0},"right":null}}}},"created":{},"deleted":{"genetic_disorders":{"changeType":"deleted","description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},"hrt_type":{"changeType":"deleted","description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},"hrt_duration":{"changeType":"deleted","description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},"contraception_type":{"changeType":"deleted","description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},"contraception_duration":{"changeType":"deleted","description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},"lost_to_followup_after_clinical_event_id":{"changeType":"deleted","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}}},"specimen":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"pathological_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\r\n\r\n \r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\r\n if (!($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n /* This is not a required field, so first ensure that it exists */\r\n else if ($field) {\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"pathological_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"pathological_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"pathological_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_stage_group')[0];\r\n\r\n const stagingSystem = stagingName + `_tumour_staging_system`;\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\r\n result.valid = false;\r\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\r\n result.message = msg;\r\n }\r\n else if (!($row[stagingSystem]) && $field) {\r\n result.valid = false;\r\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\r\n result.message = msg;\r\n }\r\n else if ($row[stagingSystem] && $field) {\r\n let codeList = [];\r\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb',\r\n 'stage ive',\r\n 'stage ivs'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\r\n $row[stagingSystem]\r\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n \r\n return result;\r\n })"]}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"data":{"added":[],"deleted":["Unknown"]}}}},"specimen_storage":{"description":{"left":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured.","right":"Indicate the method of specimen storage for specimens that were not extracted freshly or immediately cultured."},"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"data":{"added":[],"deleted":["Unknown"]}}}},"reference_pathology_confirmed":{"description":{"left":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)","right":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist."}},"tumour_grading_system":{"meta":{"validationDependency":{"left":true,"right":null}}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.tumour_grading_system && $field) {\r\n let codeList = [];\r\n const tieredGradingList = ['gx','g1','g2','g3'];\r\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\r\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\r\n case 'two-tier grading system':\r\n codeList = [\r\n 'low grade',\r\n 'high grade',\r\n ];\r\n break;\r\n case 'three-tier grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'four-tier grading system':\r\n codeList = [\r\n 'gx',\r\n 'g1',\r\n 'g2',\r\n 'g3',\r\n 'g4',\r\n ];\r\n break;\r\n case 'grading system for gists':\r\n codeList = [\r\n 'low',\r\n 'high',\r\n ];\r\n break;\r\n case 'grading system for gnets':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'isup grading system':\r\n codeList = [\r\n 'gx',\r\n 'g1',\r\n 'g2',\r\n 'g3',\r\n 'g4',\r\n ];\r\n break;\r\n case 'who grading system for cns tumours':\r\n codeList = [\r\n 'grade i',\r\n 'grade ii',\r\n 'grade iii',\r\n 'grade iv',\r\n ];\r\n break;\r\n case 'fnclcc grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'gleason grade group system':\r\n codeList = [\r\n 'grade group 1',\r\n 'grade group 2',\r\n 'grade group 3',\r\n 'grade group 4',\r\n 'grade group 5',\r\n ];\r\n break;\r\n case 'scarff-bloom-richardson grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'nuclear grading system for dcis':\r\n codeList = tieredGradingList;\r\n break;\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase())) {\r\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\r\n $row.tumour_grading_system\r\n }', 'tumour_grade' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\r\n result.valid = false;\r\n const msg = \"'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.\";\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })"]}}},"percent_tumour_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)","right":"Indicate a value, in decimals, that represents the percentage of infiltration by tumour cells in a specimen."},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null},"script":{"left":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"],"right":null}}},"percent_proliferating_cells":{"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_inflammatory_tissue":{"description":{"left":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)","right":"Indicate a value, in decimals, that represents local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_stromal_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)","right":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a malignant tumour specimen but are not malignant such as fibroblasts, vascular structures, etc."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_necrosis":{"description":{"left":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)","right":"Indicate a value, in decimals, that represents the percentage of cell death in a malignant tumour specimen."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}}},"created":{},"deleted":{"specimen_laterality":{"changeType":"deleted","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"percent_tumour_cells_measurement_method":{"changeType":"deleted","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"age_at_diagnosis":{"restrictions":{"range":{"left":{"exclusiveMin":0,"max":90},"right":null}}},"number_lymph_nodes_examined":{"meta":{"dependsOn":{"left":"primary_diagnosis.lymph_nodes_examined_status","right":null},"notes":{"left":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":null},"range":{"left":{"min":0},"right":null}}},"number_lymph_nodes_positive":{"meta":{"dependsOn":{"left":"primary_diagnosis.lymph_nodes_examined_status","right":null},"notes":{"left":"This field is only required if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":null},"range":{"left":{"min":0},"right":null},"required":{"left":null,"right":true}}},"clinical_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\r\n\r\n \r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\r\n if (!($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n /* This is not a required field, so first ensure that it exists */\r\n else if ($field) {\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"clinical_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"clinical_n_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null}}},"clinical_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"clinical_stage_group":{"description":{"left":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage.","right":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.)."},"meta":{"examples":{"left":"Stage I, Stage IIB","right":null}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_stage_group')[0];\r\n\r\n const stagingSystem = stagingName + `_tumour_staging_system`;\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\r\n result.valid = false;\r\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\r\n result.message = msg;\r\n }\r\n else if (!($row[stagingSystem]) && $field) {\r\n result.valid = false;\r\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\r\n result.message = msg;\r\n }\r\n else if ($row[stagingSystem] && $field) {\r\n let codeList = [];\r\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb',\r\n 'stage ive',\r\n 'stage ivs'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\r\n $row[stagingSystem]\r\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n \r\n return result;\r\n })"]}}},"performance_status":{"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"data":{"added":[],"deleted":["Unknown"]}}}}},"created":{},"deleted":{"laterality":{"changeType":"deleted","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_status":{"changeType":"deleted","name":"lymph_nodes_examined_status","description":"Indicate if lymph nodes were examined for metastases.","valueType":"string","restrictions":{"required":true,"codeList":["Cannot be determined","No","No lymph nodes found in resected specimen","Not applicable","Yes"]},"meta":{"core":true,"displayName":"Lymph Nodes Examined Status"}},"lymph_nodes_examined_method":{"changeType":"deleted","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}}},"treatment":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":[],"deleted":["End of life care"]}}}},"is_primary_treatment":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"codeList":{"left":["Yes","No"],"right":["Yes","No","Unknown"],"data":{"added":["Unknown"],"deleted":[]}},"required":{"left":null,"right":true}}},"line_of_treatment":{"meta":{"dependsOn":{"left":"treatment.is_primary_treatment","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"],"right":null}}},"treatment_start_interval":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"treatment_duration":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null},"required":{"left":null,"right":true}}},"days_per_cycle":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null}}},"number_of_cycles":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null}}},"treatment_intent":{"description":{"left":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","right":"Indicate the intended disease outcome for which the treatment is given. (Reference: NCIt C124307)"},"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"codeList":{"left":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"],"right":["Curative","Palliative","Unknown"],"data":{"added":["Unknown"],"deleted":["Diagnostic","Forensic","Guidance","Preventative","Screening","Supportive"]}},"required":{"left":null,"right":true}}},"treatment_setting":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"codeList":{"left":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"],"right":["Adjuvant","Advanced/Metastatic","Neoadjuvant","Not applicable"],"data":{"added":["Not applicable"],"deleted":["Conditioning","Induction","Maintenance","Mobilization","Preventative","Radiosensitization","Salvage"]}},"required":{"left":null,"right":true}}},"response_to_treatment":{"description":{"left":"The donor's response to the applied treatment regimen.","right":"The donor's response to the applied treatment regimen. (Source: RECIST)"},"meta":{"dependsOn":{"left":"treatment.response_to_treatment_criteria_method","right":null},"notes":{"left":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"right":null},"codeList":{"left":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"],"right":["Complete response","Disease progression","NED","Partial response","Stable disease"],"data":{"added":["Disease progression","NED"],"deleted":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease"]}},"required":{"left":null,"right":true}}},"outcome_of_treatment":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null}}},"toxicity_type":{"description":{"left":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity.","right":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hemotological toxicity or non-hemotological toxicity."},"meta":{"dependsOn":{"left":"treatment.outcome_of_treatment","right":null}},"restrictions":{"codeList":{"left":["Hematological","Non-hematological","Not applicable","Unknown"],"right":["Hemotological","Non-hemotological"],"data":{"added":["Hemotological","Non-hemotological"],"deleted":["Hematological","Non-hematological","Not applicable","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"],"right":null}}},"adverse_events":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"codeList":{"left":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"right":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"data":{"added":[],"deleted":["None","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null}}},"clinical_trials_database":{"meta":{"notes":{"left":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added.","right":null}},"restrictions":{"codeList":{"left":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"],"right":["NCI Clinical Trials","EU Clinical Trials Register"],"data":{"added":[],"deleted":["Not applicable","Unknown"]}}}},"clinical_trial_number":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n //regex check for clinical trial number\r\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\r\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\r\n\r\n // list of valid clinical trial databases\r\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\r\n \r\n if ($row.clinical_trials_database && $field) {\r\n const trialNumber = $field.trim();\r\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\r\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\r\n result = {valid: false, message: 'The submitted NCI clinical trial number is in incorrect format.'};\r\n }\r\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\r\n result = {valid: false, message: \"The submitted EudraCT clinical trial number is in incorrect format.\"};\r\n }\r\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\r\n result = {valid: false, message: \"The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database.\"};\r\n }\r\n }\r\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\r\n result = {valid: true, message: \"Ok\"};\r\n }\r\n else if ($row.clinical_trials_database && !$field) {\r\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\r\n result = {valid: false, message: \"'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.\"};\r\n } \r\n }\r\n return result;\r\n })"]}}}},"created":{"hemotological_toxicity":{"changeType":"created","name":"hemotological_toxicity","description":"Indicate the hemotological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5"]},"meta":{"displayName":"Hemotological Toxicity","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"response_to_treatment_criteria_method":{"changeType":"deleted","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},"hematological_toxicity":{"changeType":"deleted","name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"non-hematological_toxicity":{"changeType":"deleted","name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"chemotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"dependsOn":{"left":"chemotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"description":{"left":"Name of agent or drug administered to donor as part of the treatment regimen.","right":"Name of agent or drug administered to patient as part of the treatment regimen."},"meta":{"dependsOn":{"left":"chemotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"chemotherapy_dosage_units":{"changeType":"created","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate the total actual drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"deleted","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"deleted","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"deleted","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"deleted","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"description":{"left":"Name of agent or drug administered to donor as part of the treatment regimen.","right":"Name of agent or drug administered to patient as part of the treatment regimen."},"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"hormone_drug_dosage_units":{"changeType":"created","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"deleted","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"radiation":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"radiation_therapy_fractions":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"radiation_therapy_dosage":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"anatomical_site_irradiated":{"description":{"left":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)","right":"Indicate localization site where radiation therapy was administered."},"restrictions":{"codeList":{"left":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"right":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"data":{"added":["Bone","Extremities","Head-Neck","Peritoneum"],"deleted":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"]}}}}},"created":{},"deleted":{"radiation_boost":{"changeType":"deleted","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"deleted","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}}},"immunotherapy":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"immunotherapy_type":{"changeType":"deleted","name":"immunotherapy_type","valueType":"string","description":"Indicate the type of immunotherapy administered to donor.","meta":{"displayName":"Immunotherapy Type","core":true},"restrictions":{"required":true,"codeList":["Cell-based","Immune checkpoint inhibitors","Monoclonal antibodies other than immune checkpoint inhibitors","Other immunomodulatory substances"]}},"drug_rxnormcui":{"changeType":"deleted","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"deleted","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"deleted","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"surgery":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"deleted","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"deleted","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"deleted","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"deleted","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"deleted","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"deleted","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"deleted","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"deleted","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"deleted","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"deleted","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"deleted","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"deleted","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"deleted","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"deleted","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}}},"follow_up":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_follow_up_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"treatment.submitter_treatment_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"weight_at_followup":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"relapse_type":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })"]}}},"relapse_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const intervalOfFollowup = parseInt($row.interval_of_followup);\r\n\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n relapseInterval = parseInt($field);\r\n if (relapseInterval > intervalOfFollowup) {\r\n result = {valid: false, message: `'${$name}' cannot be greater than the 'interval_of_followup'.` }\r\n }\r\n }\r\n return result;\r\n })"]}}},"method_of_progression_status":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\r\n\r\n \r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\r\n if (!($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n /* This is not a required field, so first ensure that it exists */\r\n else if ($field) {\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })","(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })"]}}},"recurrence_t_category":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"recurrence_n_category":{"meta":{"core":{"left":null,"right":true}}},"recurrence_m_category":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"recurrence_stage_group":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_stage_group')[0];\r\n\r\n const stagingSystem = stagingName + `_tumour_staging_system`;\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\r\n result.valid = false;\r\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\r\n result.message = msg;\r\n }\r\n else if (!($row[stagingSystem]) && $field) {\r\n result.valid = false;\r\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\r\n result.message = msg;\r\n }\r\n else if ($row[stagingSystem] && $field) {\r\n let codeList = [];\r\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb',\r\n 'stage ive',\r\n 'stage ivs'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\r\n $row[stagingSystem]\r\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n \r\n return result;\r\n })"]}}},"posttherapy_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\r\n\r\n \r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\r\n if (!($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n /* This is not a required field, so first ensure that it exists */\r\n else if ($field) {\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"posttherapy_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"posttherapy_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"posttherapy_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_stage_group')[0];\r\n\r\n const stagingSystem = stagingName + `_tumour_staging_system`;\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\r\n result.valid = false;\r\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\r\n result.message = msg;\r\n }\r\n else if (!($row[stagingSystem]) && $field) {\r\n result.valid = false;\r\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\r\n result.message = msg;\r\n }\r\n else if ($row[stagingSystem] && $field) {\r\n let codeList = [];\r\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb',\r\n 'stage ive',\r\n 'stage ivs'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\r\n $row[stagingSystem]\r\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n \r\n return result;\r\n })"]}}}},"created":{"anatomic_site_progression_or_recurrences":{"changeType":"created","description":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1,C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}}},"deleted":{"anatomic_site_progression_or_recurrence":{"changeType":"deleted","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"exposure":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"deleted","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"deleted","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"deleted","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"deleted","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"deleted","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"deleted","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"deleted","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"deleted","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"deleted","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"deleted","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"deleted","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}}},"family_history":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"family_relative_id":{"changeType":"deleted","description":"Unique identifier of the relative, assigned by the data provider.","name":"family_relative_id","valueType":"string","meta":{"displayName":"Family Relative ID","primaryId":true,"notes":"This field is required to ensure that family members are identified in unique records. Ids can be as simple as an incremented numeral to ensure uniqueness."},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"relative_with_cancer_history":{"changeType":"deleted","description":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","name":"relative_with_cancer_history","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Relative with Cancer History"}},"relationship_type":{"changeType":"deleted","description":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","name":"relationship_type","restrictions":{"codeList":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"]},"valueType":"string","meta":{"displayName":"Relationship Type"}},"gender_of_relative":{"changeType":"deleted","description":"The self-reported gender of related individual.","name":"gender_of_relative","restrictions":{"codeList":["Female","Male","Other","Unknown"]},"valueType":"string","meta":{"displayName":"Gender of Relative"}},"age_of_relative_at_diagnosis":{"changeType":"deleted","description":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","name":"age_of_relative_at_diagnosis","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","displayName":"Age Of Relative At Diagnosis"}},"cancer_type_code_of_relative":{"changeType":"deleted","name":"cancer_type_code_of_relative","valueType":"string","description":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"examples":"C41.1,C16.9,C00.5,D46.9","dependsOn":"family_history.relative_with_cancer_history","displayName":"Cancer Type Code (ICD-10) of Relative"}},"relative_vital_status":{"changeType":"deleted","description":"Relative's last known state of living or deceased.","name":"relative_vital_status","restrictions":{"codeList":["Alive","Deceased","Unknown"]},"valueType":"string","meta":{"displayName":"Vital Status of Relative"}},"cause_of_death_of_relative":{"changeType":"deleted","description":"Indicate the cause of the death of the relative.","name":"cause_of_death_of_relative","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]},"valueType":"string","meta":{"dependsOn":"family_history.relative_vital_status","displayName":"Cause of Death of Relative"}},"relative_survival_time":{"changeType":"deleted","description":"Indicate how long, in days, the relative survived from the time they were diagnosed with cancer.","name":"relative_survival_time","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","units":"days","displayName":"Survival Time Of Relative"}}}},"biomarker":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"deleted","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"deleted","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"deleted","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"deleted","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"deleted","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"deleted","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"deleted","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"deleted","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"deleted","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"deleted","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"deleted","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"deleted","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"deleted","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"deleted","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"deleted","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"deleted","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}}},"comorbidity":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"deleted","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"deleted","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"deleted","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"deleted","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"deleted","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"deleted","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}}}}} diff --git a/scripts/data/schemas/diffs/1.24/1.24-diff-1.8.json b/scripts/data/schemas/diffs/1.24/1.24-diff-1.8.json new file mode 100644 index 00000000..1aca340c --- /dev/null +++ b/scripts/data/schemas/diffs/1.24/1.24-diff-1.8.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":[],"deleted":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"]}}}},"submitter_sample_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased"],"right":["Alive","Deceased","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"survival_time":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"primary_site":{"meta":{"notes":{"left":"To include multiple values, separate values with a pipe delimiter '|' within your file.","right":null},"examples":{"left":"Breast|Ovary","right":null}},"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Not Reported","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva","Unknown"],"data":{"added":["Not Reported","Unknown"],"deleted":["Unknown primary site"]}}}},"height":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"weight":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"bmi":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)","right":"Indicate the donor's age of menarche, the first occurrence of menstruation."},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"number_of_pregnancies":{"description":{"left":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)","right":"Indicate the number of pregnancies a donor has had."},"restrictions":{"range":{"left":{"min":0},"right":null}}},"number_of_children":{"description":{"left":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)","right":"Indicate the number of children the donor has birthed."},"restrictions":{"range":{"left":{"min":0},"right":null}}}},"created":{},"deleted":{"genetic_disorders":{"changeType":"deleted","description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},"hrt_type":{"changeType":"deleted","description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},"hrt_duration":{"changeType":"deleted","description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},"contraception_type":{"changeType":"deleted","description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},"contraception_duration":{"changeType":"deleted","description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},"lost_to_followup_after_clinical_event_id":{"changeType":"deleted","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}}},"specimen":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"pathological_tumour_staging_system":{"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"pathological_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"pathological_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"pathological_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS"],"data":{"added":[],"deleted":["Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n \n return result;\n })"]}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"data":{"added":[],"deleted":["Unknown"]}}}},"specimen_storage":{"description":{"left":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured.","right":"Indicate the method of specimen storage for specimens that were not extracted freshly or immediately cultured."},"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"data":{"added":[],"deleted":["Unknown"]}}}},"reference_pathology_confirmed":{"description":{"left":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)","right":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist."}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"percent_tumour_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)","right":"Indicate a value, in decimals, that represents the percentage of infiltration by tumour cells in a specimen."},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null},"script":{"left":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"],"right":null}}},"percent_proliferating_cells":{"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_inflammatory_tissue":{"description":{"left":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)","right":"Indicate a value, in decimals, that represents local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_stromal_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)","right":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a malignant tumour specimen but are not malignant such as fibroblasts, vascular structures, etc."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_necrosis":{"description":{"left":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)","right":"Indicate a value, in decimals, that represents the percentage of cell death in a malignant tumour specimen."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}}},"created":{},"deleted":{"specimen_laterality":{"changeType":"deleted","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"percent_tumour_cells_measurement_method":{"changeType":"deleted","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"age_at_diagnosis":{"restrictions":{"range":{"left":{"exclusiveMin":0,"max":90},"right":null}}},"number_lymph_nodes_examined":{"meta":{"notes":{"left":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"range":{"left":{"min":0},"right":null}}},"number_lymph_nodes_positive":{"restrictions":{"range":{"left":{"min":0},"right":null}}},"clinical_tumour_staging_system":{"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"clinical_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"clinical_n_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null}}},"clinical_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"clinical_stage_group":{"description":{"left":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage.","right":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.)."},"meta":{"examples":{"left":"Stage I, Stage IIB","right":null}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS"],"data":{"added":[],"deleted":["Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n \n return result;\n })"]}}},"performance_status":{"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"data":{"added":[],"deleted":["Unknown"]}}}}},"created":{},"deleted":{"laterality":{"changeType":"deleted","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_method":{"changeType":"deleted","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}}},"treatment":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":[],"deleted":["End of life care"]}}}},"is_primary_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Yes","No"],"right":["Yes","No","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"line_of_treatment":{"meta":{"dependsOn":{"left":"treatment.is_primary_treatment","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"treatment_start_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"treatment_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]}}},"days_per_cycle":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]}}},"number_of_cycles":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_intent":{"description":{"left":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","right":"Indicate the intended disease outcome for which the treatment is given. (Reference: NCIt C124307)"},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"],"right":["Curative","Palliative","Unknown"],"data":{"added":["Unknown"],"deleted":["Diagnostic","Forensic","Guidance","Preventative","Screening","Supportive"]}}}},"treatment_setting":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"],"right":["Adjuvant","Advanced/Metastatic","Neoadjuvant","Not applicable"],"data":{"added":["Not applicable"],"deleted":["Conditioning","Induction","Maintenance","Mobilization","Preventative","Radiosensitization","Salvage"]}}}},"response_to_treatment":{"description":{"left":"The donor's response to the applied treatment regimen.","right":"The donor's response to the applied treatment regimen. (Source: RECIST)"},"meta":{"dependsOn":{"left":"treatment.response_to_treatment_criteria_method","right":"treatment.treatment_type"},"notes":{"left":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"],"right":["Complete response","Disease progression","NED","Partial response","Stable disease"],"data":{"added":["Disease progression","NED"],"deleted":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease"]}}}},"outcome_of_treatment":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null}}},"toxicity_type":{"description":{"left":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity.","right":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hemotological toxicity or non-hemotological toxicity."},"meta":{"dependsOn":{"left":"treatment.outcome_of_treatment","right":null}},"restrictions":{"codeList":{"left":["Hematological","Non-hematological","Not applicable","Unknown"],"right":["Hemotological","Non-hemotological"],"data":{"added":["Hemotological","Non-hemotological"],"deleted":["Hematological","Non-hematological","Not applicable","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]}}},"adverse_events":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"codeList":{"left":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"right":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"data":{"added":[],"deleted":["None","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]}}},"clinical_trials_database":{"meta":{"notes":{"left":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added.","right":null}},"restrictions":{"codeList":{"left":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"],"right":["NCI Clinical Trials","EU Clinical Trials Register"],"data":{"added":[],"deleted":["Not applicable","Unknown"]}}}},"clinical_trial_number":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"]}}}},"created":{"hemotological_toxicity":{"changeType":"created","name":"hemotological_toxicity","description":"Indicate the hemotological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"response_to_treatment_criteria_method":{"changeType":"deleted","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},"hematological_toxicity":{"changeType":"deleted","name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"non-hematological_toxicity":{"changeType":"deleted","name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"chemotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"dependsOn":{"left":"chemotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"description":{"left":"Name of agent or drug administered to donor as part of the treatment regimen.","right":"Name of agent or drug administered to patient as part of the treatment regimen."},"meta":{"dependsOn":{"left":"chemotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"chemotherapy_dosage_units":{"changeType":"created","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate the total actual drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"deleted","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"deleted","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"deleted","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"deleted","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"description":{"left":"Name of agent or drug administered to donor as part of the treatment regimen.","right":"Name of agent or drug administered to patient as part of the treatment regimen."},"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"hormone_drug_dosage_units":{"changeType":"created","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"deleted","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"radiation":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"radiation_therapy_fractions":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"radiation_therapy_dosage":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"anatomical_site_irradiated":{"description":{"left":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)","right":"Indicate localization site where radiation therapy was administered."},"restrictions":{"codeList":{"left":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"right":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"data":{"added":["Bone","Extremities","Head-Neck","Peritoneum"],"deleted":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"]}}}}},"created":{},"deleted":{"radiation_boost":{"changeType":"deleted","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"deleted","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}}},"immunotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"immunotherapy_type":{"description":{"left":"Indicate the type of immunotherapy administered to donor.","right":"Indicate the type of immunotherapy administered to patient."},"meta":{"core":{"left":true,"right":null}},"restrictions":{"required":{"left":true,"right":null}}},"drug_rxnormcui":{"meta":{"dependsOn":{"left":"immunotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"description":{"left":"Name of agent or drug administered to donor as part of the treatment regimen.","right":"Name of agent or drug administered to patient as part of the treatment regimen."},"meta":{"dependsOn":{"left":"immunotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"},"displayName":{"left":"Chemotherapy Drug Name","right":"Immunotherapy Drug Name"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"deleted","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"surgery":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"deleted","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"deleted","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"deleted","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"deleted","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"deleted","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"deleted","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"deleted","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"deleted","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"deleted","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"deleted","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"deleted","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"deleted","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"deleted","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"deleted","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}}},"follow_up":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_follow_up_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"interval_of_followup":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"treatment.submitter_treatment_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"weight_at_followup":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"relapse_type":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"]}}},"relapse_interval":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"method_of_progression_status":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"]}}},"recurrence_t_category":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"recurrence_n_category":{"meta":{"core":{"left":null,"right":true}}},"recurrence_m_category":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"recurrence_stage_group":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS"],"data":{"added":[],"deleted":["Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n \n return result;\n })"]}}},"posttherapy_tumour_staging_system":{"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"posttherapy_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"posttherapy_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"posttherapy_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS"],"data":{"added":[],"deleted":["Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n \n return result;\n })"]}}}},"created":{"anatomic_site_progression_or_recurrences":{"changeType":"created","description":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1,C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}}},"deleted":{"anatomic_site_progression_or_recurrence":{"changeType":"deleted","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"exposure":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"deleted","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"deleted","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"deleted","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"deleted","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"deleted","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"deleted","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"deleted","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"deleted","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"deleted","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"deleted","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"deleted","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}}},"family_history":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"family_relative_id":{"meta":{"primaryId":{"left":true,"right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"relative_with_cancer_history":{"description":{"left":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","right":"Indicate if patient has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)"}},"relationship_type":{"description":{"left":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","right":"Indicate genetic relationship of the relative to patient. (Reference: caDSR CDE ID 2179937)"},"restrictions":{"codeList":{"left":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"],"right":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Sister","Son","Unknown"],"data":{"added":[],"deleted":["Maternal Uncle","Paternal Uncle","Uncle"]}}}},"age_of_relative_at_diagnosis":{"description":{"left":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","right":"The age (in years) when the patient's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)"},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}},"cancer_type_code_of_relative":{"description":{"left":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","right":"The code to describe the malignant diagnosis of the patient's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification."},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}},"relative_survival_time":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}}},"created":{},"deleted":{}},"biomarker":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"deleted","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"deleted","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"deleted","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"deleted","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"deleted","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"deleted","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"deleted","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"deleted","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"deleted","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"deleted","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"deleted","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"deleted","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"deleted","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"deleted","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"deleted","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"deleted","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}}},"comorbidity":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"deleted","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"deleted","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"deleted","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"deleted","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"deleted","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"deleted","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}}}}} diff --git a/scripts/data/schemas/diffs/1.24/1.24-diff-1.9.json b/scripts/data/schemas/diffs/1.24/1.24-diff-1.9.json new file mode 100644 index 00000000..20142289 --- /dev/null +++ b/scripts/data/schemas/diffs/1.24/1.24-diff-1.9.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":[],"deleted":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"]}}}},"submitter_sample_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased"],"right":["Alive","Deceased","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"primary_site":{"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva"],"data":{"added":[],"deleted":["Unknown primary site"]}}}},"genetic_disorders":{"description":{"left":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","right":"Indicate presence of any hereditary genetic disorders. (Reference: Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)"},"restrictions":{"codeList":{"left":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"],"right":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Serrated Polyposis Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"],"data":{"added":[],"deleted":["None","Not applicable","Unknown"]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)","right":"Indicate the donor's age at which the first menstruation event occurred. (Reference: NCIt C19666)"}},"hrt_type":{"description":{"left":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","right":"Indicate the type of hormone replacement therapy (HRT) the patient has taken or is currently taking."},"restrictions":{"codeList":{"left":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"],"right":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Other","Patch","Pill","Unknown"],"data":{"added":[],"deleted":["Not applicable"]}}}},"hrt_duration":{"description":{"left":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","right":"If patient has taken hormone replacement therapy (HRT), indicate how long patient has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)"},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\") {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If '${$name}' is submitted, then '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n\n }\n return result;\n })"]}}},"contraception_type":{"description":{"left":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","right":"Indicate the type of hormonal contraception the patient has taken or is currently taking. (Reference: caDSR CDE ID 3264234)"},"restrictions":{"codeList":{"left":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"],"right":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Other","Progestin-only pill","Unknown","Vaginal ring"],"data":{"added":[],"deleted":["Not applicable","Oral contraceptive pill"]}}}},"contraception_duration":{"description":{"left":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","right":"If patient has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)"},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\") {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If '${$name}' is submitted, then '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n\n }\n return result;\n })"]}}}},"created":{},"deleted":{"lost_to_followup_after_clinical_event_id":{"changeType":"deleted","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}}},"specimen":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"pathological_tumour_staging_system":{"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"pathological_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"pathological_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"pathological_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS"],"data":{"added":[],"deleted":["Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n \n return result;\n })"]}}},"specimen_acquisition_interval":{"restrictions":{"range":{"left":null,"right":{"min":0}}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"data":{"added":[],"deleted":["Unknown"]}}}},"specimen_storage":{"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"data":{"added":[],"deleted":["Unknown"]}}}},"reference_pathology_confirmed":{"description":{"left":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)","right":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist."}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"percent_tumour_cells":{"restrictions":{"script":{"left":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"],"right":null}}},"percent_proliferating_cells":{"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}}},"percent_inflammatory_tissue":{"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}}},"percent_stromal_cells":{"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}}},"percent_necrosis":{"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}}}},"created":{},"deleted":{"specimen_laterality":{"changeType":"deleted","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"percent_tumour_cells_measurement_method":{"changeType":"deleted","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"number_lymph_nodes_examined":{"meta":{"notes":{"left":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'.","right":null}}},"clinical_tumour_staging_system":{"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"clinical_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"clinical_n_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null}}},"clinical_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"clinical_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS"],"data":{"added":[],"deleted":["Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n \n return result;\n })"]}}},"performance_status":{"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"data":{"added":[],"deleted":["Unknown"]}}}}},"created":{},"deleted":{"laterality":{"changeType":"deleted","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_method":{"changeType":"deleted","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}}},"treatment":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":[],"deleted":["End of life care"]}}}},"is_primary_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Yes","No"],"right":["Yes","No","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"line_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'unknown') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'unknown'.`};\n }\n }\n return result;\n })"]}}},"treatment_start_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"treatment_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]}}},"days_per_cycle":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]}}},"number_of_cycles":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_intent":{"description":{"left":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","right":"Indicate the intended disease outcome for which the treatment is given. (Reference: NCIt C124307)"},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"],"right":["Curative","Palliative","Unknown"],"data":{"added":["Unknown"],"deleted":["Diagnostic","Forensic","Guidance","Preventative","Screening","Supportive"]}}}},"treatment_setting":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"],"right":["Adjuvant","Advanced/Metastatic","Neoadjuvant","Not applicable"],"data":{"added":["Not applicable"],"deleted":["Conditioning","Induction","Maintenance","Mobilization","Preventative","Radiosensitization","Salvage"]}}}},"response_to_treatment":{"description":{"left":"The donor's response to the applied treatment regimen.","right":"The donor's response to the applied treatment regimen. (Source: RECIST)"},"meta":{"dependsOn":{"left":"treatment.response_to_treatment_criteria_method","right":"treatment.treatment_type"},"notes":{"left":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"],"right":["Complete response","Disease progression","NED","Partial response","Stable disease"],"data":{"added":["Disease progression","NED"],"deleted":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease"]}}}},"outcome_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]}}},"toxicity_type":{"restrictions":{"codeList":{"left":["Hematological","Non-hematological","Not applicable","Unknown"],"right":["Hematological","Non-hematological"],"data":{"added":[],"deleted":["Not applicable","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n \n /* toxicityType should only be submitted if treatment was terminated early due to acute toxicity ('outcome_of_treatment' is 'Treatment stopped due to acute toxicity'). */\n if (outcomeOfTreatment != \"treatment stopped due to acute toxicity\") {\n result = { valid: false, message: `The 'outcome_of_treatment' field should be 'Treatment stopped due to acute toxicity' if the '${$name}' field is submitted.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"]}}},"hematological_toxicity":{"restrictions":{"codeList":{"left":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"right":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5"],"data":{"added":[],"deleted":["Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n if (($row.toxicity_type != null && !(checkforEmpty($row.toxicity_type)))) { \n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n \n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}},"non-hematological_toxicity":{"restrictions":{"codeList":{"left":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"right":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"data":{"added":[],"deleted":["Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n if (($row.toxicity_type != null && !(checkforEmpty($row.toxicity_type)))) { \n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n \n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}},"adverse_events":{"restrictions":{"codeList":{"left":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"right":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"data":{"added":[],"deleted":["None","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]}}},"clinical_trials_database":{"meta":{"notes":{"left":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added.","right":null}},"restrictions":{"codeList":{"left":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"],"right":["NCI Clinical Trials","EU Clinical Trials Register"],"data":{"added":[],"deleted":["Not applicable","Unknown"]}}}},"clinical_trial_number":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"]}}}},"created":{},"deleted":{"response_to_treatment_criteria_method":{"changeType":"deleted","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}}}},"chemotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"dependsOn":{"left":"chemotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"dependsOn":{"left":"chemotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"chemotherapy_dosage_units":{"changeType":"created","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate the total actual drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true,"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"deleted","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"deleted","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"deleted","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"deleted","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"hormone_drug_dosage_units":{"changeType":"created","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true,"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"deleted","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"radiation":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"radiation_therapy_dosage":{"valueType":{"left":"number","right":"integer"}},"anatomical_site_irradiated":{"description":{"left":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)","right":"Indicate localization site where radiation therapy was administered."},"restrictions":{"codeList":{"left":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"right":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"data":{"added":["Bone","Extremities","Head-Neck","Peritoneum"],"deleted":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"]}}}}},"created":{},"deleted":{"radiation_boost":{"changeType":"deleted","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"deleted","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}}},"immunotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"immunotherapy_type":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"required":{"left":true,"right":null}}},"drug_rxnormcui":{"meta":{"dependsOn":{"left":"immunotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"dependsOn":{"left":"immunotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"},"displayName":{"left":"Chemotherapy Drug Name","right":"Immunotherapy Drug Name"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"deleted","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"surgery":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"deleted","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"deleted","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"deleted","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"deleted","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"deleted","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"deleted","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"deleted","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"deleted","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"deleted","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"deleted","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"deleted","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"deleted","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"deleted","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"deleted","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}}},"follow_up":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_follow_up_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"interval_of_followup":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"treatment.submitter_treatment_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"relapse_type":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"]}}},"relapse_interval":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"method_of_progression_status":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"]}}},"recurrence_t_category":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"recurrence_n_category":{"meta":{"core":{"left":null,"right":true}}},"recurrence_m_category":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"recurrence_stage_group":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS"],"data":{"added":[],"deleted":["Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n \n return result;\n })"]}}},"posttherapy_tumour_staging_system":{"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"posttherapy_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"posttherapy_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"posttherapy_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS"],"data":{"added":[],"deleted":["Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n \n return result;\n })"]}}}},"created":{"anatomic_site_progression_or_recurrences":{"changeType":"created","description":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1,C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}}},"deleted":{"anatomic_site_progression_or_recurrence":{"changeType":"deleted","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"exposure":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"deleted","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"deleted","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"deleted","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"deleted","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"deleted","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"deleted","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"deleted","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"deleted","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"deleted","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"deleted","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"deleted","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}}},"family_history":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"family_relative_id":{"meta":{"primaryId":{"left":true,"right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"relationship_type":{"restrictions":{"codeList":{"left":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"],"right":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Sister","Son","Unknown"],"data":{"added":[],"deleted":["Maternal Uncle","Paternal Uncle","Uncle"]}}}}},"created":{},"deleted":{}},"biomarker":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"deleted","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"deleted","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"deleted","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"deleted","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"deleted","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"deleted","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"deleted","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"deleted","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"deleted","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"deleted","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"deleted","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"deleted","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"deleted","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"deleted","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"deleted","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"deleted","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}}},"comorbidity":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"deleted","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"deleted","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"deleted","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"deleted","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"deleted","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"deleted","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}}}}} diff --git a/scripts/data/schemas/diffs/1.3/1.3-diff-1.24.json b/scripts/data/schemas/diffs/1.3/1.3-diff-1.24.json new file mode 100644 index 00000000..e2766b25 --- /dev/null +++ b/scripts/data/schemas/diffs/1.3/1.3-diff-1.24.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n const row = $row;\n let result = {valid: true, message: \"Ok\"};\n \n const designation = row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\"){\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when tumour_normal_designation is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when tumour_normal_designation is set to Tumour.\"};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"]}}},"submitter_sample_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased","Unknown"],"right":["Alive","Deceased"],"data":{"added":[],"deleted":["Unknown"]}}}},"cause_of_death":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]}}},"survival_time":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"primary_site":{"meta":{"notes":{"left":null,"right":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"examples":{"left":null,"right":"Breast|Ovary"}},"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Not Reported","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva","Unknown"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"data":{"added":["Unknown primary site"],"deleted":["Not Reported","Unknown"]}}}},"height":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"weight":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"bmi":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"menopause_status":{"description":{"left":"Indicate the donor's menopause status at the time of primary diagnosis. (Codelist reference: NCI CDE ID: 2434914)","right":"Indicate the donor's menopause status at the time of primary diagnosis. (Reference: caDSR CDE ID 2434914)"},"restrictions":{"codeList":{"left":["Indeterminate or unknown","Not applicable","Perimenopausal","Postmenopausal","Premenopausal"],"right":["Not applicable","Perimenopausal","Postmenopausal","Premenopausal","Unknown"],"data":{"added":["Unknown"],"deleted":["Indeterminate or unknown"]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age of menarche, the first occurrence of menstruation.","right":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)"},"restrictions":{}},"number_of_pregnancies":{"description":{"left":"Indicate the number of pregnancies a donor has had.","right":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)"},"restrictions":{}},"number_of_children":{"description":{"left":"Indicate the number of children the donor has birthed.","right":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)"},"restrictions":{}}},"created":{"genetic_disorders":{"changeType":"created","description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},"hrt_type":{"changeType":"created","description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},"hrt_duration":{"changeType":"created","description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},"contraception_type":{"changeType":"created","description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},"contraception_duration":{"changeType":"created","description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},"lost_to_followup_after_clinical_event_id":{"changeType":"created","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}},"deleted":{"prior_malignancy":{"changeType":"deleted","description":"Prior malignancy affecting donor.","name":"prior_malignancy","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy","examples":"C41.1, C16.9, C00.5, D46.9"}},"cancer_type_prior_malignancy":{"changeType":"deleted","description":"The code to represent the cancer type of a prior malignancy using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","name":"cancer_type_prior_malignancy","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"valueType":"string","meta":{"displayName":"Cancer Type Prior Malignancy"}},"age_at_prior_malignancy":{"changeType":"deleted","description":"If donor has history of prior malignancy, indicate age at previous diagnosis, in years.","name":"age_at_prior_malignancy","valueType":"integer","meta":{"displayName":"Age at Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"deleted","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Codelist reference: NCI CDE: 4122391)","name":"laterality_of_prior_malignancy","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality at Prior Malignancy"}}}},"specimen":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null},"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"pathological_tumour_staging_system":{"meta":{"validationDependency":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"pathological_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"pathological_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"pathological_stage_group":{"restrictions":{"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.pathological_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.pathological_tumour_staging_system && $row.pathological_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'pathological_tumour_staging_system' is set to '${\n $row.pathological_tumour_staging_system\n }', 'pathological_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"specimen_storage":{"description":{"left":"Indicate the method of specimen storage for specimens that were not extracted freshly or immediately cultured.","right":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured."},"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"reference_pathology_confirmed":{"description":{"left":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist.","right":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)"}},"tumour_grading_system":{"meta":{"validationDependency":{"left":null,"right":true}}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = \"'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.\";\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"percent_tumour_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of infiltration by tumour cells in a specimen.","right":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)"},"restrictions":{}},"percent_proliferating_cells":{"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_inflammatory_tissue":{"description":{"left":"Indicate a value, in decimals, that represents local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue.","right":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)"},"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_stromal_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a malignant tumour specimen but are not malignant such as fibroblasts, vascular structures, etc.","right":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)"},"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_necrosis":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of cell death in a malignant tumour specimen.","right":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)"},"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}}},"created":{"specimen_laterality":{"changeType":"created","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"percent_tumour_cells_measurement_method":{"changeType":"created","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}},"deleted":{}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"age_at_diagnosis":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0,"max":90}}}},"number_lymph_nodes_positive":{"description":{"left":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: NCI CDE ID: 6113694)","right":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: caDSR CDE ID 6113694)"},"meta":{"dependsOn":{"left":null,"right":"primary_diagnosis.lymph_nodes_examined_status"},"notes":{"left":null,"right":"This field is only required if 'lymph_nodes_examined_status' is 'Yes'."}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"]},"range":{"left":null,"right":{"min":0}}}},"number_lymph_nodes_examined":{"description":{"left":"The total number of lymph nodes tested for the presence of cancer. (Reference: NCI CDE ID: 3)","right":"The total number of lymph nodes tested for the presence of cancer. (Reference: caDSR CDE ID 3)"},"meta":{"dependsOn":{"left":null,"right":"primary_diagnosis.lymph_nodes_examined_status"},"notes":{"left":null,"right":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'."}},"restrictions":{}},"clinical_tumour_staging_system":{"meta":{"validationDependency":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"required":{"left":true,"right":null},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"clinical_stage_group":{"description":{"left":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.).","right":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage."},"meta":{"examples":{"left":null,"right":"Stage I, Stage IIB"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.clinical_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'clinical_tumour_staging_system' is set to '${\n $row.clinical_tumour_staging_system\n }', 'clinical_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"clinical_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"clinical_n_category":{"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"clinical_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"performance_status":{"description":{"left":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference source: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status).","right":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status)."},"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}}},"created":{"laterality":{"changeType":"created","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_status":{"changeType":"created","name":"lymph_nodes_examined_status","description":"Indicate if lymph nodes were examined for metastases.","valueType":"string","restrictions":{"required":true,"codeList":["Cannot be determined","No","No lymph nodes found in resected specimen","Not applicable","Yes"]},"meta":{"core":true,"displayName":"Lymph Nodes Examined Status"}},"lymph_nodes_examined_method":{"changeType":"created","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}},"deleted":{}},"treatment":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null},"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":["End of life care"],"deleted":[]}}}},"is_primary_treatment":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Yes","No","Unknown"],"right":["Yes","No"],"data":{"added":[],"deleted":["Unknown"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"line_of_treatment":{"meta":{"dependsOn":{"left":null,"right":"treatment.is_primary_treatment"}},"restrictions":{}},"treatment_start_interval":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_duration":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"days_per_cycle":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{}},"number_of_cycles":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{}},"treatment_intent":{"description":{"left":"Indicate the intended disease outcome for which the treatment is given. (Reference: CDISC [NCIt code: C124307])","right":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)"},"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Curative","Palliative","Unknown"],"right":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"],"data":{"added":["Diagnostic","Forensic","Guidance","Preventative","Screening","Supportive"],"deleted":["Unknown"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_setting":{"description":{"left":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: CDISC [NCIt code: C124308])","right":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: NCIt C124308)"},"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Adjuvant","Advanced/Metastatic","Neoadjuvant","Not applicable"],"right":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"],"data":{"added":["Conditioning","Induction","Maintenance","Mobilization","Preventative","Radiosensitization","Salvage"],"deleted":["Not applicable"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"response_to_treatment":{"description":{"left":"The donor's response to the applied treatment regimen. (Source: RECIST)","right":"The donor's response to the applied treatment regimen."},"meta":{"dependsOn":{"left":null,"right":"treatment.response_to_treatment_criteria_method"},"notes":{"left":null,"right":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Complete response","Disease progression","NED","Partial response","Stable disease"],"right":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"],"data":{"added":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease"],"deleted":["Disease progression","NED"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"]}}},"outcome_of_treatment":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"toxicity_type":{"description":{"left":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hemotological toxicity or non-hemotological toxicity.","right":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity."},"meta":{"dependsOn":{"left":null,"right":"treatment.outcome_of_treatment"}},"restrictions":{"codeList":{"left":["Hemotological","Non-hemotological"],"right":["Hematological","Non-hematological","Not applicable","Unknown"],"data":{"added":["Hematological","Non-hematological","Not applicable","Unknown"],"deleted":["Hemotological","Non-hemotological"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"]}}},"adverse_events":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"codeList":{"left":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"right":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"data":{"added":["None","Unknown"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"clinical_trials_database":{"meta":{"notes":{"left":null,"right":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added."}},"restrictions":{"codeList":{"left":["NCI Clinical Trials","EU Clinical Trials Register"],"right":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"],"data":{"added":["Not applicable","Unknown"],"deleted":[]}}}},"clinical_trial_number":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: 'The submitted NCI clinical trial number is in incorrect format.'};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: \"The submitted EudraCT clinical trial number is in incorrect format.\"};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: \"The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database.\"};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: \"'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.\"};\n } \n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"]}}}},"created":{"response_to_treatment_criteria_method":{"changeType":"created","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},"hematological_toxicity":{"changeType":"created","name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"non-hematological_toxicity":{"changeType":"created","name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"age_at_consent_for_treatment":{"changeType":"deleted","name":"age_at_consent_for_treatment","description":"Indicate the age of donor when consent was given for treatment.","valueType":"integer","meta":{"displayName":"Age At Consent For Treatment"}},"hemotological_toxicity":{"changeType":"deleted","name":"hemotological_toxicity","description":"Indicate the hemotological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5"]},"meta":{"displayName":"Hemotological Toxicity","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"chemotherapy":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"description":{"left":"Name of agent or drug administered to patient as part of the treatment regimen.","right":"Name of agent or drug administered to donor as part of the treatment regimen."},"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"created","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"created","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"created","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"created","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}},"deleted":{"chemotherapy_dosage_units":{"changeType":"deleted","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate the total actual drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"description":{"left":"Name of agent or drug administered to patient as part of the treatment regimen.","right":"Name of agent or drug administered to donor as part of the treatment regimen."},"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"created","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{"hormone_drug_dosage_units":{"changeType":"deleted","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"radiation":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"radiation_therapy_fractions":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"radiation_therapy_dosage":{"valueType":{"left":"integer","right":"number"},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"anatomical_site_irradiated":{"description":{"left":"Indicate localization site where radiation therapy was administered.","right":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)"},"restrictions":{"codeList":{"left":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"right":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"data":{"added":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"],"deleted":["Bone","Extremities","Head-Neck","Peritoneum"]}}}}},"created":{"radiation_boost":{"changeType":"created","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"created","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}},"deleted":{}},"follow_up":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_follow_up_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null},"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null},"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"treatment.submitter_treatment_id"}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"weight_at_followup":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"relapse_type":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"relapse_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `'${$name}' cannot be greater than the 'interval_of_followup'.` }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"]}}},"method_of_progression_status":{"description":{"left":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Codelist reference: NCI CDE ID: 6161031)","right":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Reference: caDSR CDE ID 6161031)"},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_t_category":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"recurrence_n_category":{"meta":{"core":{"left":true,"right":null}}},"recurrence_m_category":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"recurrence_stage_group":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.recurrence_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.recurrence_tumour_staging_system && $row.recurrence_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'recurrence_tumour_staging_system' is set to '${\n $row.recurrence_tumour_staging_system\n }', 'recurrence_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"posttherapy_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"posttherapy_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"posttherapy_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"posttherapy_stage_group":{"restrictions":{"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.posttherapy_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.posttherapy_tumour_staging_system && $row.posttherapy_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'posttherapy_tumour_staging_system' is set to '${\n $row.posttherapy_tumour_staging_system\n }', 'posttherapy_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}}},"created":{"anatomic_site_progression_or_recurrence":{"changeType":"created","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"anatomic_site_progression_or_recurrences":{"changeType":"deleted","description":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1,C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}}}},"immunotherapy":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"immunotherapy_type":{"changeType":"created","name":"immunotherapy_type","valueType":"string","description":"Indicate the type of immunotherapy administered to donor.","meta":{"displayName":"Immunotherapy Type","core":true},"restrictions":{"required":true,"codeList":["Cell-based","Immune checkpoint inhibitors","Monoclonal antibodies other than immune checkpoint inhibitors","Other immunomodulatory substances"]}},"drug_rxnormcui":{"changeType":"created","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"created","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"created","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{}},"surgery":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"created","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"created","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"created","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"created","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"created","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"created","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"created","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"created","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"created","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"created","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"created","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"created","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"created","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"created","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}},"deleted":{}},"exposure":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"created","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"created","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"created","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"created","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"created","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"created","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"created","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"created","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"created","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"created","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"created","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"created","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"created","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}},"deleted":{}},"family_history":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"family_relative_id":{"changeType":"created","description":"Unique identifier of the relative, assigned by the data provider.","name":"family_relative_id","valueType":"string","meta":{"displayName":"Family Relative ID","primaryId":true,"notes":"This field is required to ensure that family members are identified in unique records. Ids can be as simple as an incremented numeral to ensure uniqueness."},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"relative_with_cancer_history":{"changeType":"created","description":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","name":"relative_with_cancer_history","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Relative with Cancer History"}},"relationship_type":{"changeType":"created","description":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","name":"relationship_type","restrictions":{"codeList":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"]},"valueType":"string","meta":{"displayName":"Relationship Type"}},"gender_of_relative":{"changeType":"created","description":"The self-reported gender of related individual.","name":"gender_of_relative","restrictions":{"codeList":["Female","Male","Other","Unknown"]},"valueType":"string","meta":{"displayName":"Gender of Relative"}},"age_of_relative_at_diagnosis":{"changeType":"created","description":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","name":"age_of_relative_at_diagnosis","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","displayName":"Age Of Relative At Diagnosis"}},"cancer_type_code_of_relative":{"changeType":"created","name":"cancer_type_code_of_relative","valueType":"string","description":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"examples":"C41.1,C16.9,C00.5,D46.9","dependsOn":"family_history.relative_with_cancer_history","displayName":"Cancer Type Code (ICD-10) of Relative"}},"relative_vital_status":{"changeType":"created","description":"Relative's last known state of living or deceased.","name":"relative_vital_status","restrictions":{"codeList":["Alive","Deceased","Unknown"]},"valueType":"string","meta":{"displayName":"Vital Status of Relative"}},"cause_of_death_of_relative":{"changeType":"created","description":"Indicate the cause of the death of the relative.","name":"cause_of_death_of_relative","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]},"valueType":"string","meta":{"dependsOn":"family_history.relative_vital_status","displayName":"Cause of Death of Relative"}},"relative_survival_time":{"changeType":"created","description":"Indicate how long, in days, the relative survived from the time they were diagnosed with cancer.","name":"relative_survival_time","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","units":"days","displayName":"Survival Time Of Relative"}}},"deleted":{}},"biomarker":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"created","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"created","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"created","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"created","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"created","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"created","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"created","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"created","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"created","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"created","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"created","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"created","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"created","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"created","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"created","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"created","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"created","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"created","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"created","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}},"deleted":{}},"comorbidity":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"created","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"created","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"created","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"created","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"created","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"created","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}},"deleted":{}}}} diff --git a/scripts/data/schemas/diffs/1.4/1.4-diff-1.24.json b/scripts/data/schemas/diffs/1.4/1.4-diff-1.24.json new file mode 100644 index 00000000..e9b724b4 --- /dev/null +++ b/scripts/data/schemas/diffs/1.4/1.4-diff-1.24.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n const row = $row;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n const designation = row.tumour_normal_designation.trim().toLowerCase();\r\n const specimen_type = $field.trim().toLowerCase();\r\n \r\n if (designation === \"normal\"){\r\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\r\n if (!validTypes.includes(specimen_type)){\r\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when tumour_normal_designation is set to Normal.\"};\r\n }\r\n }\r\n else if (designation === \"tumour\") {\r\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\r\n if (invalidTypes.includes(specimen_type)){\r\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when tumour_normal_designation is set to Tumour.\"};\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"]}}},"submitter_sample_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased","Unknown"],"right":["Alive","Deceased"],"data":{"added":[],"deleted":["Unknown"]}}}},"cause_of_death":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n const vitalStatus = $row.vital_status.trim().toLowerCase();\r\n \r\n if (!currField && vitalStatus === \"deceased\"){\r\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\r\n }\r\n else if (currField && vitalStatus != \"deceased\"){\r\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]}}},"survival_time":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n const vitalStatus = $row.vital_status.trim().toLowerCase();\r\n \r\n if (!currField && vitalStatus === \"deceased\"){\r\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\r\n }\r\n else if (currField && vitalStatus != \"deceased\"){\r\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"primary_site":{"meta":{"notes":{"left":null,"right":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"examples":{"left":null,"right":"Breast|Ovary"}},"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Not Reported","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva","Unknown"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"data":{"added":["Unknown primary site"],"deleted":["Not Reported","Unknown"]}}}},"height":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"weight":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"bmi":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"menopause_status":{"description":{"left":"Indicate the donor's menopause status at the time of primary diagnosis. (Codelist reference: NCI CDE ID: 2434914)","right":"Indicate the donor's menopause status at the time of primary diagnosis. (Reference: caDSR CDE ID 2434914)"},"restrictions":{"codeList":{"left":["Indeterminate or unknown","Not applicable","Perimenopausal","Postmenopausal","Premenopausal"],"right":["Not applicable","Perimenopausal","Postmenopausal","Premenopausal","Unknown"],"data":{"added":["Unknown"],"deleted":["Indeterminate or unknown"]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age of menarche, the first occurrence of menstruation.","right":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)"},"restrictions":{}},"number_of_pregnancies":{"description":{"left":"Indicate the number of pregnancies a donor has had.","right":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)"},"restrictions":{}},"number_of_children":{"description":{"left":"Indicate the number of children the donor has birthed.","right":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)"},"restrictions":{}}},"created":{"genetic_disorders":{"changeType":"created","description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},"hrt_type":{"changeType":"created","description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},"hrt_duration":{"changeType":"created","description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},"contraception_type":{"changeType":"created","description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},"contraception_duration":{"changeType":"created","description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},"lost_to_followup_after_clinical_event_id":{"changeType":"created","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}},"deleted":{"prior_malignancy":{"changeType":"deleted","description":"Prior malignancy affecting donor.","name":"prior_malignancy","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy","examples":"C41.1, C16.9, C00.5, D46.9"}},"cancer_type_prior_malignancy":{"changeType":"deleted","description":"The code to represent the cancer type of a prior malignancy using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","name":"cancer_type_prior_malignancy","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"valueType":"string","meta":{"displayName":"Cancer Type Prior Malignancy"}},"age_at_prior_malignancy":{"changeType":"deleted","description":"If donor has history of prior malignancy, indicate age at previous diagnosis, in years.","name":"age_at_prior_malignancy","valueType":"integer","meta":{"displayName":"Age at Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"deleted","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Codelist reference: NCI CDE: 4122391)","name":"laterality_of_prior_malignancy","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality at Prior Malignancy"}}}},"specimen":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null},"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"pathological_tumour_staging_system":{"meta":{"validationDependency":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n /* This is not a required field, so first ensure that it exists */\r\n if ($field) {\r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"pathological_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"pathological_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"pathological_stage_group":{"restrictions":{"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.pathological_tumour_staging_system && $field) {\r\n let codeList = [];\r\n switch ($row.pathological_tumour_staging_system && $row.pathological_tumour_staging_system.trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb',\r\n 'stage ive',\r\n 'stage ivs'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When 'pathological_tumour_staging_system' is set to '${\r\n $row.pathological_tumour_staging_system\r\n }', 'pathological_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"specimen_storage":{"description":{"left":"Indicate the method of specimen storage for specimens that were not extracted freshly or immediately cultured.","right":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured."},"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"reference_pathology_confirmed":{"description":{"left":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist.","right":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)"}},"tumour_grading_system":{"meta":{"validationDependency":{"left":null,"right":true}}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.tumour_grading_system && $field) {\r\n let codeList = [];\r\n const tieredGradingList = ['gx','g1','g2','g3'];\r\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\r\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\r\n case 'two-tier grading system':\r\n codeList = [\r\n 'low grade',\r\n 'high grade',\r\n ];\r\n break;\r\n case 'three-tier grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'four-tier grading system':\r\n codeList = [\r\n 'gx',\r\n 'g1',\r\n 'g2',\r\n 'g3',\r\n 'g4',\r\n ];\r\n break;\r\n case 'grading system for gists':\r\n codeList = [\r\n 'low',\r\n 'high',\r\n ];\r\n break;\r\n case 'grading system for gnets':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'isup grading system':\r\n codeList = [\r\n 'gx',\r\n 'g1',\r\n 'g2',\r\n 'g3',\r\n 'g4',\r\n ];\r\n break;\r\n case 'who grading system for cns tumours':\r\n codeList = [\r\n 'grade i',\r\n 'grade ii',\r\n 'grade iii',\r\n 'grade iv',\r\n ];\r\n break;\r\n case 'fnclcc grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'gleason grade group system':\r\n codeList = [\r\n 'grade group 1',\r\n 'grade group 2',\r\n 'grade group 3',\r\n 'grade group 4',\r\n 'grade group 5',\r\n ];\r\n break;\r\n case 'scarff-bloom-richardson grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'nuclear grading system for dcis':\r\n codeList = tieredGradingList;\r\n break;\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase())) {\r\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\r\n $row.tumour_grading_system\r\n }', 'tumour_grade' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\r\n result.valid = false;\r\n const msg = \"'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.\";\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"percent_tumour_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of infiltration by tumour cells in a specimen.","right":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)"},"restrictions":{}},"percent_proliferating_cells":{"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_inflammatory_tissue":{"description":{"left":"Indicate a value, in decimals, that represents local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue.","right":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)"},"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_stromal_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a malignant tumour specimen but are not malignant such as fibroblasts, vascular structures, etc.","right":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)"},"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_necrosis":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of cell death in a malignant tumour specimen.","right":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)"},"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}}},"created":{"specimen_laterality":{"changeType":"created","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"percent_tumour_cells_measurement_method":{"changeType":"created","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}},"deleted":{}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"age_at_diagnosis":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0,"max":90}}}},"number_lymph_nodes_positive":{"description":{"left":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: NCI CDE ID: 6113694)","right":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: caDSR CDE ID 6113694)"},"meta":{"dependsOn":{"left":null,"right":"primary_diagnosis.lymph_nodes_examined_status"},"notes":{"left":null,"right":"This field is only required if 'lymph_nodes_examined_status' is 'Yes'."}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"]},"range":{"left":null,"right":{"min":0}}}},"number_lymph_nodes_examined":{"description":{"left":"The total number of lymph nodes tested for the presence of cancer. (Reference: NCI CDE ID: 3)","right":"The total number of lymph nodes tested for the presence of cancer. (Reference: caDSR CDE ID 3)"},"meta":{"dependsOn":{"left":null,"right":"primary_diagnosis.lymph_nodes_examined_status"},"notes":{"left":null,"right":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'."}},"restrictions":{}},"clinical_tumour_staging_system":{"meta":{"validationDependency":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n /* This is not a required field, so first ensure that it exists */\r\n if ($field) {\r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"required":{"left":true,"right":null},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"clinical_stage_group":{"description":{"left":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.).","right":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage."},"meta":{"examples":{"left":null,"right":"Stage I, Stage IIB"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.clinical_tumour_staging_system && $field) {\r\n let codeList = [];\r\n switch ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system.trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb',\r\n 'stage ive',\r\n 'stage ivs'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When 'clinical_tumour_staging_system' is set to '${\r\n $row.clinical_tumour_staging_system\r\n }', 'clinical_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"clinical_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"clinical_n_category":{"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"clinical_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"performance_status":{"description":{"left":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference source: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status).","right":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status)."},"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}}},"created":{"laterality":{"changeType":"created","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_status":{"changeType":"created","name":"lymph_nodes_examined_status","description":"Indicate if lymph nodes were examined for metastases.","valueType":"string","restrictions":{"required":true,"codeList":["Cannot be determined","No","No lymph nodes found in resected specimen","Not applicable","Yes"]},"meta":{"core":true,"displayName":"Lymph Nodes Examined Status"}},"lymph_nodes_examined_method":{"changeType":"created","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}},"deleted":{}},"treatment":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null},"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":["End of life care"],"deleted":[]}}}},"is_primary_treatment":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Yes","No","Unknown"],"right":["Yes","No"],"data":{"added":[],"deleted":["Unknown"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"line_of_treatment":{"meta":{"dependsOn":{"left":null,"right":"treatment.is_primary_treatment"}},"restrictions":{}},"treatment_start_interval":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_duration":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"days_per_cycle":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{}},"number_of_cycles":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{}},"treatment_intent":{"description":{"left":"Indicate the intended disease outcome for which the treatment is given. (Reference: CDISC [NCIt code: C124307])","right":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)"},"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Curative","Palliative","Unknown"],"right":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"],"data":{"added":["Diagnostic","Forensic","Guidance","Preventative","Screening","Supportive"],"deleted":["Unknown"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_setting":{"description":{"left":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: CDISC [NCIt code: C124308])","right":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: NCIt C124308)"},"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Adjuvant","Advanced/Metastatic","Neoadjuvant","Not applicable"],"right":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"],"data":{"added":["Conditioning","Induction","Maintenance","Mobilization","Preventative","Radiosensitization","Salvage"],"deleted":["Not applicable"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"response_to_treatment":{"description":{"left":"The donor's response to the applied treatment regimen. (Source: RECIST)","right":"The donor's response to the applied treatment regimen."},"meta":{"dependsOn":{"left":null,"right":"treatment.response_to_treatment_criteria_method"},"notes":{"left":null,"right":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Complete response","Disease progression","NED","Partial response","Stable disease"],"right":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"],"data":{"added":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease"],"deleted":["Disease progression","NED"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"]}}},"outcome_of_treatment":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"toxicity_type":{"description":{"left":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hemotological toxicity or non-hemotological toxicity.","right":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity."},"meta":{"dependsOn":{"left":null,"right":"treatment.outcome_of_treatment"}},"restrictions":{"codeList":{"left":["Hemotological","Non-hemotological"],"right":["Hematological","Non-hematological","Not applicable","Unknown"],"data":{"added":["Hematological","Non-hematological","Not applicable","Unknown"],"deleted":["Hemotological","Non-hemotological"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"]}}},"adverse_events":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"codeList":{"left":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"right":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"data":{"added":["None","Unknown"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"clinical_trials_database":{"meta":{"notes":{"left":null,"right":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added."}},"restrictions":{"codeList":{"left":["NCI Clinical Trials","EU Clinical Trials Register"],"right":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"],"data":{"added":["Not applicable","Unknown"],"deleted":[]}}}},"clinical_trial_number":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n //regex check for clinical trial number\r\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\r\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\r\n\r\n // list of valid clinical trial databases\r\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\r\n \r\n if ($row.clinical_trials_database && $field) {\r\n const trialNumber = $field.trim();\r\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\r\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\r\n result = {valid: false, message: 'The submitted NCI clinical trial number is in incorrect format.'};\r\n }\r\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\r\n result = {valid: false, message: \"The submitted EudraCT clinical trial number is in incorrect format.\"};\r\n }\r\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\r\n result = {valid: false, message: \"The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database.\"};\r\n }\r\n }\r\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\r\n result = {valid: true, message: \"Ok\"};\r\n }\r\n else if ($row.clinical_trials_database && !$field) {\r\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\r\n result = {valid: false, message: \"'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.\"};\r\n } \r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"]}}}},"created":{"response_to_treatment_criteria_method":{"changeType":"created","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},"hematological_toxicity":{"changeType":"created","name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"non-hematological_toxicity":{"changeType":"created","name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"age_at_consent_for_treatment":{"changeType":"deleted","name":"age_at_consent_for_treatment","description":"Indicate the age of donor when consent was given for treatment.","valueType":"integer","meta":{"displayName":"Age At Consent For Treatment"}},"hemotological_toxicity":{"changeType":"deleted","name":"hemotological_toxicity","description":"Indicate the hemotological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5"]},"meta":{"displayName":"Hemotological Toxicity","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"chemotherapy":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"description":{"left":"Name of agent or drug administered to patient as part of the treatment regimen.","right":"Name of agent or drug administered to donor as part of the treatment regimen."},"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"created","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"created","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"created","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"created","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}},"deleted":{"chemotherapy_dosage_units":{"changeType":"deleted","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate the total actual drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"description":{"left":"Name of agent or drug administered to patient as part of the treatment regimen.","right":"Name of agent or drug administered to donor as part of the treatment regimen."},"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"created","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{"hormone_drug_dosage_units":{"changeType":"deleted","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"radiation":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"radiation_therapy_fractions":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"radiation_therapy_dosage":{"valueType":{"left":"integer","right":"number"},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"anatomical_site_irradiated":{"description":{"left":"Indicate localization site where radiation therapy was administered.","right":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)"},"restrictions":{"codeList":{"left":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"right":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"data":{"added":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"],"deleted":["Bone","Extremities","Head-Neck","Peritoneum"]}}}}},"created":{"radiation_boost":{"changeType":"created","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"created","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}},"deleted":{}},"follow_up":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_follow_up_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null},"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null},"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"treatment.submitter_treatment_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"weight_at_followup":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"relapse_type":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"relapse_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const intervalOfFollowup = parseInt($row.interval_of_followup);\r\n\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n relapseInterval = parseInt($field);\r\n if (relapseInterval > intervalOfFollowup) {\r\n result = {valid: false, message: `'${$name}' cannot be greater than the 'interval_of_followup'.` }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"]}}},"method_of_progression_status":{"description":{"left":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Codelist reference: NCI CDE ID: 6161031)","right":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Reference: caDSR CDE ID 6161031)"},"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n /* This is not a required field, so first ensure that it exists */\r\n if ($field) {\r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })","(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_t_category":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"recurrence_n_category":{"meta":{"core":{"left":true,"right":null}}},"recurrence_m_category":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"recurrence_stage_group":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.recurrence_tumour_staging_system && $field) {\r\n let codeList = [];\r\n switch ($row.recurrence_tumour_staging_system && $row.recurrence_tumour_staging_system.trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb',\r\n 'stage ive',\r\n 'stage ivs'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When 'recurrence_tumour_staging_system' is set to '${\r\n $row.recurrence_tumour_staging_system\r\n }', 'recurrence_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"posttherapy_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n /* This is not a required field, so first ensure that it exists */\r\n if ($field) {\r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"posttherapy_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"posttherapy_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"posttherapy_stage_group":{"restrictions":{"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.posttherapy_tumour_staging_system && $field) {\r\n let codeList = [];\r\n switch ($row.posttherapy_tumour_staging_system && $row.posttherapy_tumour_staging_system.trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb',\r\n 'stage ive',\r\n 'stage ivs'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When 'posttherapy_tumour_staging_system' is set to '${\r\n $row.posttherapy_tumour_staging_system\r\n }', 'posttherapy_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}}},"created":{"anatomic_site_progression_or_recurrence":{"changeType":"created","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"anatomic_site_progression_or_recurrences":{"changeType":"deleted","description":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1,C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}}}},"immunotherapy":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"immunotherapy_type":{"changeType":"created","name":"immunotherapy_type","valueType":"string","description":"Indicate the type of immunotherapy administered to donor.","meta":{"displayName":"Immunotherapy Type","core":true},"restrictions":{"required":true,"codeList":["Cell-based","Immune checkpoint inhibitors","Monoclonal antibodies other than immune checkpoint inhibitors","Other immunomodulatory substances"]}},"drug_rxnormcui":{"changeType":"created","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"created","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"created","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{}},"surgery":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"created","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"created","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"created","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"created","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"created","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"created","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"created","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"created","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"created","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"created","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"created","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"created","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"created","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"created","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}},"deleted":{}},"exposure":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"created","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"created","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"created","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"created","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"created","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"created","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"created","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"created","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"created","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"created","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"created","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"created","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"created","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}},"deleted":{}},"family_history":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"family_relative_id":{"changeType":"created","description":"Unique identifier of the relative, assigned by the data provider.","name":"family_relative_id","valueType":"string","meta":{"displayName":"Family Relative ID","primaryId":true,"notes":"This field is required to ensure that family members are identified in unique records. Ids can be as simple as an incremented numeral to ensure uniqueness."},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"relative_with_cancer_history":{"changeType":"created","description":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","name":"relative_with_cancer_history","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Relative with Cancer History"}},"relationship_type":{"changeType":"created","description":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","name":"relationship_type","restrictions":{"codeList":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"]},"valueType":"string","meta":{"displayName":"Relationship Type"}},"gender_of_relative":{"changeType":"created","description":"The self-reported gender of related individual.","name":"gender_of_relative","restrictions":{"codeList":["Female","Male","Other","Unknown"]},"valueType":"string","meta":{"displayName":"Gender of Relative"}},"age_of_relative_at_diagnosis":{"changeType":"created","description":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","name":"age_of_relative_at_diagnosis","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","displayName":"Age Of Relative At Diagnosis"}},"cancer_type_code_of_relative":{"changeType":"created","name":"cancer_type_code_of_relative","valueType":"string","description":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"examples":"C41.1,C16.9,C00.5,D46.9","dependsOn":"family_history.relative_with_cancer_history","displayName":"Cancer Type Code (ICD-10) of Relative"}},"relative_vital_status":{"changeType":"created","description":"Relative's last known state of living or deceased.","name":"relative_vital_status","restrictions":{"codeList":["Alive","Deceased","Unknown"]},"valueType":"string","meta":{"displayName":"Vital Status of Relative"}},"cause_of_death_of_relative":{"changeType":"created","description":"Indicate the cause of the death of the relative.","name":"cause_of_death_of_relative","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]},"valueType":"string","meta":{"dependsOn":"family_history.relative_vital_status","displayName":"Cause of Death of Relative"}},"relative_survival_time":{"changeType":"created","description":"Indicate how long, in days, the relative survived from the time they were diagnosed with cancer.","name":"relative_survival_time","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","units":"days","displayName":"Survival Time Of Relative"}}},"deleted":{}},"biomarker":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"created","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"created","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"created","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"created","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"created","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"created","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"created","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"created","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"created","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"created","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"created","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"created","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"created","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"created","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"created","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"created","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"created","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"created","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"created","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}},"deleted":{}},"comorbidity":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"created","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"created","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"created","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"created","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"created","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"created","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}},"deleted":{}}}} diff --git a/scripts/data/schemas/diffs/1.5/1.5-diff-1.24.json b/scripts/data/schemas/diffs/1.5/1.5-diff-1.24.json new file mode 100644 index 00000000..2c48cb9b --- /dev/null +++ b/scripts/data/schemas/diffs/1.5/1.5-diff-1.24.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n const row = $row;\n let result = {valid: true, message: \"Ok\"};\n \n const designation = row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\"){\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when tumour_normal_designation is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when tumour_normal_designation is set to Tumour.\"};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"]}}},"submitter_sample_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased","Unknown"],"right":["Alive","Deceased"],"data":{"added":[],"deleted":["Unknown"]}}}},"cause_of_death":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]}}},"survival_time":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"primary_site":{"meta":{"notes":{"left":null,"right":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"examples":{"left":null,"right":"Breast|Ovary"}},"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Not Reported","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva","Unknown"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"data":{"added":["Unknown primary site"],"deleted":["Not Reported","Unknown"]}}}},"height":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"weight":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"bmi":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"menopause_status":{"description":{"left":"Indicate the donor's menopause status at the time of primary diagnosis. (Codelist reference: NCI CDE ID: 2434914)","right":"Indicate the donor's menopause status at the time of primary diagnosis. (Reference: caDSR CDE ID 2434914)"},"restrictions":{"codeList":{"left":["Indeterminate or unknown","Not applicable","Perimenopausal","Postmenopausal","Premenopausal"],"right":["Not applicable","Perimenopausal","Postmenopausal","Premenopausal","Unknown"],"data":{"added":["Unknown"],"deleted":["Indeterminate or unknown"]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age of menarche, the first occurrence of menstruation.","right":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)"},"restrictions":{}},"number_of_pregnancies":{"description":{"left":"Indicate the number of pregnancies a donor has had.","right":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)"},"restrictions":{}},"number_of_children":{"description":{"left":"Indicate the number of children the donor has birthed.","right":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)"},"restrictions":{}}},"created":{"genetic_disorders":{"changeType":"created","description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},"hrt_type":{"changeType":"created","description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},"hrt_duration":{"changeType":"created","description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},"contraception_type":{"changeType":"created","description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},"contraception_duration":{"changeType":"created","description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},"lost_to_followup_after_clinical_event_id":{"changeType":"created","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}},"deleted":{"prior_malignancy":{"changeType":"deleted","description":"Prior malignancy affecting donor.","name":"prior_malignancy","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy","examples":"C41.1, C16.9, C00.5, D46.9"}},"cancer_type_prior_malignancy":{"changeType":"deleted","description":"The code to represent the cancer type of a prior malignancy using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","name":"cancer_type_prior_malignancy","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"valueType":"string","meta":{"displayName":"Cancer Type Prior Malignancy"}},"age_at_prior_malignancy":{"changeType":"deleted","description":"If donor has history of prior malignancy, indicate age at previous diagnosis, in years.","name":"age_at_prior_malignancy","valueType":"integer","meta":{"displayName":"Age at Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"deleted","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Codelist reference: NCI CDE: 4122391)","name":"laterality_of_prior_malignancy","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality at Prior Malignancy"}}}},"specimen":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"pathological_tumour_staging_system":{"meta":{"validationDependency":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"pathological_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"pathological_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"pathological_stage_group":{"restrictions":{"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.pathological_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.pathological_tumour_staging_system && $row.pathological_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'pathological_tumour_staging_system' is set to '${\n $row.pathological_tumour_staging_system\n }', 'pathological_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"specimen_storage":{"description":{"left":"Indicate the method of specimen storage for specimens that were not extracted freshly or immediately cultured.","right":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured."},"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"reference_pathology_confirmed":{"description":{"left":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist.","right":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)"}},"tumour_grading_system":{"meta":{"validationDependency":{"left":null,"right":true}}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = \"'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.\";\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"percent_tumour_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of infiltration by tumour cells in a specimen.","right":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)"},"restrictions":{}},"percent_proliferating_cells":{"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_inflammatory_tissue":{"description":{"left":"Indicate a value, in decimals, that represents local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue.","right":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)"},"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_stromal_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a malignant tumour specimen but are not malignant such as fibroblasts, vascular structures, etc.","right":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)"},"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_necrosis":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of cell death in a malignant tumour specimen.","right":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)"},"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}}},"created":{"specimen_laterality":{"changeType":"created","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"percent_tumour_cells_measurement_method":{"changeType":"created","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}},"deleted":{}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"age_at_diagnosis":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0,"max":90}}}},"number_lymph_nodes_positive":{"description":{"left":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: NCI CDE ID: 6113694)","right":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: caDSR CDE ID 6113694)"},"meta":{"dependsOn":{"left":null,"right":"primary_diagnosis.lymph_nodes_examined_status"},"notes":{"left":null,"right":"This field is only required if 'lymph_nodes_examined_status' is 'Yes'."}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"]},"range":{"left":null,"right":{"min":0}}}},"number_lymph_nodes_examined":{"description":{"left":"The total number of lymph nodes tested for the presence of cancer. (Reference: NCI CDE ID: 3)","right":"The total number of lymph nodes tested for the presence of cancer. (Reference: caDSR CDE ID 3)"},"meta":{"dependsOn":{"left":null,"right":"primary_diagnosis.lymph_nodes_examined_status"},"notes":{"left":null,"right":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'."}},"restrictions":{}},"clinical_tumour_staging_system":{"meta":{"validationDependency":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"required":{"left":true,"right":null},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"clinical_stage_group":{"description":{"left":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.).","right":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage."},"meta":{"examples":{"left":null,"right":"Stage I, Stage IIB"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.clinical_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'clinical_tumour_staging_system' is set to '${\n $row.clinical_tumour_staging_system\n }', 'clinical_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"clinical_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"clinical_n_category":{"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"clinical_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"performance_status":{"description":{"left":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference source: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status).","right":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status)."},"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}}},"created":{"laterality":{"changeType":"created","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_status":{"changeType":"created","name":"lymph_nodes_examined_status","description":"Indicate if lymph nodes were examined for metastases.","valueType":"string","restrictions":{"required":true,"codeList":["Cannot be determined","No","No lymph nodes found in resected specimen","Not applicable","Yes"]},"meta":{"core":true,"displayName":"Lymph Nodes Examined Status"}},"lymph_nodes_examined_method":{"changeType":"created","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}},"deleted":{}},"treatment":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":["End of life care"],"deleted":[]}}}},"is_primary_treatment":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Yes","No","Unknown"],"right":["Yes","No"],"data":{"added":[],"deleted":["Unknown"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"line_of_treatment":{"meta":{"dependsOn":{"left":null,"right":"treatment.is_primary_treatment"}},"restrictions":{}},"treatment_start_interval":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_duration":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"days_per_cycle":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{}},"number_of_cycles":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{}},"treatment_intent":{"description":{"left":"Indicate the intended disease outcome for which the treatment is given. (Reference: CDISC [NCIt code: C124307])","right":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)"},"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Curative","Palliative","Unknown"],"right":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"],"data":{"added":["Diagnostic","Forensic","Guidance","Preventative","Screening","Supportive"],"deleted":["Unknown"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_setting":{"description":{"left":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: CDISC [NCIt code: C124308])","right":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: NCIt C124308)"},"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Adjuvant","Advanced/Metastatic","Neoadjuvant","Not applicable"],"right":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"],"data":{"added":["Conditioning","Induction","Maintenance","Mobilization","Preventative","Radiosensitization","Salvage"],"deleted":["Not applicable"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"response_to_treatment":{"description":{"left":"The donor's response to the applied treatment regimen. (Source: RECIST)","right":"The donor's response to the applied treatment regimen."},"meta":{"dependsOn":{"left":null,"right":"treatment.response_to_treatment_criteria_method"},"notes":{"left":null,"right":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Complete response","Disease progression","NED","Partial response","Stable disease"],"right":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"],"data":{"added":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease"],"deleted":["Disease progression","NED"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"]}}},"outcome_of_treatment":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"toxicity_type":{"description":{"left":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hemotological toxicity or non-hemotological toxicity.","right":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity."},"meta":{"dependsOn":{"left":null,"right":"treatment.outcome_of_treatment"}},"restrictions":{"codeList":{"left":["Hemotological","Non-hemotological"],"right":["Hematological","Non-hematological","Not applicable","Unknown"],"data":{"added":["Hematological","Non-hematological","Not applicable","Unknown"],"deleted":["Hemotological","Non-hemotological"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"]}}},"adverse_events":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"codeList":{"left":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"right":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"data":{"added":["None","Unknown"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"clinical_trials_database":{"meta":{"notes":{"left":null,"right":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added."}},"restrictions":{"codeList":{"left":["NCI Clinical Trials","EU Clinical Trials Register"],"right":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"],"data":{"added":["Not applicable","Unknown"],"deleted":[]}}}},"clinical_trial_number":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: 'The submitted NCI clinical trial number is in incorrect format.'};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: \"The submitted EudraCT clinical trial number is in incorrect format.\"};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: \"The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database.\"};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: \"'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.\"};\n } \n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"]}}}},"created":{"response_to_treatment_criteria_method":{"changeType":"created","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},"hematological_toxicity":{"changeType":"created","name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"non-hematological_toxicity":{"changeType":"created","name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"age_at_consent_for_treatment":{"changeType":"deleted","name":"age_at_consent_for_treatment","description":"Indicate the age of donor when consent was given for treatment.","valueType":"integer","meta":{"displayName":"Age At Consent For Treatment"}},"hemotological_toxicity":{"changeType":"deleted","name":"hemotological_toxicity","description":"Indicate the hemotological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5"]},"meta":{"displayName":"Hemotological Toxicity","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"chemotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"description":{"left":"Name of agent or drug administered to patient as part of the treatment regimen.","right":"Name of agent or drug administered to donor as part of the treatment regimen."},"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"created","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"created","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"created","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"created","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}},"deleted":{"chemotherapy_dosage_units":{"changeType":"deleted","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate the total actual drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"description":{"left":"Name of agent or drug administered to patient as part of the treatment regimen.","right":"Name of agent or drug administered to donor as part of the treatment regimen."},"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"created","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{"hormone_drug_dosage_units":{"changeType":"deleted","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"radiation":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"radiation_therapy_fractions":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"radiation_therapy_dosage":{"valueType":{"left":"integer","right":"number"},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"anatomical_site_irradiated":{"description":{"left":"Indicate localization site where radiation therapy was administered.","right":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)"},"restrictions":{"codeList":{"left":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"right":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"data":{"added":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"],"deleted":["Bone","Extremities","Head-Neck","Peritoneum"]}}}}},"created":{"radiation_boost":{"changeType":"created","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"created","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}},"deleted":{}},"follow_up":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_follow_up_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"treatment.submitter_treatment_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"weight_at_followup":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"relapse_type":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"relapse_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `'${$name}' cannot be greater than the 'interval_of_followup'.` }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"]}}},"method_of_progression_status":{"description":{"left":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Codelist reference: NCI CDE ID: 6161031)","right":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Reference: caDSR CDE ID 6161031)"},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_t_category":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"recurrence_n_category":{"meta":{"core":{"left":true,"right":null}}},"recurrence_m_category":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"recurrence_stage_group":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.recurrence_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.recurrence_tumour_staging_system && $row.recurrence_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'recurrence_tumour_staging_system' is set to '${\n $row.recurrence_tumour_staging_system\n }', 'recurrence_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"posttherapy_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"posttherapy_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"posttherapy_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"posttherapy_stage_group":{"restrictions":{"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.posttherapy_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.posttherapy_tumour_staging_system && $row.posttherapy_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'posttherapy_tumour_staging_system' is set to '${\n $row.posttherapy_tumour_staging_system\n }', 'posttherapy_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}}},"created":{"anatomic_site_progression_or_recurrence":{"changeType":"created","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"anatomic_site_progression_or_recurrences":{"changeType":"deleted","description":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1,C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}}}},"immunotherapy":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"immunotherapy_type":{"changeType":"created","name":"immunotherapy_type","valueType":"string","description":"Indicate the type of immunotherapy administered to donor.","meta":{"displayName":"Immunotherapy Type","core":true},"restrictions":{"required":true,"codeList":["Cell-based","Immune checkpoint inhibitors","Monoclonal antibodies other than immune checkpoint inhibitors","Other immunomodulatory substances"]}},"drug_rxnormcui":{"changeType":"created","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"created","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"created","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{}},"surgery":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"created","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"created","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"created","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"created","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"created","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"created","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"created","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"created","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"created","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"created","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"created","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"created","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"created","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"created","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}},"deleted":{}},"exposure":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"created","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"created","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"created","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"created","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"created","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"created","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"created","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"created","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"created","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"created","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"created","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"created","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"created","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}},"deleted":{}},"family_history":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"family_relative_id":{"changeType":"created","description":"Unique identifier of the relative, assigned by the data provider.","name":"family_relative_id","valueType":"string","meta":{"displayName":"Family Relative ID","primaryId":true,"notes":"This field is required to ensure that family members are identified in unique records. Ids can be as simple as an incremented numeral to ensure uniqueness."},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"relative_with_cancer_history":{"changeType":"created","description":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","name":"relative_with_cancer_history","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Relative with Cancer History"}},"relationship_type":{"changeType":"created","description":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","name":"relationship_type","restrictions":{"codeList":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"]},"valueType":"string","meta":{"displayName":"Relationship Type"}},"gender_of_relative":{"changeType":"created","description":"The self-reported gender of related individual.","name":"gender_of_relative","restrictions":{"codeList":["Female","Male","Other","Unknown"]},"valueType":"string","meta":{"displayName":"Gender of Relative"}},"age_of_relative_at_diagnosis":{"changeType":"created","description":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","name":"age_of_relative_at_diagnosis","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","displayName":"Age Of Relative At Diagnosis"}},"cancer_type_code_of_relative":{"changeType":"created","name":"cancer_type_code_of_relative","valueType":"string","description":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"examples":"C41.1,C16.9,C00.5,D46.9","dependsOn":"family_history.relative_with_cancer_history","displayName":"Cancer Type Code (ICD-10) of Relative"}},"relative_vital_status":{"changeType":"created","description":"Relative's last known state of living or deceased.","name":"relative_vital_status","restrictions":{"codeList":["Alive","Deceased","Unknown"]},"valueType":"string","meta":{"displayName":"Vital Status of Relative"}},"cause_of_death_of_relative":{"changeType":"created","description":"Indicate the cause of the death of the relative.","name":"cause_of_death_of_relative","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]},"valueType":"string","meta":{"dependsOn":"family_history.relative_vital_status","displayName":"Cause of Death of Relative"}},"relative_survival_time":{"changeType":"created","description":"Indicate how long, in days, the relative survived from the time they were diagnosed with cancer.","name":"relative_survival_time","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","units":"days","displayName":"Survival Time Of Relative"}}},"deleted":{}},"biomarker":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"created","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"created","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"created","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"created","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"created","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"created","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"created","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"created","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"created","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"created","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"created","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"created","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"created","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"created","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"created","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"created","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"created","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"created","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"created","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}},"deleted":{}},"comorbidity":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"created","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"created","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"created","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"created","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"created","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"created","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}},"deleted":{}}}} diff --git a/scripts/data/schemas/diffs/1.7/1.7-diff-1.24.json b/scripts/data/schemas/diffs/1.7/1.7-diff-1.24.json new file mode 100644 index 00000000..c16a794b --- /dev/null +++ b/scripts/data/schemas/diffs/1.7/1.7-diff-1.24.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n const row = $row;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n const designation = row.tumour_normal_designation.trim().toLowerCase();\r\n const specimen_type = $field.trim().toLowerCase();\r\n \r\n if (designation === \"normal\"){\r\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\r\n if (!validTypes.includes(specimen_type)){\r\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when tumour_normal_designation is set to Normal.\"};\r\n }\r\n }\r\n else if (designation === \"tumour\") {\r\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\r\n if (invalidTypes.includes(specimen_type)){\r\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when tumour_normal_designation is set to Tumour.\"};\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"]}}},"submitter_sample_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased","Unknown"],"right":["Alive","Deceased"],"data":{"added":[],"deleted":["Unknown"]}}}},"cause_of_death":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n const vitalStatus = $row.vital_status.trim().toLowerCase();\r\n \r\n if (!currField && vitalStatus === \"deceased\"){\r\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\r\n }\r\n else if (currField && vitalStatus != \"deceased\"){\r\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]}}},"survival_time":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n const vitalStatus = $row.vital_status.trim().toLowerCase();\r\n \r\n if (!currField && vitalStatus === \"deceased\"){\r\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\r\n }\r\n else if (currField && vitalStatus != \"deceased\"){\r\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"primary_site":{"meta":{"notes":{"left":null,"right":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"examples":{"left":null,"right":"Breast|Ovary"}},"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Not Reported","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva","Unknown"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"data":{"added":["Unknown primary site"],"deleted":["Not Reported","Unknown"]}}}},"height":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"weight":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"bmi":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"age_at_menarche":{"description":{"left":"Indicate the donor's age of menarche, the first occurrence of menstruation.","right":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)"},"restrictions":{}},"number_of_pregnancies":{"description":{"left":"Indicate the number of pregnancies a donor has had.","right":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)"},"restrictions":{}},"number_of_children":{"description":{"left":"Indicate the number of children the donor has birthed.","right":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)"},"restrictions":{}}},"created":{"genetic_disorders":{"changeType":"created","description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},"hrt_type":{"changeType":"created","description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},"hrt_duration":{"changeType":"created","description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},"contraception_type":{"changeType":"created","description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},"contraception_duration":{"changeType":"created","description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},"lost_to_followup_after_clinical_event_id":{"changeType":"created","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}},"deleted":{}},"specimen":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"pathological_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\r\n\r\n \r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\r\n if (!($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n /* This is not a required field, so first ensure that it exists */\r\n else if ($field) {\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"pathological_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"pathological_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"pathological_stage_group":{"restrictions":{"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_stage_group')[0];\r\n\r\n const stagingSystem = stagingName + `_tumour_staging_system`;\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\r\n result.valid = false;\r\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\r\n result.message = msg;\r\n }\r\n else if (!($row[stagingSystem]) && $field) {\r\n result.valid = false;\r\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\r\n result.message = msg;\r\n }\r\n else if ($row[stagingSystem] && $field) {\r\n let codeList = [];\r\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb',\r\n 'stage ive',\r\n 'stage ivs'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\r\n $row[stagingSystem]\r\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n \r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"specimen_storage":{"description":{"left":"Indicate the method of specimen storage for specimens that were not extracted freshly or immediately cultured.","right":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured."},"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"reference_pathology_confirmed":{"description":{"left":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist.","right":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)"}},"tumour_grading_system":{"meta":{"validationDependency":{"left":null,"right":true}}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.tumour_grading_system && $field) {\r\n let codeList = [];\r\n const tieredGradingList = ['gx','g1','g2','g3'];\r\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\r\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\r\n case 'two-tier grading system':\r\n codeList = [\r\n 'low grade',\r\n 'high grade',\r\n ];\r\n break;\r\n case 'three-tier grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'four-tier grading system':\r\n codeList = [\r\n 'gx',\r\n 'g1',\r\n 'g2',\r\n 'g3',\r\n 'g4',\r\n ];\r\n break;\r\n case 'grading system for gists':\r\n codeList = [\r\n 'low',\r\n 'high',\r\n ];\r\n break;\r\n case 'grading system for gnets':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'isup grading system':\r\n codeList = [\r\n 'gx',\r\n 'g1',\r\n 'g2',\r\n 'g3',\r\n 'g4',\r\n ];\r\n break;\r\n case 'who grading system for cns tumours':\r\n codeList = [\r\n 'grade i',\r\n 'grade ii',\r\n 'grade iii',\r\n 'grade iv',\r\n ];\r\n break;\r\n case 'fnclcc grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'gleason grade group system':\r\n codeList = [\r\n 'grade group 1',\r\n 'grade group 2',\r\n 'grade group 3',\r\n 'grade group 4',\r\n 'grade group 5',\r\n ];\r\n break;\r\n case 'scarff-bloom-richardson grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'nuclear grading system for dcis':\r\n codeList = tieredGradingList;\r\n break;\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase())) {\r\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\r\n $row.tumour_grading_system\r\n }', 'tumour_grade' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\r\n result.valid = false;\r\n const msg = \"'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.\";\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"percent_tumour_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of infiltration by tumour cells in a specimen.","right":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)"},"restrictions":{}},"percent_proliferating_cells":{"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_inflammatory_tissue":{"description":{"left":"Indicate a value, in decimals, that represents local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue.","right":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)"},"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_stromal_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a malignant tumour specimen but are not malignant such as fibroblasts, vascular structures, etc.","right":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)"},"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_necrosis":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of cell death in a malignant tumour specimen.","right":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)"},"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}}},"created":{"specimen_laterality":{"changeType":"created","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"percent_tumour_cells_measurement_method":{"changeType":"created","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}},"deleted":{}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"age_at_diagnosis":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0,"max":90}}}},"number_lymph_nodes_positive":{"meta":{"dependsOn":{"left":null,"right":"primary_diagnosis.lymph_nodes_examined_status"},"notes":{"left":null,"right":"This field is only required if 'lymph_nodes_examined_status' is 'Yes'."}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"]},"range":{"left":null,"right":{"min":0}}}},"number_lymph_nodes_examined":{"meta":{"dependsOn":{"left":null,"right":"primary_diagnosis.lymph_nodes_examined_status"},"notes":{"left":null,"right":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'."}},"restrictions":{}},"clinical_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\r\n\r\n \r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\r\n if (!($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n /* This is not a required field, so first ensure that it exists */\r\n else if ($field) {\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"clinical_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"clinical_n_category":{"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"clinical_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"clinical_stage_group":{"description":{"left":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.).","right":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage."},"meta":{"examples":{"left":null,"right":"Stage I, Stage IIB"}},"restrictions":{"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_stage_group')[0];\r\n\r\n const stagingSystem = stagingName + `_tumour_staging_system`;\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\r\n result.valid = false;\r\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\r\n result.message = msg;\r\n }\r\n else if (!($row[stagingSystem]) && $field) {\r\n result.valid = false;\r\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\r\n result.message = msg;\r\n }\r\n else if ($row[stagingSystem] && $field) {\r\n let codeList = [];\r\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb',\r\n 'stage ive',\r\n 'stage ivs'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\r\n $row[stagingSystem]\r\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n \r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"performance_status":{"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}}},"created":{"laterality":{"changeType":"created","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_status":{"changeType":"created","name":"lymph_nodes_examined_status","description":"Indicate if lymph nodes were examined for metastases.","valueType":"string","restrictions":{"required":true,"codeList":["Cannot be determined","No","No lymph nodes found in resected specimen","Not applicable","Yes"]},"meta":{"core":true,"displayName":"Lymph Nodes Examined Status"}},"lymph_nodes_examined_method":{"changeType":"created","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}},"deleted":{}},"treatment":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":["End of life care"],"deleted":[]}}}},"is_primary_treatment":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Yes","No","Unknown"],"right":["Yes","No"],"data":{"added":[],"deleted":["Unknown"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"line_of_treatment":{"meta":{"dependsOn":{"left":null,"right":"treatment.is_primary_treatment"}},"restrictions":{}},"treatment_start_interval":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_duration":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"days_per_cycle":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{}},"number_of_cycles":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{}},"treatment_intent":{"description":{"left":"Indicate the intended disease outcome for which the treatment is given. (Reference: NCIt C124307)","right":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)"},"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Curative","Palliative","Unknown"],"right":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"],"data":{"added":["Diagnostic","Forensic","Guidance","Preventative","Screening","Supportive"],"deleted":["Unknown"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_setting":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Adjuvant","Advanced/Metastatic","Neoadjuvant","Not applicable"],"right":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"],"data":{"added":["Conditioning","Induction","Maintenance","Mobilization","Preventative","Radiosensitization","Salvage"],"deleted":["Not applicable"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"response_to_treatment":{"description":{"left":"The donor's response to the applied treatment regimen. (Source: RECIST)","right":"The donor's response to the applied treatment regimen."},"meta":{"dependsOn":{"left":null,"right":"treatment.response_to_treatment_criteria_method"},"notes":{"left":null,"right":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Complete response","Disease progression","NED","Partial response","Stable disease"],"right":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"],"data":{"added":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease"],"deleted":["Disease progression","NED"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"]}}},"outcome_of_treatment":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"toxicity_type":{"description":{"left":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hemotological toxicity or non-hemotological toxicity.","right":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity."},"meta":{"dependsOn":{"left":null,"right":"treatment.outcome_of_treatment"}},"restrictions":{"codeList":{"left":["Hemotological","Non-hemotological"],"right":["Hematological","Non-hematological","Not applicable","Unknown"],"data":{"added":["Hematological","Non-hematological","Not applicable","Unknown"],"deleted":["Hemotological","Non-hemotological"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"]}}},"adverse_events":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"codeList":{"left":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"right":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"data":{"added":["None","Unknown"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"clinical_trials_database":{"meta":{"notes":{"left":null,"right":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added."}},"restrictions":{"codeList":{"left":["NCI Clinical Trials","EU Clinical Trials Register"],"right":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"],"data":{"added":["Not applicable","Unknown"],"deleted":[]}}}},"clinical_trial_number":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n //regex check for clinical trial number\r\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\r\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\r\n\r\n // list of valid clinical trial databases\r\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\r\n \r\n if ($row.clinical_trials_database && $field) {\r\n const trialNumber = $field.trim();\r\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\r\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\r\n result = {valid: false, message: 'The submitted NCI clinical trial number is in incorrect format.'};\r\n }\r\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\r\n result = {valid: false, message: \"The submitted EudraCT clinical trial number is in incorrect format.\"};\r\n }\r\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\r\n result = {valid: false, message: \"The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database.\"};\r\n }\r\n }\r\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\r\n result = {valid: true, message: \"Ok\"};\r\n }\r\n else if ($row.clinical_trials_database && !$field) {\r\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\r\n result = {valid: false, message: \"'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.\"};\r\n } \r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"]}}}},"created":{"response_to_treatment_criteria_method":{"changeType":"created","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},"hematological_toxicity":{"changeType":"created","name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"non-hematological_toxicity":{"changeType":"created","name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"hemotological_toxicity":{"changeType":"deleted","name":"hemotological_toxicity","description":"Indicate the hemotological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5"]},"meta":{"displayName":"Hemotological Toxicity","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"chemotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"description":{"left":"Name of agent or drug administered to patient as part of the treatment regimen.","right":"Name of agent or drug administered to donor as part of the treatment regimen."},"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"created","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"created","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"created","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"created","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}},"deleted":{"chemotherapy_dosage_units":{"changeType":"deleted","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate the total actual drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"description":{"left":"Name of agent or drug administered to patient as part of the treatment regimen.","right":"Name of agent or drug administered to donor as part of the treatment regimen."},"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"created","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{"hormone_drug_dosage_units":{"changeType":"deleted","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"radiation":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"radiation_therapy_fractions":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"radiation_therapy_dosage":{"valueType":{"left":"integer","right":"number"},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"anatomical_site_irradiated":{"description":{"left":"Indicate localization site where radiation therapy was administered.","right":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)"},"restrictions":{"codeList":{"left":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"right":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"data":{"added":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"],"deleted":["Bone","Extremities","Head-Neck","Peritoneum"]}}}}},"created":{"radiation_boost":{"changeType":"created","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"created","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}},"deleted":{}},"follow_up":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_follow_up_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"treatment.submitter_treatment_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"weight_at_followup":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"relapse_type":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"relapse_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const intervalOfFollowup = parseInt($row.interval_of_followup);\r\n\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n relapseInterval = parseInt($field);\r\n if (relapseInterval > intervalOfFollowup) {\r\n result = {valid: false, message: `'${$name}' cannot be greater than the 'interval_of_followup'.` }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"]}}},"method_of_progression_status":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\r\n\r\n \r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\r\n if (!($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n /* This is not a required field, so first ensure that it exists */\r\n else if ($field) {\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })","(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_t_category":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"recurrence_n_category":{"meta":{"core":{"left":true,"right":null}}},"recurrence_m_category":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"recurrence_stage_group":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_stage_group')[0];\r\n\r\n const stagingSystem = stagingName + `_tumour_staging_system`;\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\r\n result.valid = false;\r\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\r\n result.message = msg;\r\n }\r\n else if (!($row[stagingSystem]) && $field) {\r\n result.valid = false;\r\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\r\n result.message = msg;\r\n }\r\n else if ($row[stagingSystem] && $field) {\r\n let codeList = [];\r\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb',\r\n 'stage ive',\r\n 'stage ivs'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\r\n $row[stagingSystem]\r\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n \r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"posttherapy_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\r\n\r\n \r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\r\n if (!($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n /* This is not a required field, so first ensure that it exists */\r\n else if ($field) {\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"posttherapy_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"posttherapy_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"posttherapy_stage_group":{"restrictions":{"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_stage_group')[0];\r\n\r\n const stagingSystem = stagingName + `_tumour_staging_system`;\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\r\n result.valid = false;\r\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\r\n result.message = msg;\r\n }\r\n else if (!($row[stagingSystem]) && $field) {\r\n result.valid = false;\r\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\r\n result.message = msg;\r\n }\r\n else if ($row[stagingSystem] && $field) {\r\n let codeList = [];\r\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb',\r\n 'stage ive',\r\n 'stage ivs'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\r\n $row[stagingSystem]\r\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n \r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}}},"created":{"anatomic_site_progression_or_recurrence":{"changeType":"created","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"anatomic_site_progression_or_recurrences":{"changeType":"deleted","description":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1,C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}}}},"immunotherapy":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"immunotherapy_type":{"changeType":"created","name":"immunotherapy_type","valueType":"string","description":"Indicate the type of immunotherapy administered to donor.","meta":{"displayName":"Immunotherapy Type","core":true},"restrictions":{"required":true,"codeList":["Cell-based","Immune checkpoint inhibitors","Monoclonal antibodies other than immune checkpoint inhibitors","Other immunomodulatory substances"]}},"drug_rxnormcui":{"changeType":"created","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"created","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"created","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{}},"surgery":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"created","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"created","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"created","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"created","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"created","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"created","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"created","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"created","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"created","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"created","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"created","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"created","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"created","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"created","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}},"deleted":{}},"exposure":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"created","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"created","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"created","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"created","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"created","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"created","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"created","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"created","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"created","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"created","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"created","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"created","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"created","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}},"deleted":{}},"family_history":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"family_relative_id":{"changeType":"created","description":"Unique identifier of the relative, assigned by the data provider.","name":"family_relative_id","valueType":"string","meta":{"displayName":"Family Relative ID","primaryId":true,"notes":"This field is required to ensure that family members are identified in unique records. Ids can be as simple as an incremented numeral to ensure uniqueness."},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"relative_with_cancer_history":{"changeType":"created","description":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","name":"relative_with_cancer_history","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Relative with Cancer History"}},"relationship_type":{"changeType":"created","description":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","name":"relationship_type","restrictions":{"codeList":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"]},"valueType":"string","meta":{"displayName":"Relationship Type"}},"gender_of_relative":{"changeType":"created","description":"The self-reported gender of related individual.","name":"gender_of_relative","restrictions":{"codeList":["Female","Male","Other","Unknown"]},"valueType":"string","meta":{"displayName":"Gender of Relative"}},"age_of_relative_at_diagnosis":{"changeType":"created","description":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","name":"age_of_relative_at_diagnosis","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","displayName":"Age Of Relative At Diagnosis"}},"cancer_type_code_of_relative":{"changeType":"created","name":"cancer_type_code_of_relative","valueType":"string","description":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"examples":"C41.1,C16.9,C00.5,D46.9","dependsOn":"family_history.relative_with_cancer_history","displayName":"Cancer Type Code (ICD-10) of Relative"}},"relative_vital_status":{"changeType":"created","description":"Relative's last known state of living or deceased.","name":"relative_vital_status","restrictions":{"codeList":["Alive","Deceased","Unknown"]},"valueType":"string","meta":{"displayName":"Vital Status of Relative"}},"cause_of_death_of_relative":{"changeType":"created","description":"Indicate the cause of the death of the relative.","name":"cause_of_death_of_relative","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]},"valueType":"string","meta":{"dependsOn":"family_history.relative_vital_status","displayName":"Cause of Death of Relative"}},"relative_survival_time":{"changeType":"created","description":"Indicate how long, in days, the relative survived from the time they were diagnosed with cancer.","name":"relative_survival_time","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","units":"days","displayName":"Survival Time Of Relative"}}},"deleted":{}},"biomarker":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"created","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"created","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"created","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"created","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"created","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"created","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"created","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"created","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"created","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"created","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"created","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"created","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"created","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"created","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"created","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"created","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"created","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"created","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"created","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}},"deleted":{}},"comorbidity":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"created","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"created","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"created","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"created","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"created","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"created","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}},"deleted":{}}}} diff --git a/scripts/data/schemas/diffs/1.8/1.8-diff-1.24.json b/scripts/data/schemas/diffs/1.8/1.8-diff-1.24.json new file mode 100644 index 00000000..8d479ce9 --- /dev/null +++ b/scripts/data/schemas/diffs/1.8/1.8-diff-1.24.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"],"deleted":[]}}}},"submitter_sample_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased","Unknown"],"right":["Alive","Deceased"],"data":{"added":[],"deleted":["Unknown"]}}}},"survival_time":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"primary_site":{"meta":{"notes":{"left":null,"right":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"examples":{"left":null,"right":"Breast|Ovary"}},"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Not Reported","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva","Unknown"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"data":{"added":["Unknown primary site"],"deleted":["Not Reported","Unknown"]}}}},"height":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"weight":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"bmi":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"age_at_menarche":{"description":{"left":"Indicate the donor's age of menarche, the first occurrence of menstruation.","right":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)"},"restrictions":{}},"number_of_pregnancies":{"description":{"left":"Indicate the number of pregnancies a donor has had.","right":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)"},"restrictions":{}},"number_of_children":{"description":{"left":"Indicate the number of children the donor has birthed.","right":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)"},"restrictions":{}}},"created":{"genetic_disorders":{"changeType":"created","description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},"hrt_type":{"changeType":"created","description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},"hrt_duration":{"changeType":"created","description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},"contraception_type":{"changeType":"created","description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},"contraception_duration":{"changeType":"created","description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},"lost_to_followup_after_clinical_event_id":{"changeType":"created","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}},"deleted":{}},"specimen":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"pathological_tumour_staging_system":{"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"pathological_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"pathological_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"pathological_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Cannot be assessed"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n \n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"specimen_storage":{"description":{"left":"Indicate the method of specimen storage for specimens that were not extracted freshly or immediately cultured.","right":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured."},"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"reference_pathology_confirmed":{"description":{"left":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist.","right":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)"}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"percent_tumour_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of infiltration by tumour cells in a specimen.","right":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)"},"restrictions":{}},"percent_proliferating_cells":{"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_inflammatory_tissue":{"description":{"left":"Indicate a value, in decimals, that represents local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue.","right":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)"},"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_stromal_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a malignant tumour specimen but are not malignant such as fibroblasts, vascular structures, etc.","right":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)"},"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_necrosis":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of cell death in a malignant tumour specimen.","right":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)"},"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}}},"created":{"specimen_laterality":{"changeType":"created","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"percent_tumour_cells_measurement_method":{"changeType":"created","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}},"deleted":{}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"age_at_diagnosis":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0,"max":90}}}},"number_lymph_nodes_examined":{"meta":{"notes":{"left":null,"right":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'."}},"restrictions":{"range":{"left":null,"right":{"min":0}}}},"number_lymph_nodes_positive":{"restrictions":{"range":{"left":null,"right":{"min":0}}}},"clinical_tumour_staging_system":{"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"clinical_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"clinical_n_category":{"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"clinical_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"clinical_stage_group":{"description":{"left":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.).","right":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage."},"meta":{"examples":{"left":null,"right":"Stage I, Stage IIB"}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Cannot be assessed"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n \n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"performance_status":{"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}}},"created":{"laterality":{"changeType":"created","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_method":{"changeType":"created","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}},"deleted":{}},"treatment":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":["End of life care"],"deleted":[]}}}},"is_primary_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Yes","No","Unknown"],"right":["Yes","No"],"data":{"added":[],"deleted":["Unknown"]}}}},"line_of_treatment":{"meta":{"dependsOn":{"left":null,"right":"treatment.is_primary_treatment"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"]},"range":{"left":{"exclusiveMin":0},"right":null}}},"treatment_start_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":{"exclusiveMin":0},"right":null}}},"treatment_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"days_per_cycle":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"number_of_cycles":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_intent":{"description":{"left":"Indicate the intended disease outcome for which the treatment is given. (Reference: NCIt C124307)","right":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)"},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Curative","Palliative","Unknown"],"right":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"],"data":{"added":["Diagnostic","Forensic","Guidance","Preventative","Screening","Supportive"],"deleted":["Unknown"]}}}},"treatment_setting":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Adjuvant","Advanced/Metastatic","Neoadjuvant","Not applicable"],"right":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"],"data":{"added":["Conditioning","Induction","Maintenance","Mobilization","Preventative","Radiosensitization","Salvage"],"deleted":["Not applicable"]}}}},"response_to_treatment":{"description":{"left":"The donor's response to the applied treatment regimen. (Source: RECIST)","right":"The donor's response to the applied treatment regimen."},"meta":{"dependsOn":{"left":"treatment.treatment_type","right":"treatment.response_to_treatment_criteria_method"},"notes":{"left":null,"right":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"]},"codeList":{"left":["Complete response","Disease progression","NED","Partial response","Stable disease"],"right":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"],"data":{"added":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease"],"deleted":["Disease progression","NED"]}}}},"outcome_of_treatment":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"toxicity_type":{"description":{"left":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hemotological toxicity or non-hemotological toxicity.","right":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity."},"meta":{"dependsOn":{"left":null,"right":"treatment.outcome_of_treatment"}},"restrictions":{"codeList":{"left":["Hemotological","Non-hemotological"],"right":["Hematological","Non-hematological","Not applicable","Unknown"],"data":{"added":["Hematological","Non-hematological","Not applicable","Unknown"],"deleted":["Hemotological","Non-hemotological"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"]}}},"adverse_events":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"codeList":{"left":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"right":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"data":{"added":["None","Unknown"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"clinical_trials_database":{"meta":{"notes":{"left":null,"right":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added."}},"restrictions":{"codeList":{"left":["NCI Clinical Trials","EU Clinical Trials Register"],"right":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"],"data":{"added":["Not applicable","Unknown"],"deleted":[]}}}},"clinical_trial_number":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"]}}}},"created":{"response_to_treatment_criteria_method":{"changeType":"created","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},"hematological_toxicity":{"changeType":"created","name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"non-hematological_toxicity":{"changeType":"created","name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"hemotological_toxicity":{"changeType":"deleted","name":"hemotological_toxicity","description":"Indicate the hemotological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"chemotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"description":{"left":"Name of agent or drug administered to patient as part of the treatment regimen.","right":"Name of agent or drug administered to donor as part of the treatment regimen."},"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"created","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"created","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"created","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"created","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}},"deleted":{"chemotherapy_dosage_units":{"changeType":"deleted","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate the total actual drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"description":{"left":"Name of agent or drug administered to patient as part of the treatment regimen.","right":"Name of agent or drug administered to donor as part of the treatment regimen."},"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"created","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{"hormone_drug_dosage_units":{"changeType":"deleted","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"radiation":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"radiation_therapy_fractions":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"radiation_therapy_dosage":{"valueType":{"left":"integer","right":"number"},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"anatomical_site_irradiated":{"description":{"left":"Indicate localization site where radiation therapy was administered.","right":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)"},"restrictions":{"codeList":{"left":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"right":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"data":{"added":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"],"deleted":["Bone","Extremities","Head-Neck","Peritoneum"]}}}}},"created":{"radiation_boost":{"changeType":"created","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"created","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}},"deleted":{}},"immunotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"immunotherapy_type":{"description":{"left":"Indicate the type of immunotherapy administered to patient.","right":"Indicate the type of immunotherapy administered to donor."},"meta":{"core":{"left":null,"right":true}},"restrictions":{"required":{"left":null,"right":true}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"immunotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"description":{"left":"Name of agent or drug administered to patient as part of the treatment regimen.","right":"Name of agent or drug administered to donor as part of the treatment regimen."},"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"displayName":{"left":"Immunotherapy Drug Name","right":"Chemotherapy Drug Name"},"dependsOn":{"left":null,"right":"immunotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"created","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{}},"follow_up":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_follow_up_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"interval_of_followup":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"treatment.submitter_treatment_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"weight_at_followup":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"relapse_type":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"relapse_interval":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"method_of_progression_status":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_t_category":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"recurrence_n_category":{"meta":{"core":{"left":true,"right":null}}},"recurrence_m_category":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"recurrence_stage_group":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Cannot be assessed"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n \n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"posttherapy_tumour_staging_system":{"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"posttherapy_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"posttherapy_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"posttherapy_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Cannot be assessed"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n \n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}}},"created":{"anatomic_site_progression_or_recurrence":{"changeType":"created","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"anatomic_site_progression_or_recurrences":{"changeType":"deleted","description":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1,C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}}}},"family_history":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"family_relative_id":{"meta":{"primaryId":{"left":null,"right":true}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"relative_with_cancer_history":{"description":{"left":"Indicate if patient has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","right":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)"}},"relationship_type":{"description":{"left":"Indicate genetic relationship of the relative to patient. (Reference: caDSR CDE ID 2179937)","right":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)"},"restrictions":{"codeList":{"left":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Sister","Son","Unknown"],"right":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"],"data":{"added":["Maternal Uncle","Paternal Uncle","Uncle"],"deleted":[]}}}},"age_of_relative_at_diagnosis":{"description":{"left":"The age (in years) when the patient's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","right":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)"},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}},"cancer_type_code_of_relative":{"description":{"left":"The code to describe the malignant diagnosis of the patient's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","right":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification."},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}},"relative_survival_time":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}}},"created":{},"deleted":{}},"surgery":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"created","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"created","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"created","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"created","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"created","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"created","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"created","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"created","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"created","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"created","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"created","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"created","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"created","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"created","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}},"deleted":{}},"exposure":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"created","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"created","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"created","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"created","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"created","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"created","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"created","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"created","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"created","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"created","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"created","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"created","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"created","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}},"deleted":{}},"biomarker":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"created","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"created","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"created","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"created","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"created","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"created","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"created","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"created","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"created","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"created","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"created","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"created","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"created","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"created","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"created","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"created","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"created","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"created","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"created","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}},"deleted":{}},"comorbidity":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"created","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"created","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"created","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"created","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"created","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"created","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}},"deleted":{}}}} diff --git a/scripts/data/schemas/diffs/1.9/1.9-diff-1.24.json b/scripts/data/schemas/diffs/1.9/1.9-diff-1.24.json new file mode 100644 index 00000000..806b77c1 --- /dev/null +++ b/scripts/data/schemas/diffs/1.9/1.9-diff-1.24.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"],"deleted":[]}}}},"submitter_sample_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased","Unknown"],"right":["Alive","Deceased"],"data":{"added":[],"deleted":["Unknown"]}}}},"primary_site":{"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"data":{"added":["Unknown primary site"],"deleted":[]}}}},"genetic_disorders":{"description":{"left":"Indicate presence of any hereditary genetic disorders. (Reference: Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","right":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)"},"restrictions":{"codeList":{"left":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Serrated Polyposis Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"],"right":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"],"data":{"added":["None","Not applicable","Unknown"],"deleted":[]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age at which the first menstruation event occurred. (Reference: NCIt C19666)","right":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)"}},"hrt_type":{"description":{"left":"Indicate the type of hormone replacement therapy (HRT) the patient has taken or is currently taking.","right":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking."},"restrictions":{"codeList":{"left":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Other","Patch","Pill","Unknown"],"right":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"],"data":{"added":["Not applicable"],"deleted":[]}}}},"hrt_duration":{"description":{"left":"If patient has taken hormone replacement therapy (HRT), indicate how long patient has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","right":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)"},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\") {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If '${$name}' is submitted, then '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"]}}},"contraception_type":{"description":{"left":"Indicate the type of hormonal contraception the patient has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","right":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)"},"restrictions":{"codeList":{"left":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Other","Progestin-only pill","Unknown","Vaginal ring"],"right":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"],"data":{"added":["Not applicable","Oral contraceptive pill"],"deleted":[]}}}},"contraception_duration":{"description":{"left":"If patient has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","right":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)"},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\") {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If '${$name}' is submitted, then '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"]}}}},"created":{"lost_to_followup_after_clinical_event_id":{"changeType":"created","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}},"deleted":{}},"specimen":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"pathological_tumour_staging_system":{"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"pathological_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"pathological_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"pathological_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Cannot be assessed"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n \n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"specimen_acquisition_interval":{"restrictions":{"range":{"left":{"min":0},"right":null}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"specimen_storage":{"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"reference_pathology_confirmed":{"description":{"left":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist.","right":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)"}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"percent_tumour_cells":{"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"]}}},"percent_proliferating_cells":{"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}}},"percent_inflammatory_tissue":{"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}}},"percent_stromal_cells":{"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}}},"percent_necrosis":{"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}}}},"created":{"specimen_laterality":{"changeType":"created","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"percent_tumour_cells_measurement_method":{"changeType":"created","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}},"deleted":{}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"number_lymph_nodes_examined":{"meta":{"notes":{"left":null,"right":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'."}}},"clinical_tumour_staging_system":{"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"clinical_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"clinical_n_category":{"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"clinical_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"clinical_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Cannot be assessed"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n \n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"performance_status":{"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}}},"created":{"laterality":{"changeType":"created","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_method":{"changeType":"created","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}},"deleted":{}},"treatment":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":["End of life care"],"deleted":[]}}}},"is_primary_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Yes","No","Unknown"],"right":["Yes","No"],"data":{"added":[],"deleted":["Unknown"]}}}},"line_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'unknown') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'unknown'.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"]}}},"treatment_start_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":{"exclusiveMin":0},"right":null}}},"treatment_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"days_per_cycle":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"number_of_cycles":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_intent":{"description":{"left":"Indicate the intended disease outcome for which the treatment is given. (Reference: NCIt C124307)","right":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)"},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Curative","Palliative","Unknown"],"right":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"],"data":{"added":["Diagnostic","Forensic","Guidance","Preventative","Screening","Supportive"],"deleted":["Unknown"]}}}},"treatment_setting":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Adjuvant","Advanced/Metastatic","Neoadjuvant","Not applicable"],"right":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"],"data":{"added":["Conditioning","Induction","Maintenance","Mobilization","Preventative","Radiosensitization","Salvage"],"deleted":["Not applicable"]}}}},"response_to_treatment":{"description":{"left":"The donor's response to the applied treatment regimen. (Source: RECIST)","right":"The donor's response to the applied treatment regimen."},"meta":{"dependsOn":{"left":"treatment.treatment_type","right":"treatment.response_to_treatment_criteria_method"},"notes":{"left":null,"right":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"]},"codeList":{"left":["Complete response","Disease progression","NED","Partial response","Stable disease"],"right":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"],"data":{"added":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease"],"deleted":["Disease progression","NED"]}}}},"outcome_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"toxicity_type":{"restrictions":{"codeList":{"left":["Hematological","Non-hematological"],"right":["Hematological","Non-hematological","Not applicable","Unknown"],"data":{"added":["Not applicable","Unknown"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n \n /* toxicityType should only be submitted if treatment was terminated early due to acute toxicity ('outcome_of_treatment' is 'Treatment stopped due to acute toxicity'). */\n if (outcomeOfTreatment != \"treatment stopped due to acute toxicity\") {\n result = { valid: false, message: `The 'outcome_of_treatment' field should be 'Treatment stopped due to acute toxicity' if the '${$name}' field is submitted.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"]}}},"hematological_toxicity":{"restrictions":{"codeList":{"left":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5"],"right":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"data":{"added":["Unknown"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n if (($row.toxicity_type != null && !(checkforEmpty($row.toxicity_type)))) { \n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n \n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}},"non-hematological_toxicity":{"restrictions":{"codeList":{"left":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"right":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"data":{"added":["Unknown"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n if (($row.toxicity_type != null && !(checkforEmpty($row.toxicity_type)))) { \n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n \n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}},"adverse_events":{"restrictions":{"codeList":{"left":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"right":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"data":{"added":["None","Unknown"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"clinical_trials_database":{"meta":{"notes":{"left":null,"right":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added."}},"restrictions":{"codeList":{"left":["NCI Clinical Trials","EU Clinical Trials Register"],"right":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"],"data":{"added":["Not applicable","Unknown"],"deleted":[]}}}},"clinical_trial_number":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"]}}}},"created":{"response_to_treatment_criteria_method":{"changeType":"created","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}}},"deleted":{}},"chemotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"created","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"created","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"created","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"created","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}},"deleted":{"chemotherapy_dosage_units":{"changeType":"deleted","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate the total actual drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true,"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"created","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{"hormone_drug_dosage_units":{"changeType":"deleted","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true,"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"radiation":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"radiation_therapy_dosage":{"valueType":{"left":"integer","right":"number"}},"anatomical_site_irradiated":{"description":{"left":"Indicate localization site where radiation therapy was administered.","right":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)"},"restrictions":{"codeList":{"left":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"right":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"data":{"added":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"],"deleted":["Bone","Extremities","Head-Neck","Peritoneum"]}}}}},"created":{"radiation_boost":{"changeType":"created","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"created","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}},"deleted":{}},"immunotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"immunotherapy_type":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"required":{"left":null,"right":true}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"immunotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"displayName":{"left":"Immunotherapy Drug Name","right":"Chemotherapy Drug Name"},"dependsOn":{"left":null,"right":"immunotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"created","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{}},"follow_up":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_follow_up_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"interval_of_followup":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"treatment.submitter_treatment_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"relapse_type":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"relapse_interval":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"method_of_progression_status":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_t_category":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"recurrence_n_category":{"meta":{"core":{"left":true,"right":null}}},"recurrence_m_category":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"recurrence_stage_group":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Cannot be assessed"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n \n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"posttherapy_tumour_staging_system":{"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"posttherapy_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"posttherapy_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"posttherapy_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Cannot be assessed"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n \n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}}},"created":{"anatomic_site_progression_or_recurrence":{"changeType":"created","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"anatomic_site_progression_or_recurrences":{"changeType":"deleted","description":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1,C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}}}},"family_history":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"family_relative_id":{"meta":{"primaryId":{"left":null,"right":true}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"relationship_type":{"restrictions":{"codeList":{"left":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Sister","Son","Unknown"],"right":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"],"data":{"added":["Maternal Uncle","Paternal Uncle","Uncle"],"deleted":[]}}}}},"created":{},"deleted":{}},"surgery":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"created","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"created","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"created","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"created","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"created","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"created","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"created","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"created","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"created","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"created","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"created","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"created","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"created","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"created","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}},"deleted":{}},"exposure":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"created","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"created","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"created","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"created","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"created","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"created","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"created","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"created","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"created","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"created","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"created","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"created","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"created","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}},"deleted":{}},"biomarker":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"created","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"created","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"created","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"created","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"created","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"created","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"created","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"created","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"created","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"created","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"created","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"created","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"created","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"created","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"created","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"created","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"created","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"created","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"created","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}},"deleted":{}},"comorbidity":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"created","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"created","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"created","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"created","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"created","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"created","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}},"deleted":{}}}} diff --git a/scripts/data/schemas/schema-versions.json b/scripts/data/schemas/schema-versions.json index 913d83bb..b2b78272 100644 --- a/scripts/data/schemas/schema-versions.json +++ b/scripts/data/schemas/schema-versions.json @@ -1,33 +1 @@ -[ - { "version": "1.23", "date": "2024-08-19T16:49:03.624Z" }, - { "version": "1.22", "date": "2024-04-18T15:20:13.668Z" }, - { "version": "1.21", "date": "2024-02-06T17:46:37.784Z" }, - { "version": "1.20", "date": "2023-10-27T20:06:58.227Z" }, - { "version": "1.19", "date": "2023-10-18T19:35:24.055Z" }, - { "version": "1.18", "date": "2023-08-25T15:45:15.320Z" }, - { "version": "1.17", "date": "2023-05-10T19:23:31.428Z" }, - { "version": "1.16", "date": "2022-12-22T21:34:51.645Z" }, - { "version": "1.15", "date": "2022-09-23T20:14:56.970Z" }, - { "version": "1.14", "date": "2022-06-16T19:14:29.303Z" }, - { "version": "1.13", "date": "2021-11-17T17:11:23.272Z" }, - { "version": "1.12", "date": "2021-09-02T15:22:35.426Z" }, - { "version": "1.11", "date": "2021-07-21T15:18:56.040Z" }, - { "version": "1.10", "date": "2021-06-08T15:08:16.060Z" }, - { "version": "1.9", "date": "2021-05-07T20:36:01.508Z" }, - { "version": "1.8", "date": "2021-04-27T20:55:03.034Z" }, - { "version": "1.7", "date": "2021-03-15T16:44:50.896Z" }, - { "version": "1.5", "date": "2020-12-11T19:45:31.441Z" }, - { "version": "1.4", "date": "2020-12-11T17:05:35.605Z" }, - { "version": "1.3", "date": "2020-11-24T17:53:13.272Z" }, - { "version": "1.2", "date": "2020-08-05T18:55:43.082Z" }, - { "version": "1.1", "date": "2020-07-16T20:03:43.021Z" }, - { "version": "1.0", "date": "2020-06-19T18:45:52.437Z" }, - { "version": "0.15", "date": "2020-06-17T17:26:07.747Z" }, - { "version": "0.14", "date": "2020-06-04T16:53:19.349Z" }, - { "version": "0.12", "date": "2020-05-28T19:50:37.756Z" }, - { "version": "0.11", "date": "2020-05-13T21:11:56.331Z" }, - { "version": "0.10", "date": "2020-04-13T16:37:27.645Z" }, - { "version": "0.7", "date": "2020-03-30T21:40:09.710Z" }, - { "version": "0.6", "date": "2020-03-27T20:53:14.913Z" }, - { "version": "0.5", "date": "2020-03-06T21:28:41.074Z" } -] +[{"version":"1.24","date":"2024-10-01T09:32:15.397Z"},{"version":"1.23","date":"2024-08-19T16:49:03.624Z"},{"version":"1.22","date":"2024-04-18T15:20:13.668Z"},{"version":"1.21","date":"2024-02-06T17:46:37.784Z"},{"version":"1.20","date":"2023-10-27T20:06:58.227Z"},{"version":"1.19","date":"2023-10-18T19:35:24.055Z"},{"version":"1.18","date":"2023-08-25T15:45:15.320Z"},{"version":"1.17","date":"2023-05-10T19:23:31.428Z"},{"version":"1.16","date":"2022-12-22T21:34:51.645Z"},{"version":"1.15","date":"2022-09-23T20:14:56.970Z"},{"version":"1.14","date":"2022-06-16T19:14:29.303Z"},{"version":"1.13","date":"2021-11-17T17:11:23.272Z"},{"version":"1.12","date":"2021-09-02T15:22:35.426Z"},{"version":"1.11","date":"2021-07-21T15:18:56.040Z"},{"version":"1.10","date":"2021-06-08T15:08:16.060Z"},{"version":"1.9","date":"2021-05-07T20:36:01.508Z"},{"version":"1.8","date":"2021-04-27T20:55:03.034Z"},{"version":"1.7","date":"2021-03-15T16:44:50.896Z"},{"version":"1.5","date":"2020-12-11T19:45:31.441Z"},{"version":"1.4","date":"2020-12-11T17:05:35.605Z"},{"version":"1.3","date":"2020-11-24T17:53:13.272Z"},{"version":"1.2","date":"2020-08-05T18:55:43.082Z"},{"version":"1.1","date":"2020-07-16T20:03:43.021Z"},{"version":"1.0","date":"2020-06-19T18:45:52.437Z"},{"version":"0.15","date":"2020-06-17T17:26:07.747Z"},{"version":"0.14","date":"2020-06-04T16:53:19.349Z"},{"version":"0.12","date":"2020-05-28T19:50:37.756Z"},{"version":"0.11","date":"2020-05-13T21:11:56.331Z"},{"version":"0.10","date":"2020-04-13T16:37:27.645Z"},{"version":"0.7","date":"2020-03-30T21:40:09.710Z"},{"version":"0.6","date":"2020-03-27T20:53:14.913Z"},{"version":"0.5","date":"2020-03-06T21:28:41.074Z"}] \ No newline at end of file diff --git a/website/src/pages/dictionary/data.json b/website/src/pages/dictionary/data.json index 6b250166..dc314aca 100644 --- a/website/src/pages/dictionary/data.json +++ b/website/src/pages/dictionary/data.json @@ -1,5474 +1 @@ -{ - "dictionary": { - "schemas": [ - { - "name": "sample_registration", - "description": "The collection of data elements required to register the required Donor-Specimen-Sample data to the ARGO Data Platform. Registration of samples is required before molecular and clinical data submission can proceed.", - "fields": [ - { - "name": "program_id", - "valueType": "string", - "description": "Unique identifier of the ARGO program.", - "meta": { - "validationDependency": true, - "primaryId": true, - "examples": "TEST-CA", - "notes": "This is the unique id that is assigned to your program. If you have logged into the platform, this is the Program Id that you see in the Program Services area. For example, TEST-CA is a Program ID.", - "displayName": "Program ID" - }, - "restrictions": { "required": true } - }, - { - "name": "submitter_donor_id", - "valueType": "string", - "description": "Unique identifier of the donor, assigned by the data provider.", - "meta": { - "validationDependency": true, - "primaryId": true, - "examples": "90234,BLD_donor_89,AML-90", - "displayName": "Submitter Donor ID" - }, - "restrictions": { "required": true, "regex": "^[A-Za-z0-9\\-\\._]{1,64}$" } - }, - { - "name": "gender", - "valueType": "string", - "description": "Description of the donor self-reported gender. Gender is described as the assemblage of properties that distinguish people on the basis of their societal roles.", - "meta": { "validationDependency": true, "core": true, "displayName": "Gender" }, - "restrictions": { "required": true, "codeList": ["Female", "Male", "Other"] } - }, - { - "name": "submitter_specimen_id", - "valueType": "string", - "description": "Unique identifier of the specimen, assigned by the data provider.", - "meta": { - "validationDependency": true, - "primaryId": true, - "examples": "LAML_PO,00445,THY_099-tumour", - "displayName": "Submitter Specimen ID" - }, - "restrictions": { "required": true, "regex": "^[A-Za-z0-9\\-\\._]{1,64}$" } - }, - { - "name": "specimen_tissue_source", - "valueType": "string", - "description": "Tissue source of the biospecimen.", - "meta": { - "validationDependency": true, - "core": true, - "displayName": "Specimen Tissue Source" - }, - "restrictions": { - "required": true, - "codeList": [ - "Blood derived - bone marrow", - "Blood derived - peripheral blood", - "Blood derived", - "Bone marrow", - "Bone", - "Buccal cell", - "Buffy coat", - "Cerebellum", - "Cerebrospinal fluid", - "Endometrium", - "Esophagus", - "Intestine", - "Lymph node", - "Mononuclear cells from bone marrow", - "Other", - "Plasma", - "Pleural effusion", - "Saliva", - "Serum", - "Skin", - "Solid tissue", - "Spleen", - "Sputum", - "Stomach", - "Tonsil", - "Urine" - ] - } - }, - { - "name": "tumour_normal_designation", - "valueType": "string", - "description": "Description of specimens tumour/normal status for data processing.", - "restrictions": { "required": true, "codeList": ["Normal", "Tumour"] }, - "meta": { - "validationDependency": true, - "core": true, - "displayName": "Tumour Normal Designation" - } - }, - { - "name": "specimen_type", - "valueType": "string", - "description": "Description of the kind of specimen that was collected with respect to tumour/normal tissue origin.", - "restrictions": { - "required": true, - "codeList": [ - "Cell line - derived from metastatic tumour", - "Cell line - derived from normal", - "Cell line - derived from tumour", - "Cell line - derived from xenograft tumour", - "Metastatic tumour - additional metastatic", - "Metastatic tumour - metastasis local to lymph node", - "Metastatic tumour - metastasis to distant location", - "Metastatic tumour", - "Normal - tissue adjacent to primary tumour", - "Normal", - "Primary tumour - additional new primary", - "Primary tumour - adjacent to normal", - "Primary tumour", - "Recurrent tumour", - "Tumour - unknown if derived from primary or metastatic", - "Xenograft - derived from metastatic tumour", - "Xenograft - derived from primary tumour", - "Xenograft - derived from tumour cell line" - ], - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })" - ] - }, - "meta": { "validationDependency": true, "core": true, "displayName": "Specimen Type" } - }, - { - "name": "submitter_sample_id", - "valueType": "string", - "description": "Unique identifier of the sample, assigned by the data provider.", - "meta": { - "validationDependency": true, - "primaryId": true, - "examples": "hnc_12,CCG_34_94583,BRCA47832-3239", - "displayName": "Submitter Sample ID" - }, - "restrictions": { "required": true, "regex": "^[A-Za-z0-9\\-\\._]{1,64}$" } - }, - { - "name": "sample_type", - "valueType": "string", - "description": "Description of the type of molecular sample used for testing.", - "meta": { "validationDependency": true, "core": true, "displayName": "Sample Type" }, - "restrictions": { - "required": true, - "codeList": [ - "Amplified DNA", - "ctDNA", - "Other DNA enrichments", - "Other RNA fractions", - "polyA+ RNA", - "Ribo-Zero RNA", - "Total DNA", - "Total RNA" - ] - } - } - ] - }, - { - "name": "donor", - "description": "The collection of data elements related to a specific donor in an ARGO program.", - "meta": { "parent": "specimen" }, - "fields": [ - { - "name": "program_id", - "valueType": "string", - "description": "Unique identifier of the ARGO program.", - "meta": { - "validationDependency": true, - "primaryId": true, - "foreignKey": "sample_registration.program_id", - "displayName": "Program ID" - }, - "restrictions": { "required": true } - }, - { - "description": "Unique identifier of the donor, assigned by the data provider.", - "name": "submitter_donor_id", - "valueType": "string", - "meta": { - "validationDependency": true, - "primaryId": true, - "foreignKey": "sample_registration.submitter_donor_id", - "displayName": "Submitter Donor ID" - }, - "restrictions": { "required": true, "regex": "^[A-Za-z0-9\\-\\._]{1,64}$" } - }, - { - "description": "Donor's last known state of living or deceased.", - "name": "vital_status", - "restrictions": { "codeList": ["Alive", "Deceased"], "required": true }, - "valueType": "string", - "meta": { "validationDependency": true, "core": true, "displayName": "Vital Status" } - }, - { - "description": "Indicate the cause of a donor's death.", - "name": "cause_of_death", - "restrictions": { - "codeList": ["Died of cancer", "Died of other reasons", "Unknown"], - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })" - ] - }, - "valueType": "string", - "meta": { - "core": true, - "dependsOn": "donor.vital_status", - "notes": "Cause of death is only required to be submitted if the donor's vital_status is Deceased.", - "displayName": "Cause of Death" - } - }, - { - "description": "Interval of how long the donor has survived since primary diagnosis, in days.", - "name": "survival_time", - "valueType": "integer", - "meta": { - "dependsOn": "donor.vital_status", - "notes": "Survival_time is only required to be submitted if the donor's vital_status is Deceased.", - "validationDependency": true, - "units": "days", - "core": "true", - "displayName": "Survival Time" - }, - "restrictions": { - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })" - ], - "range": { "exclusiveMin": 0 } - } - }, - { - "name": "primary_site", - "valueType": "string", - "isArray": true, - "description": "The text term used to describe the primary site of disease, as categorized by the World Health Organization's (WHO) International Classification of Diseases for Oncology (ICD-O). This categorization groups cases into general categories.", - "meta": { - "displayName": "Primary Site", - "core": true, - "notes": "To include multiple values, separate values with a pipe delimiter '|' within your file.", - "examples": "Breast|Ovary" - }, - "restrictions": { - "required": true, - "codeList": [ - "Accessory sinuses", - "Adrenal gland", - "Anus and anal canal", - "Base of tongue", - "Bladder", - "Bones, joints and articular cartilage of limbs", - "Bones, joints and articular cartilage of other and unspecified sites", - "Brain", - "Breast", - "Bronchus and lung", - "Cervix uteri", - "Colon", - "Connective, subcutaneous and other soft tissues", - "Corpus uteri", - "Esophagus", - "Eye and adnexa", - "Floor of mouth", - "Gallbladder", - "Gum", - "Heart, mediastinum, and pleura", - "Hematopoietic and reticuloendothelial systems", - "Hypopharynx", - "Kidney", - "Larynx", - "Lip", - "Liver and intrahepatic bile ducts", - "Lymph nodes", - "Meninges", - "Nasal cavity and middle ear", - "Nasopharynx", - "Oropharynx", - "Other and ill-defined digestive organs", - "Other and ill-defined sites", - "Other and ill-defined sites in lip, oral cavity and pharynx", - "Other and ill-defined sites within respiratory system and intrathoracic organs", - "Other and unspecified female genital organs", - "Other and unspecified major salivary glands", - "Other and unspecified male genital organs", - "Other and unspecified parts of biliary tract", - "Other and unspecified parts of mouth", - "Other and unspecified parts of tongue", - "Other and unspecified urinary organs", - "Other endocrine glands and related structures", - "Ovary", - "Palate", - "Pancreas", - "Parotid gland", - "Penis", - "Peripheral nerves and autonomic nervous system", - "Placenta", - "Prostate gland", - "Pyriform sinus", - "Rectosigmoid junction", - "Rectum", - "Renal pelvis", - "Retroperitoneum and peritoneum", - "Skin", - "Small intestine", - "Spinal cord, cranial nerves, and other parts of central nervous system", - "Stomach", - "Testis", - "Thymus", - "Thyroid gland", - "Tonsil", - "Trachea", - "Unknown primary site", - "Ureter", - "Uterus, NOS", - "Vagina", - "Vulva" - ] - } - }, - { - "description": "Indicate the donor's height, in centimeters (cm).", - "name": "height", - "valueType": "number", - "restrictions": { "range": { "exclusiveMin": 0 } }, - "meta": { "displayName": "Height" } - }, - { - "description": "Indicate the donor's weight, in kilograms (kg).", - "name": "weight", - "valueType": "number", - "restrictions": { "range": { "exclusiveMin": 0 } }, - "meta": { "displayName": "Weight" } - }, - { - "description": "Indicate the donor's Body Mass Index (BMI) in kg/m².", - "name": "bmi", - "valueType": "number", - "restrictions": { "range": { "exclusiveMin": 0 } }, - "meta": { "displayName": "BMI" } - }, - { - "description": "Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)", - "name": "genetic_disorders", - "valueType": "string", - "isArray": true, - "restrictions": { - "codeList": [ - "Alpha-1-antitrypsin Deficiency", - "Ataxia Telangiectasia Syndrome", - "BAP1-related Tumor Predisposition Syndrome", - "Beckwith-Wiedemann Syndrome", - "Birt-Hogg-Dub Syndrome", - "Bloom Syndrome", - "Carney Complex", - "Cowden Syndrome", - "Familial Adenomatous Polyposis Syndrome (FAP)", - "Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)", - "Familial Gastrointestinal Stromal Tumor", - "Fanconi Anemia", - "Gardner Syndrome", - "Glycogen Storage Disease", - "Gorlin Syndrome", - "Hereditary Breast and Ovarian Cancer Syndrome (HBOC)", - "Hereditary Diffuse Gastric Cancer", - "Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)", - "Hereditary Pancreatitis", - "Hereditary Papillary Renal Cell Carcinoma", - "Hereditary Retinoblastoma", - "Juvenile Polyposis Syndrome", - "Li-Fraumeni Syndrome", - "Lynch Syndrome", - "Muir-Torre Syndrome", - "Multiple Endocrine Neoplasia Type 1 (MEN1)", - "Multiple Endocrine Neoplasia type 2 (MEN2)", - "MUTYH Polyposis Syndrome", - "Neurofibromatosis Type 1", - "Neurofibromatosis Type 2", - "None", - "Not applicable", - "Peutz-Jeghers Syndrome", - "PTEN hamartoma Tumor Syndrome", - "Rubinstein-Taybi Syndrome", - "Serrated Polyposis Syndrome", - "Sjogren Syndrome", - "Tuberous Sclerosis Complex", - "Turcot Syndrome", - "Tyrosinemia Type 1", - "Unknown", - "von Hippel-Lindau Syndrome", - "Werner Syndrome", - "Wiskott-Aldrich Syndrome", - "Xeroderma Pigmentosum" - ] - }, - "meta": { - "displayName": "Genetic Disorders", - "notes": "If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.", - "examples": "Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome" - } - }, - { - "description": "Indicate the donor's menopause status at the time of primary diagnosis. (Reference: caDSR CDE ID 2434914)", - "name": "menopause_status", - "restrictions": { - "codeList": [ - "Not applicable", - "Perimenopausal", - "Postmenopausal", - "Premenopausal", - "Unknown" - ] - }, - "valueType": "string", - "meta": { "displayName": "Menopause Status" } - }, - { - "description": "Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)", - "name": "age_at_menarche", - "valueType": "integer", - "restrictions": { "range": { "exclusiveMin": 0 } }, - "meta": { "displayName": "Age at Menarche" } - }, - { - "description": "Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)", - "name": "number_of_pregnancies", - "valueType": "integer", - "restrictions": { "range": { "min": 0 } }, - "meta": { "displayName": "Number of Pregnancies" } - }, - { - "description": "Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)", - "name": "number_of_children", - "valueType": "integer", - "restrictions": { "range": { "min": 0 } }, - "meta": { "displayName": "Number of Children" } - }, - { - "description": "Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.", - "name": "hrt_type", - "restrictions": { - "codeList": [ - "Combination HRT", - "Estrogen-only HRT", - "Injectable", - "Never taken HRT", - "Not applicable", - "Other", - "Patch", - "Pill", - "Unknown" - ] - }, - "valueType": "string", - "meta": { "displayName": "Hormone Replacement Therapy Type" } - }, - { - "description": "If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)", - "name": "hrt_duration", - "valueType": "integer", - "restrictions": { - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })" - ], - "range": { "exclusiveMin": 0 } - }, - "meta": { - "displayName": "Hormone Replacement Therapy Duration", - "units": "months", - "dependsOn": "donor.hrt_type" - } - }, - { - "description": "Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)", - "name": "contraception_type", - "restrictions": { - "codeList": [ - "Combination pill", - "Contraceptive implant", - "Contraceptive patch", - "Injectable", - "Intrauterine device", - "Never used hormonal contraception", - "Not applicable", - "Oral contraceptive pill", - "Other", - "Progestin-only pill", - "Unknown", - "Vaginal ring" - ] - }, - "valueType": "string", - "meta": { "displayName": "Contraception Type" } - }, - { - "description": "If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)", - "name": "contraception_duration", - "valueType": "integer", - "restrictions": { - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })" - ], - "range": { "exclusiveMin": 0 } - }, - "meta": { - "displayName": "Hormonal Contraception Duration", - "units": "months", - "dependsOn": "donor.contraception_type" - } - }, - { - "description": "If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.", - "name": "lost_to_followup_after_clinical_event_id", - "valueType": "string", - "restrictions": { - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })" - ] - }, - "meta": { - "displayName": "Lost To Follow Up After Clinical Event", - "foreignKey": "primary_diagnosis.submitter_primary_diagnosis_id", - "validationDependency": true - } - } - ] - }, - { - "name": "specimen", - "description": "The collection of data elements related to a donor's specimen. A specimen is any material sample taken for testing, diagnostic or research purposes.", - "meta": { "parent": "sample_registration" }, - "fields": [ - { - "name": "program_id", - "valueType": "string", - "description": "Unique identifier of the ARGO program.", - "meta": { - "validationDependency": true, - "primaryId": true, - "foreignKey": "sample_registration.program_id", - "displayName": "Program ID" - }, - "restrictions": { "required": true } - }, - { - "name": "submitter_donor_id", - "description": "Unique identifier of the donor, assigned by the data provider.", - "valueType": "string", - "meta": { - "validationDependency": true, - "primaryId": true, - "foreignKey": "sample_registration.submitter_donor_id", - "displayName": "Submitter Donor ID" - }, - "restrictions": { "required": true, "regex": "^[A-Za-z0-9\\-\\._]{1,64}$" } - }, - { - "name": "submitter_specimen_id", - "description": "Unique identifier of the specimen, assigned by the data provider.", - "valueType": "string", - "meta": { - "validationDependency": true, - "primaryId": true, - "foreignKey": "sample_registration.submitter_specimen_id", - "displayName": "Submitter Specimen ID" - }, - "restrictions": { "required": true, "regex": "^[A-Za-z0-9\\-\\._]{1,64}$" } - }, - { - "name": "submitter_primary_diagnosis_id", - "valueType": "string", - "description": "Indicate the primary diagnosis event in the clinical timeline that this specimen acquisition was related to.", - "meta": { - "validationDependency": true, - "primaryId": true, - "foreignKey": "primary_diagnosis.submitter_primary_diagnosis_id", - "displayName": "Submitter Primary Diagnosis ID" - }, - "restrictions": { "required": true, "regex": "^[A-Za-z0-9\\-\\._]{1,64}$" } - }, - { - "name": "pathological_tumour_staging_system", - "description": "Specify the tumour staging system used to assess the cancer at the time the tumour specimen was resected. Pathological classification is based on the clinical stage information (acquired before treatment) and supplemented/modified by operative findings and pathological evaluation of the resected specimen.", - "valueType": "string", - "meta": { - "validationDependency": true, - "core": true, - "dependsOn": "sample_registration.tumour_normal_designation", - "notes": "This field is only required if the specimen is a tumour.", - "displayName": "Pathological Tumour Staging System" - }, - "restrictions": { - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })" - ], - "codeList": [ - "AJCC 8th edition", - "AJCC 7th edition", - "AJCC 6th edition", - "Ann Arbor staging system", - "Binet staging system", - "Durie-Salmon staging system", - "FIGO staging system", - "Lugano staging system", - "Rai staging system", - "Revised International staging system (R-ISS)", - "St Jude staging system" - ] - } - }, - { - "name": "pathological_t_category", - "description": "The code to represent the stage of cancer defined by the size or contiguous extension of the primary tumour (T), according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.", - "valueType": "string", - "meta": { - "core": true, - "dependsOn": "specimen.pathological_tumour_staging_system", - "notes": "This field is required only if the selected pathological_tumour_staging_system is any edition of the AJCC cancer staging system.", - "displayName": "Pathological T Category" - }, - "restrictions": { - "codeList": [ - "T0", - "T1", - "T1a", - "T1a1", - "T1a2", - "T1a(s)", - "T1a(m)", - "T1b", - "T1b1", - "T1b2", - "T1b(s)", - "T1b(m)", - "T1c", - "T1d", - "T1mi", - "T2", - "T2(s)", - "T2(m)", - "T2a", - "T2a1", - "T2a2", - "T2b", - "T2c", - "T2d", - "T3", - "T3(s)", - "T3(m)", - "T3a", - "T3b", - "T3c", - "T3d", - "T3e", - "T4", - "T4a", - "T4a(s)", - "T4a(m)", - "T4b", - "T4b(s)", - "T4b(m)", - "T4c", - "T4d", - "T4e", - "Ta", - "Tis", - "Tis(DCIS)", - "Tis(LAMN)", - "Tis(LCIS)", - "Tis(Paget)", - "Tis(Paget’s)", - "Tis pd", - "Tis pu", - "TX" - ] - } - }, - { - "name": "pathological_n_category", - "description": "The code to represent the stage of cancer defined by whether or not the cancer has reached nearby lymph nodes (N), according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.", - "valueType": "string", - "meta": { - "core": true, - "dependsOn": "specimen.pathological_tumour_staging_system", - "notes": "This field is required only if the selected pathological_tumour_staging_system is any edition of the AJCC cancer staging system.", - "displayName": "Pathological N Category" - }, - "restrictions": { - "codeList": [ - "N0", - "N0a", - "N0a (biopsy)", - "N0b", - "N0b (no biopsy)", - "N0(i+)", - "N0(i-)", - "N0(mol+)", - "N0(mol-)", - "N1", - "N1a", - "N1a(sn)", - "N1b", - "N1c", - "N1mi", - "N2", - "N2a", - "N2b", - "N2c", - "N2mi", - "N3", - "N3a", - "N3b", - "N3c", - "N4", - "NX" - ] - } - }, - { - "name": "pathological_m_category", - "description": "The code to represent the stage of cancer defined by whether there are distant metastases (M), meaning spread of cancer to other parts of the body, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.", - "valueType": "string", - "meta": { - "core": true, - "dependsOn": "specimen.pathological_tumour_staging_system", - "notes": "This field is required only if the selected pathological_tumour_staging_system is any edition of the AJCC cancer staging system.", - "displayName": "Pathological M Category" - }, - "restrictions": { - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})" - ], - "codeList": [ - "M0", - "M0(i+)", - "M1", - "M1a", - "M1a(0)", - "M1a(1)", - "M1b", - "M1b(0)", - "M1b(1)", - "M1c", - "M1c(0)", - "M1c(1)", - "M1d", - "M1d(0)", - "M1d(1)", - "M1e", - "MX", - "Not applicable" - ] - } - }, - { - "name": "pathological_stage_group", - "description": "Specify the tumour stage, based on pathological_tumour_staging_system, used to assess the cancer at the time the tumour specimen was resected.", - "valueType": "string", - "meta": { - "core": true, - "dependsOn": "specimen.pathological_tumour_staging_system", - "notes": "This field depends on the selected pathological_tumour_staging_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications", - "displayName": "Pathological Stage Group" - }, - "restrictions": { - "codeList": [ - "Occult Carcinoma", - "Stage 0", - "Stage 0a", - "Stage 0is", - "Stage 1", - "Stage 1A", - "Stage 1B", - "Stage A", - "Stage B", - "Stage C", - "Stage I", - "Stage IA", - "Stage IA1", - "Stage IA2", - "Stage IA3", - "Stage IAB", - "Stage IAE", - "Stage IAES", - "Stage IAS", - "Stage IB", - "Stage IB1", - "Stage IB2", - "Stage IBE", - "Stage IBES", - "Stage IBS", - "Stage IC", - "Stage IE", - "Stage IEA", - "Stage IEB", - "Stage IES", - "Stage II", - "Stage II bulky", - "Stage IIA", - "Stage IIA1", - "Stage IIA2", - "Stage IIAE", - "Stage IIAES", - "Stage IIAS", - "Stage IIB", - "Stage IIBE", - "Stage IIBES", - "Stage IIBS", - "Stage IIC", - "Stage IIE", - "Stage IIEA", - "Stage IIEB", - "Stage IIES", - "Stage III", - "Stage IIIA", - "Stage IIIA1", - "Stage IIIA2", - "Stage IIIAE", - "Stage IIIAES", - "Stage IIIAS", - "Stage IIIB", - "Stage IIIBE", - "Stage IIIBES", - "Stage IIIBS", - "Stage IIIC", - "Stage IIIC1", - "Stage IIIC2", - "Stage IIID", - "Stage IIIE", - "Stage IIIES", - "Stage IIIS", - "Stage IIS", - "Stage IS", - "Stage IV", - "Stage IVA", - "Stage IVA1", - "Stage IVA2", - "Stage IVAE", - "Stage IVAES", - "Stage IVAS", - "Stage IVB", - "Stage IVBE", - "Stage IVBES", - "Stage IVBS", - "Stage IVC", - "Stage IVE", - "Stage IVES", - "Stage IVS", - "Cannot be assessed" - ], - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })" - ] - } - }, - { - "name": "specimen_acquisition_interval", - "description": "Interval between primary diagnosis and specimen acquisition, in days.", - "valueType": "integer", - "meta": { - "validationDependency": true, - "units": "days", - "core": true, - "notes": "The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.", - "displayName": "Specimen Acquisition Interval" - }, - "restrictions": { "required": true } - }, - { - "name": "tumour_histological_type", - "description": "The code to represent the histology (morphology) of neoplasms that is usually obtained from a pathology report, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.", - "valueType": "string", - "meta": { - "validationDependency": true, - "core": true, - "dependsOn": "sample_registration.tumour_normal_designation", - "notes": "This field is only required if the specimen is a tumour.", - "examples": "8260/3,9691/36", - "displayName": "Tumour Histological Type" - }, - "restrictions": { "regex": "^[8,9]{1}[0-9]{3}/[0,1,2,3,6,9]{1}[1-9]{0,1}$" } - }, - { - "name": "specimen_anatomic_location", - "description": "Indicate the ICD-O-3 topography code for the anatomic location of a specimen when it was collected. Refer to the guidelines provided in the ICD-O-3 manual at https://apps.who.int/iris/handle/10665/42344.", - "valueType": "string", - "meta": { - "core": true, - "displayName": "Specimen Anatomic Location", - "examples": "C50.1,C18" - }, - "restrictions": { "required": true, "regex": "^[C][0-9]{2}(.[0-9]{1})?$" } - }, - { - "name": "specimen_laterality", - "description": "For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)", - "valueType": "string", - "restrictions": { "codeList": ["Left", "Not applicable", "Right", "Unknown"] }, - "meta": { "displayName": "Specimen Laterality" } - }, - { - "name": "specimen_processing", - "description": "Indicate the technique used to process specimen.", - "valueType": "string", - "restrictions": { - "codeList": [ - "Cryopreservation in liquid nitrogen (dead tissue)", - "Cryopreservation in dry ice (dead tissue)", - "Cryopreservation of live cells in liquid nitrogen", - "Cryopreservation - other", - "Formalin fixed & paraffin embedded", - "Formalin fixed - buffered", - "Formalin fixed - unbuffered", - "Fresh", - "Other", - "Unknown" - ] - }, - "meta": { "displayName": "Specimen Processing" } - }, - { - "name": "specimen_storage", - "description": "Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured.", - "valueType": "string", - "meta": { - "notes": "For specimens that were freshly extracted or immediately cultured, select Not Applicable.", - "displayName": "Specimen Storage" - }, - "restrictions": { - "codeList": [ - "Cut slide", - "Frozen in -70 freezer", - "Frozen in liquid nitrogen", - "Frozen in vapour phase", - "Not Applicable", - "Other", - "Paraffin block", - "RNA later frozen", - "Unknown" - ] - } - }, - { - "name": "reference_pathology_confirmed", - "description": "Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)", - "valueType": "string", - "meta": { - "validationDependency": true, - "core": true, - "dependsOn": "sample_registration.tumour_normal_designation", - "notes": "This field is only required if the specimen is a tumour.", - "displayName": "Reference Pathology Confirmed" - }, - "restrictions": { "codeList": ["Yes", "No", "Unknown"] } - }, - { - "name": "tumour_grading_system", - "description": "Specify the tumour staging system used to assess the description of a tumour based on how abnormal the tumour cells and the tumour tissue look under a microscope. Tumour grade is an indicator of how quickly a tumour is likely to grow.", - "valueType": "string", - "meta": { - "validationDependency": true, - "core": true, - "dependsOn": "sample_registration.tumour_normal_designation", - "notes": "This field is only required if the specimen is a tumour.", - "displayName": "Tumour Grading System" - }, - "restrictions": { - "codeList": [ - "FNCLCC grading system", - "Four-tier grading system", - "Gleason grade group system", - "Grading system for GISTs", - "Grading system for GNETs", - "ISUP grading system", - "Nuclear grading system for DCIS", - "Scarff-Bloom-Richardson grading system", - "Three-tier grading system", - "Two-tier grading system", - "WHO grading system for CNS tumours" - ] - } - }, - { - "name": "tumour_grade", - "description": "Grade of the tumour as assigned by the reporting tumour_grading_system.", - "valueType": "string", - "meta": { - "core": true, - "dependsOn": "specimen.tumour_grading_system", - "notes": "This field depends on the selected tumour_grading_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Grading Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-grading-classifications", - "displayName": "Tumour Grade" - }, - "restrictions": { - "codeList": [ - "Low grade", - "High grade", - "GX", - "G1", - "G2", - "G3", - "G4", - "Low", - "High", - "Grade I", - "Grade II", - "Grade III", - "Grade IV", - "Grade Group 1", - "Grade Group 2", - "Grade Group 3", - "Grade Group 4", - "Grade Group 5" - ], - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })" - ] - } - }, - { - "name": "percent_tumour_cells", - "description": "Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)", - "valueType": "number", - "meta": { - "core": true, - "dependsOn": "sample_registration.tumour_normal_designation", - "notes": "This field is only required if the specimen is a tumour.", - "displayName": "Percent Tumour Cells" - }, - "restrictions": { - "range": { "min": 0, "max": 1 }, - "script": [ - "(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })" - ] - } - }, - { - "name": "percent_tumour_cells_measurement_method", - "description": "Indicate method used to measure percent_tumour_cells.", - "valueType": "string", - "meta": { - "core": true, - "dependsOn": "sample_registration.tumour_normal_designation", - "notes": "This field is only required if the specimen is a tumour.", - "displayName": "Percent Tumour Cells Measurement Method" - }, - "restrictions": { - "codeList": ["Genomics", "Image analysis", "Pathology estimate by percent nuclei"] - } - }, - { - "name": "percent_proliferating_cells", - "description": "Indicate a value, in decimals, that represents the count of proliferating cells determined during pathologic review of the specimen.", - "valueType": "number", - "meta": { - "dependsOn": "sample_registration.tumour_normal_designation", - "notes": "This field should only be submitted if the specimen is tumour.", - "displayName": "Percent Proliferating Cells" - }, - "restrictions": { "range": { "min": 0, "max": 1 } } - }, - { - "name": "percent_inflammatory_tissue", - "description": "Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)", - "valueType": "number", - "meta": { - "dependsOn": "sample_registration.tumour_normal_designation", - "notes": "This field should only be submitted if the specimen is tumour.", - "displayName": "Percent Inflammatory Tissue" - }, - "restrictions": { "range": { "min": 0, "max": 1 } } - }, - { - "name": "percent_stromal_cells", - "description": "Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)", - "valueType": "number", - "meta": { - "dependsOn": "sample_registration.tumour_normal_designation", - "notes": "This field should only be submitted if the specimen is tumour.", - "displayName": "Percent Stromal Cells" - }, - "restrictions": { "range": { "min": 0, "max": 1 } } - }, - { - "name": "percent_necrosis", - "description": "Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)", - "valueType": "number", - "meta": { - "dependsOn": "sample_registration.tumour_normal_designation", - "notes": "This field should only be submitted if the specimen is tumour.", - "displayName": "Percent Necrosis" - }, - "restrictions": { "range": { "min": 0, "max": 1 } } - } - ] - }, - { - "name": "primary_diagnosis", - "description": "The collection of data elements related to a donor's primary diagnosis. The primary diagnosis is the first diagnosed case of cancer in a donor. To submit multiple primary diagnoses for a single donor, submit multiple rows in the primary diagnosis file for this donor.", - "meta": { "parent": "donor" }, - "fields": [ - { - "name": "program_id", - "valueType": "string", - "description": "Unique identifier of the ARGO program.", - "meta": { - "validationDependency": true, - "primaryId": true, - "foreignKey": "sample_registration.program_id", - "displayName": "Program ID" - }, - "restrictions": { "required": true } - }, - { - "name": "submitter_donor_id", - "valueType": "string", - "description": "Unique identifier of the donor, assigned by the data provider.", - "meta": { - "validationDependency": true, - "primaryId": true, - "foreignKey": "sample_registration.submitter_donor_id", - "displayName": "Submitter Donor ID" - }, - "restrictions": { "required": true, "regex": "^[A-Za-z0-9\\-\\._]{1,64}$" } - }, - { - "name": "submitter_primary_diagnosis_id", - "valueType": "string", - "description": "Unique identifier of the primary diagnosis event, assigned by the data provider.", - "meta": { "primaryId": true, "displayName": "Submitter Primary Diagnosis ID" }, - "restrictions": { "required": true, "regex": "^[A-Za-z0-9\\-\\._]{1,64}$" } - }, - { - "name": "age_at_diagnosis", - "valueType": "integer", - "description": "Age that the donor was first diagnosed with cancer, in years. This should be based on the earliest diagnosis of cancer.", - "restrictions": { "required": true, "range": { "exclusiveMin": 0, "max": 90 } }, - "meta": { "units": "years", "core": true, "displayName": "Age at Diagnosis" } - }, - { - "name": "cancer_type_code", - "valueType": "string", - "description": "The code to represent the cancer type using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.", - "restrictions": { - "required": true, - "regex": "^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$" - }, - "meta": { - "core": true, - "examples": "C41.1,C16.9,C00.5,D46.9", - "displayName": "Cancer Type Code" - } - }, - { - "name": "cancer_type_additional_information", - "valueType": "string", - "description": "Additional details related to the cancer type that are not covered by the ICD-10 code provided in the cancer_type field.", - "meta": { "displayName": "Cancer Type Additional Information" } - }, - { - "name": "basis_of_diagnosis", - "description": "Indicate the most valid basis of how the primary diagnosis was identified. If more than one diagnosis technique was used, select the term that has the highest code number (see notes). (Reference: IACR Standard for Basis of Diagnosis http://www.iacr.com.fr/images/doc/basis.pdf)", - "restrictions": { - "codeList": [ - "Clinical investigation", - "Clinical", - "Cytology", - "Death certificate only", - "Histology of a metastasis", - "Histology of a primary tumour", - "Specific tumour markers", - "Unknown" - ] - }, - "valueType": "string", - "meta": { - "notes": "0: Death certificate only: Information provided is from a death certificate.\n1: Clinical: Diagnosis made before death.\n2: Clinical investigation: All diagnostic techniques, including X-ray, endoscopy, imaging, ultrasound, exploratory surgery (such as laparotomy), and autopsy, without a tissue diagnosis.\n4: Specific tumour markers: Including biochemical and/or immunologic markers that are specific for a tumour site.\n5: Cytology: Examination of cells from a primary or secondary site, including fluids aspirated by endoscopy or needle; also includes the microscopic examination of peripheral blood and bone marrow aspirates.\n6: Histology of a metastasis: Histologic examination of tissue from a metastasis, including autopsy specimens.\n7: Histology of a primary tumour: Histologic examination of tissue from primary tumour, however obtained, including all cutting techniques and bone marrow biopsies; also includes autopsy specimens of primary tumour.\n9: Unknown: No information on how the diagnosis has been made.", - "displayName": "Basis of Diagnosis" - } - }, - { - "name": "laterality", - "description": "For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)", - "valueType": "string", - "restrictions": { - "codeList": [ - "Bilateral", - "Left", - "Midline", - "Not a paired site", - "Right", - "Unilateral, side not specified", - "Unknown" - ] - }, - "meta": { "displayName": "Laterality" } - }, - { - "name": "lymph_nodes_examined_status", - "description": "Indicate if lymph nodes were examined for metastases.", - "valueType": "string", - "restrictions": { - "required": true, - "codeList": [ - "Cannot be determined", - "No", - "No lymph nodes found in resected specimen", - "Not applicable", - "Yes" - ] - }, - "meta": { "core": true, "displayName": "Lymph Nodes Examined Status" } - }, - { - "name": "lymph_nodes_examined_method", - "description": "Indicate the method used to examine lymph nodes.", - "valueType": "string", - "restrictions": { - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})" - ], - "codeList": [ - "Imaging", - "Lymph node dissection/pathological exam", - "Physical palpation of patient" - ] - }, - "meta": { - "core": true, - "dependsOn": "primary_diagnosis.lymph_nodes_examined_status", - "displayName": "Method Used to Examine Lymph Nodes" - } - }, - { - "name": "number_lymph_nodes_examined", - "description": "The total number of lymph nodes tested for the presence of cancer. (Reference: caDSR CDE ID 3)", - "valueType": "integer", - "restrictions": { - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})" - ], - "range": { "min": 0 } - }, - "meta": { - "displayName": "Number Of Lymph Nodes Examined", - "dependsOn": "primary_diagnosis.lymph_nodes_examined_status", - "notes": "This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'." - } - }, - { - "name": "number_lymph_nodes_positive", - "description": "The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: caDSR CDE ID 6113694)", - "valueType": "integer", - "restrictions": { - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})" - ], - "range": { "min": 0 } - }, - "meta": { - "core": true, - "displayName": "Number Of Lymph Nodes Positive", - "dependsOn": "primary_diagnosis.lymph_nodes_examined_status", - "notes": "This field is only required if 'lymph_nodes_examined_status' is 'Yes'." - } - }, - { - "name": "clinical_tumour_staging_system", - "valueType": "string", - "description": "Indicate the tumour staging system used to stage the cancer at the time of primary diagnosis (prior to treatment).", - "restrictions": { - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })" - ], - "codeList": [ - "AJCC 8th edition", - "AJCC 7th edition", - "AJCC 6th edition", - "Ann Arbor staging system", - "Binet staging system", - "Durie-Salmon staging system", - "FIGO staging system", - "Lugano staging system", - "Rai staging system", - "Revised International staging system (R-ISS)", - "St Jude staging system" - ] - }, - "meta": { - "validationDependency": true, - "core": true, - "displayName": "Clinical Tumour Staging System" - } - }, - { - "name": "clinical_t_category", - "description": "The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.", - "valueType": "string", - "meta": { - "core": true, - "dependsOn": "primary_diagnosis.clinical_tumour_staging_system", - "notes": "This field is required only if the selected clinical_tumour_staging_system is any edition of the AJCC cancer staging system.", - "displayName": "Clinical T Category" - }, - "restrictions": { - "codeList": [ - "T0", - "T1", - "T1a", - "T1a1", - "T1a2", - "T1a(s)", - "T1a(m)", - "T1b", - "T1b1", - "T1b2", - "T1b(s)", - "T1b(m)", - "T1c", - "T1d", - "T1mi", - "T2", - "T2(s)", - "T2(m)", - "T2a", - "T2a1", - "T2a2", - "T2b", - "T2c", - "T2d", - "T3", - "T3(s)", - "T3(m)", - "T3a", - "T3b", - "T3c", - "T3d", - "T3e", - "T4", - "T4a", - "T4a(s)", - "T4a(m)", - "T4b", - "T4b(s)", - "T4b(m)", - "T4c", - "T4d", - "T4e", - "Ta", - "Tis", - "Tis(DCIS)", - "Tis(LAMN)", - "Tis(LCIS)", - "Tis(Paget)", - "Tis(Paget’s)", - "Tis pd", - "Tis pu", - "TX" - ] - } - }, - { - "name": "clinical_n_category", - "description": "The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.", - "valueType": "string", - "meta": { - "core": true, - "dependsOn": "primary_diagnosis.clinical_tumour_staging_system", - "notes": "This field is required only if the selected clinical_tumour_staging_system is any edition of the AJCC cancer staging system.", - "displayName": "Clinical N Category" - }, - "restrictions": { - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})" - ], - "codeList": [ - "N0", - "N0a", - "N0a (biopsy)", - "N0b", - "N0b (no biopsy)", - "N0(i+)", - "N0(i-)", - "N0(mol+)", - "N0(mol-)", - "N1", - "N1a", - "N1a(sn)", - "N1b", - "N1c", - "N1mi", - "N2", - "N2a", - "N2b", - "N2c", - "N2mi", - "N3", - "N3a", - "N3b", - "N3c", - "N4", - "NX" - ] - } - }, - { - "name": "clinical_m_category", - "description": "The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned.", - "valueType": "string", - "meta": { - "core": true, - "dependsOn": "primary_diagnosis.clinical_tumour_staging_system", - "notes": "This field is required only if the selected clinical_tumour_staging_system is any edition of the AJCC cancer staging system.", - "displayName": "Clinical M Category" - }, - "restrictions": { - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})" - ], - "codeList": [ - "M0", - "M0(i+)", - "M1", - "M1a", - "M1a(0)", - "M1a(1)", - "M1b", - "M1b(0)", - "M1b(1)", - "M1c", - "M1c(0)", - "M1c(1)", - "M1d", - "M1d(0)", - "M1d(1)", - "M1e", - "MX", - "Not applicable" - ] - } - }, - { - "name": "clinical_stage_group", - "description": "Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage.", - "valueType": "string", - "restrictions": { - "codeList": [ - "Occult Carcinoma", - "Stage 0", - "Stage 0a", - "Stage 0is", - "Stage 1", - "Stage 1A", - "Stage 1B", - "Stage A", - "Stage B", - "Stage C", - "Stage I", - "Stage IA", - "Stage IA1", - "Stage IA2", - "Stage IA3", - "Stage IAB", - "Stage IAE", - "Stage IAES", - "Stage IAS", - "Stage IB", - "Stage IB1", - "Stage IB2", - "Stage IBE", - "Stage IBES", - "Stage IBS", - "Stage IC", - "Stage IE", - "Stage IEA", - "Stage IEB", - "Stage IES", - "Stage II", - "Stage II bulky", - "Stage IIA", - "Stage IIA1", - "Stage IIA2", - "Stage IIAE", - "Stage IIAES", - "Stage IIAS", - "Stage IIB", - "Stage IIBE", - "Stage IIBES", - "Stage IIBS", - "Stage IIC", - "Stage IIE", - "Stage IIEA", - "Stage IIEB", - "Stage IIES", - "Stage III", - "Stage IIIA", - "Stage IIIA1", - "Stage IIIA2", - "Stage IIIAE", - "Stage IIIAES", - "Stage IIIAS", - "Stage IIIB", - "Stage IIIBE", - "Stage IIIBES", - "Stage IIIBS", - "Stage IIIC", - "Stage IIIC1", - "Stage IIIC2", - "Stage IIID", - "Stage IIIE", - "Stage IIIES", - "Stage IIIS", - "Stage IIS", - "Stage IS", - "Stage IV", - "Stage IVA", - "Stage IVA1", - "Stage IVA2", - "Stage IVAE", - "Stage IVAES", - "Stage IVAS", - "Stage IVB", - "Stage IVBE", - "Stage IVBES", - "Stage IVBS", - "Stage IVC", - "Stage IVE", - "Stage IVES", - "Stage IVS", - "Cannot be assessed" - ], - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })" - ] - }, - "meta": { - "core": true, - "dependsOn": "primary_diagnosis.clinical_tumour_staging_system", - "notes": "This field is dependent on the selected clinical_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications", - "displayName": "Clinical Stage Group", - "examples": "Stage I, Stage IIB" - } - }, - { - "name": "presenting_symptoms", - "description": "Indicate presenting symptoms at time of primary diagnosis.", - "valueType": "string", - "isArray": true, - "restrictions": { - "codeList": [ - "Abdominal Pain", - "Anemia", - "Back Pain", - "Bloating", - "Cholangitis", - "Constipation", - "Dark Urine", - "Decreased Appetite", - "Diabetes", - "Diarrhea", - "Fatigue", - "Fever", - "Hypoglycemia", - "Jaundice", - "Loss of Appetite", - "Nausea", - "None", - "Not Reported", - "Pale Stools", - "Pancreatitis", - "Pruritus/Itchiness", - "Steatorrhea", - "Swelling in the Neck", - "Unknown", - "Vomiting", - "Weight Loss" - ] - }, - "meta": { - "displayName": "Presenting Symptoms", - "notes": "To include multiple values, separate values with a pipe delimiter '|' within your file.", - "examples": "Anemia|Bloating|Diabetes" - } - }, - { - "name": "performance_status", - "description": "Indicate the donor's performance status grade at the time of primary diagnosis. (Reference: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status).", - "valueType": "string", - "restrictions": { - "codeList": ["Grade 0", "Grade 1", "Grade 2", "Grade 3", "Grade 4", "Unknown"] - }, - "meta": { - "notes": "Grade 0: Fully active, able to carry on all pre-disease performance without restriction.\nGrade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work).\nGrade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours.\nGrade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours.\nGrade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair", - "displayName": "Performance Status" - } - } - ] - }, - { - "name": "treatment", - "description": "The collection of data elements related to a donor's treatment at a specific point in the clinical record. To submit multiple treatments for a single donor, please submit treatment rows in the treatment file for this donor.", - "meta": { "parent": "donor" }, - "fields": [ - { - "name": "program_id", - "valueType": "string", - "description": "Unique identifier of the ARGO program.", - "meta": { - "validationDependency": true, - "primaryId": true, - "foreignKey": "sample_registration.program_id", - "displayName": "Program ID" - }, - "restrictions": { "required": true } - }, - { - "name": "submitter_donor_id", - "description": "Unique identifier of the donor, assigned by the data provider.", - "valueType": "string", - "meta": { - "validationDependency": true, - "primaryId": true, - "foreignKey": "sample_registration.submitter_donor_id", - "displayName": "Submitter Donor ID" - }, - "restrictions": { "required": true, "regex": "^[A-Za-z0-9\\-\\._]{1,64}$" } - }, - { - "name": "submitter_treatment_id", - "description": "Unique identifier of the treatment, assigned by the data provider.", - "valueType": "string", - "meta": { - "validationDependency": true, - "primaryId": true, - "displayName": "Submitter Treatment ID" - }, - "restrictions": { "required": true, "regex": "^[A-Za-z0-9\\-\\._]{1,64}$" } - }, - { - "name": "submitter_primary_diagnosis_id", - "valueType": "string", - "description": "Indicate the primary diagnosis event in the clinical timeline that this treatment was related to.", - "meta": { - "validationDependency": true, - "primaryId": true, - "foreignKey": "primary_diagnosis.submitter_primary_diagnosis_id", - "displayName": "Submitter Primary Diagnosis ID" - }, - "restrictions": { "required": true, "regex": "^[A-Za-z0-9\\-\\._]{1,64}$" } - }, - { - "name": "treatment_type", - "description": "Indicate the type of treatment regimen that the donor completed.", - "valueType": "string", - "isArray": true, - "restrictions": { - "required": true, - "codeList": [ - "Ablation", - "Bone marrow transplant", - "Chemotherapy", - "Endoscopic therapy", - "End of life care", - "Hormonal therapy", - "Immunotherapy", - "No treatment", - "Other targeting molecular therapy", - "Photodynamic therapy", - "Radiation therapy", - "Stem cell transplant", - "Surgery" - ] - }, - "meta": { - "validationDependency": true, - "core": true, - "notes": "Depending on the treatment_type(s) selected, additional treatment details may be required to be submitted. For example, if treatment_type includes 'Chemotherapy', the supplemental Chemotherapy treatment type file is required.\nTo include multiple values, separate values with a pipe delimiter '|' within your file.", - "displayName": "Treatment Type", - "examples": "Chemotherapy|Hormonal therapy" - } - }, - { - "name": "is_primary_treatment", - "description": "Indicate if the treatment was the primary treatment following the initial diagnosis.", - "valueType": "string", - "restrictions": { - "script": [ - "(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })" - ], - "codeList": ["Yes", "No"] - }, - "meta": { - "core": true, - "displayName": "Is Primary Treatment", - "dependsOn": "treatment.treatment_type" - } - }, - { - "name": "line_of_treatment", - "description": "Indicate the line of treatment if it is not the primary treatment.", - "valueType": "integer", - "restrictions": { - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })" - ] - }, - "meta": { - "displayName": "Line Of treatment", - "dependsOn": "treatment.is_primary_treatment", - "examples": "2,3,4" - } - }, - { - "name": "treatment_start_interval", - "description": "The interval between the primary diagnosis and initiation of treatment, in days.", - "valueType": "integer", - "restrictions": { - "script": [ - "(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })" - ], - "range": { "exclusiveMin": 0 } - }, - "meta": { - "core": true, - "units": "days", - "notes": "The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.", - "displayName": "Treatment Start Interval", - "dependsOn": "treatment.treatment_type" - } - }, - { - "name": "treatment_duration", - "description": "The duration of treatment regimen, in days.", - "valueType": "integer", - "restrictions": { - "script": [ - "(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })" - ], - "range": { "exclusiveMin": 0 } - }, - "meta": { - "core": true, - "units": "days", - "displayName": "Treatment Duration", - "dependsOn": "treatment.treatment_type" - } - }, - { - "name": "days_per_cycle", - "description": "Indicate the number of days in a treatment cycle.", - "valueType": "integer", - "restrictions": { - "script": [ - "(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })" - ], - "range": { "exclusiveMin": 0 } - }, - "meta": { "displayName": "Days Per Cycle", "dependsOn": "treatment.treatment_type" } - }, - { - "name": "number_of_cycles", - "description": "Indicate the number of treatment cycles.", - "valueType": "integer", - "restrictions": { - "script": [ - "(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })" - ], - "range": { "exclusiveMin": 0 } - }, - "meta": { "displayName": "Number Of Cycles", "dependsOn": "treatment.treatment_type" } - }, - { - "name": "treatment_intent", - "description": "Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)", - "valueType": "string", - "restrictions": { - "script": [ - "(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })" - ], - "codeList": [ - "Curative", - "Diagnostic", - "Forensic", - "Guidance", - "Palliative", - "Preventative", - "Screening", - "Supportive" - ] - }, - "meta": { - "core": true, - "displayName": "Treatment Intent", - "dependsOn": "treatment.treatment_type" - } - }, - { - "name": "treatment_setting", - "description": "Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: NCIt C124308)", - "valueType": "string", - "restrictions": { - "script": [ - "(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })" - ], - "codeList": [ - "Adjuvant", - "Advanced/Metastatic", - "Conditioning", - "Induction", - "Maintenance", - "Mobilization", - "Neoadjuvant", - "Preventative", - "Radiosensitization", - "Salvage" - ] - }, - "meta": { - "core": true, - "displayName": "Treatment Setting", - "dependsOn": "treatment.treatment_type" - } - }, - { - "name": "response_to_treatment_criteria_method", - "description": "Indicate the criteria used to assess the donor's response to the applied treatment regimen.", - "valueType": "string", - "restrictions": { - "script": [ - "(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })" - ], - "codeList": [ - "ELN Dohner AML 2017 Oncology Response Criteria", - "IWG Cheson AML 2003 Oncology Response Criteria", - "iRECIST", - "RECIST", - "Response Assessment in Neuro-Oncology (RANO)", - "Physician Assessed Response Criteria" - ] - }, - "meta": { - "core": true, - "displayName": "Response To Treatment Criteria Method", - "validationDependency": true, - "dependsOn": "treatment.treatment_type" - } - }, - { - "name": "response_to_treatment", - "description": "The donor's response to the applied treatment regimen.", - "valueType": "string", - "restrictions": { - "script": [ - "(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })", - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })" - ], - "codeList": [ - "Complete remission", - "Complete remission with incomplete hematologic recovery (CRi)", - "Complete remission without minimal residual disease (CRMRD-)", - "Complete response", - "Cytogenetic complete remission (CRc)", - "Hematologic relapse (after CRMRD-, CR, CRi)", - "Immune complete response (iCR)", - "Immune confirmed progressive disease (iCPD)", - "Immune partial response (iPR)", - "Immune stable disease (iSD)", - "Immune unconfirmed progressive disease (iUPD)", - "Minor response", - "Molecular complete remission (CRm)", - "Molecular relapse (after CRMRD-)", - "Morphologic complete remission", - "Morphologic complete remission with incomplete blood count recovery (CRi)", - "Morphologic leukemia-free state", - "No evidence of disease (NED)", - "Partial remission", - "Partial response", - "Physician assessed complete response", - "Physician assessed partial response", - "Physician assessed progressive disease", - "Physician assessed stable disease", - "Progressive disease", - "Stable disease" - ] - }, - "meta": { - "core": true, - "displayName": "Response To Treatment", - "dependsOn": "treatment.response_to_treatment_criteria_method", - "notes": "This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria" - } - }, - { - "name": "outcome_of_treatment", - "description": "Indicate the donor's outcome of the prescribed treatment.", - "valueType": "string", - "restrictions": { - "codeList": [ - "Treatment completed as prescribed", - "Treatment incomplete due to technical or organizational problems", - "Treatment incomplete because patient died", - "Patient choice (stopped or interrupted treatment)", - "Physician decision (stopped or interrupted treatment)", - "Treatment stopped due to lack of efficacy (disease progression)", - "Treatment stopped due to acute toxicity", - "Other", - "Not applicable", - "Unknown" - ], - "script": [ - "(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })" - ] - }, - "meta": { - "displayName": "Outcome Of Treatment", - "dependsOn": "treatment.treatment_type" - } - }, - { - "name": "toxicity_type", - "description": "If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity.", - "valueType": "string", - "restrictions": { - "codeList": ["Hematological", "Non-hematological", "Not applicable", "Unknown"], - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })" - ] - }, - "meta": { - "displayName": "Toxicity Type", - "dependsOn": "treatment.outcome_of_treatment" - } - }, - { - "name": "hematological_toxicity", - "description": "Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))", - "valueType": "string", - "isArray": true, - "restrictions": { - "codeList": [ - "Anemia - Grade 3", - "Anemia - Grade 4", - "Anemia - Grade 5", - "Neutropenia - Grade 3", - "Neutropenia - Grade 4", - "Neutropenia - Grade 5", - "Thrombocytopenia - Grade 3", - "Thrombocytopenia - Grade 4", - "Thrombocytopenia - Grade 5", - "Unknown" - ], - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })" - ] - }, - "meta": { - "displayName": "Hemotological Toxicity", - "dependsOn": "treatment.toxicity_type", - "notes": "To include multiple values, separate values with a pipe delimiter '|' within your file." - } - }, - { - "name": "non-hematological_toxicity", - "description": "Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))", - "valueType": "string", - "isArray": true, - "restrictions": { - "codeList": [ - "Cardiac disorders - Grade 1", - "Cardiac disorders - Grade 2", - "Cardiac disorders - Grade 3", - "Cardiac disorders - Grade 4", - "Cardiac disorders - Grade 5", - "Dehydration - Grade 1", - "Dehydration - Grade 2", - "Dehydration - Grade 3", - "Dehydration - Grade 4", - "Dehydration - Grade 5", - "Diarrhea - Grade 1", - "Diarrhea - Grade 2", - "Diarrhea - Grade 3", - "Diarrhea - Grade 4", - "Diarrhea - Grade 5", - "Fatigue - Grade 1", - "Fatigue - Grade 2", - "Fatigue - Grade 3", - "Nausea - Grade 1", - "Nausea - Grade 2", - "Nausea - Grade 3", - "Unknown", - "Vomiting - Grade 1", - "Vomiting - Grade 2", - "Vomiting - Grade 3", - "Vomiting - Grade 4", - "Vomiting - Grade 5", - "Weight loss - Grade 1", - "Weight loss - Grade 2", - "Weight loss - Grade 3" - ], - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })" - ] - }, - "meta": { - "displayName": "Non-hematological Toxicity", - "dependsOn": "treatment.toxicity_type", - "notes": "To include multiple values, separate values with a pipe delimiter '|' within your file." - } - }, - { - "name": "adverse_events", - "description": "Report any treatment related adverse events. (Codelist reference: NCI-CTCAE (v5.0))", - "valueType": "string", - "isArray": true, - "restrictions": { - "codeList": [ - "Abdominal distension", - "Abdominal infection", - "Abdominal pain", - "Abdominal soft tissue necrosis", - "Abducens nerve disorder", - "Accessory nerve disorder", - "Acidosis", - "Acoustic nerve disorder NOS", - "Activated partial thromboplastin time prolonged", - "Acute kidney injury", - "Adrenal insufficiency", - "Adult respiratory distress syndrome", - "Agitation", - "Akathisia", - "Alanine aminotransferase increased", - "Alcohol intolerance", - "Alkaline phosphatase increased", - "Alkalosis", - "Allergic reaction", - "Allergic rhinitis", - "Alopecia", - "Amenorrhea", - "Amnesia", - "Anal fissure", - "Anal fistula", - "Anal hemorrhage", - "Anal mucositis", - "Anal necrosis", - "Anal pain", - "Anal stenosis", - "Anal ulcer", - "Anaphylaxis", - "Anemia", - "Ankle fracture", - "Anorectal infection", - "Anorexia", - "Anorgasmia", - "Anosmia", - "Anxiety", - "Aortic injury", - "Aortic valve disease", - "Aphonia", - "Apnea", - "Appendicitis", - "Appendicitis perforated", - "Arachnoiditis", - "Arterial injury", - "Arterial thromboembolism", - "Arteritis infective", - "Arthralgia", - "Arthritis", - "Ascites", - "Aspartate aminotransferase increased", - "Aspiration", - "Asystole", - "Ataxia", - "Atelectasis", - "Atrial fibrillation", - "Atrial flutter", - "Atrioventricular block complete", - "Atrioventricular block first degree", - "Autoimmune disorder", - "Avascular necrosis", - "Azoospermia", - "Back pain", - "Bacteremia", - "Belching", - "Bile duct stenosis", - "Biliary anastomotic leak", - "Biliary fistula", - "Biliary tract infection", - "Bladder anastomotic leak", - "Bladder infection", - "Bladder perforation", - "Bladder spasm", - "Bloating", - "Blood and lymphatic system disorders - Other, specify", - "Blood antidiuretic hormone abnormal", - "Blood bicarbonate decreased", - "Blood bilirubin increased", - "Blood corticotrophin decreased", - "Blood gonadotrophin abnormal", - "Blood lactate dehydrogenase increased", - "Blood prolactin abnormal", - "Blurred vision", - "Body odor", - "Bone infection", - "Bone marrow hypocellular", - "Bone pain", - "Brachial plexopathy", - "Breast atrophy", - "Breast infection", - "Breast pain", - "Bronchial fistula", - "Bronchial infection", - "Bronchial obstruction", - "Bronchial stricture", - "Bronchopleural fistula", - "Bronchopulmonary hemorrhage", - "Bronchospasm", - "Bruising", - "Budd-Chiari syndrome", - "Bullous dermatitis", - "Burn", - "Buttock pain", - "Capillary leak syndrome", - "Carbon monoxide diffusing capacity decreased", - "Cardiac arrest", - "Cardiac disorders - Other, specify", - "Cardiac troponin I increased", - "Cardiac troponin T increased", - "Cataract", - "Catheter related infection", - "CD4 lymphocytes decreased", - "Cecal hemorrhage", - "Cecal infection", - "Central nervous system necrosis", - "Cerebrospinal fluid leakage", - "Cervicitis infection", - "Cheilitis", - "Chest pain - cardiac", - "Chest wall necrosis", - "Chest wall pain", - "Chills", - "Cholecystitis", - "Cholesterol high", - "Chronic kidney disease", - "Chylothorax", - "Chylous ascites", - "Cognitive disturbance", - "Colitis", - "Colonic fistula", - "Colonic hemorrhage", - "Colonic obstruction", - "Colonic perforation", - "Colonic stenosis", - "Colonic ulcer", - "Concentration impairment", - "Conduction disorder", - "Confusion", - "Congenital, familial and genetic disorders - Other, specify", - "Conjunctivitis", - "Conjunctivitis infective", - "Constipation", - "Corneal infection", - "Corneal ulcer", - "Cough", - "CPK increased", - "Cranial nerve infection", - "Creatinine increased", - "Cushingoid", - "Cyanosis", - "Cystitis noninfective", - "Cytokine release syndrome", - "Cytomegalovirus infection reactivation", - "Death neonatal", - "Death NOS", - "Dehydration", - "Delayed orgasm", - "Delayed puberty", - "Delirium", - "Delusions", - "Dental caries", - "Depressed level of consciousness", - "Depression", - "Dermatitis radiation", - "Device related infection", - "Diarrhea", - "Disease progression", - "Disseminated intravascular coagulation", - "Dizziness", - "Dry eye", - "Dry mouth", - "Dry skin", - "Duodenal fistula", - "Duodenal hemorrhage", - "Duodenal infection", - "Duodenal obstruction", - "Duodenal perforation", - "Duodenal stenosis", - "Duodenal ulcer", - "Dysarthria", - "Dysesthesia", - "Dysgeusia", - "Dysmenorrhea", - "Dyspareunia", - "Dyspepsia", - "Dysphagia", - "Dysphasia", - "Dyspnea", - "Dysuria", - "Ear and labyrinth disorders - Other, specify", - "Ear pain", - "Eczema", - "Edema cerebral", - "Edema face", - "Edema limbs", - "Edema trunk", - "Ejaculation disorder", - "Ejection fraction decreased", - "Electrocardiogram QT corrected interval prolonged", - "Electrocardiogram T wave abnormal", - "Encephalitis infection", - "Encephalomyelitis infection", - "Encephalopathy", - "Endocarditis infective", - "Endocrine disorders - Other, specify", - "Endophthalmitis", - "Enterocolitis", - "Enterocolitis infectious", - "Enterovesical fistula", - "Eosinophilia", - "Epistaxis", - "Epstein-Barr virus infection reactivation", - "Erectile dysfunction", - "Erythema multiforme", - "Erythroderma", - "Esophageal anastomotic leak", - "Esophageal fistula", - "Esophageal hemorrhage", - "Esophageal infection", - "Esophageal necrosis", - "Esophageal obstruction", - "Esophageal pain", - "Esophageal perforation", - "Esophageal stenosis", - "Esophageal ulcer", - "Esophageal varices hemorrhage", - "Esophagitis", - "Euphoria", - "Exostosis", - "External ear pain", - "Extraocular muscle paresis", - "Extrapyramidal disorder", - "Eye disorders - Other, specify", - "Eye infection", - "Eye pain", - "Eyelid function disorder", - "Facial muscle weakness", - "Facial nerve disorder", - "Facial pain", - "Fall", - "Fallopian tube anastomotic leak", - "Fallopian tube obstruction", - "Fallopian tube perforation", - "Fat atrophy", - "Fatigue", - "Febrile neutropenia", - "Fecal incontinence", - "Feminization acquired", - "Fetal growth retardation", - "Fever", - "Fibrinogen decreased", - "Fibrosis deep connective tissue", - "Flank pain", - "Flashing lights", - "Flatulence", - "Floaters", - "Flu like symptoms", - "Flushing", - "Folliculitis", - "Forced expiratory volume decreased", - "Fracture", - "Fungemia", - "Gait disturbance", - "Gallbladder fistula", - "Gallbladder infection", - "Gallbladder necrosis", - "Gallbladder obstruction", - "Gallbladder pain", - "Gallbladder perforation", - "Gastric anastomotic leak", - "Gastric fistula", - "Gastric hemorrhage", - "Gastric necrosis", - "Gastric perforation", - "Gastric stenosis", - "Gastric ulcer", - "Gastritis", - "Gastroesophageal reflux disease", - "Gastrointestinal anastomotic leak", - "Gastrointestinal disorders - Other, specify", - "Gastrointestinal fistula", - "Gastrointestinal pain", - "Gastrointestinal stoma necrosis", - "Gastroparesis", - "General disorders and administration site conditions - Other, specify", - "Generalized edema", - "Generalized muscle weakness", - "Genital edema", - "GGT increased", - "Gingival pain", - "Glaucoma", - "Glossopharyngeal nerve disorder", - "Glucose intolerance", - "Glucosuria", - "Growth accelerated", - "Growth hormone abnormal", - "Growth suppression", - "Guillain-Barre syndrome", - "Gum infection", - "Gynecomastia", - "Hair color changes", - "Hair texture abnormal", - "Hallucinations", - "Haptoglobin decreased", - "Head soft tissue necrosis", - "Headache", - "Hearing impaired", - "Heart failure", - "Hematoma", - "Hematosalpinx", - "Hematuria", - "Hemoglobin increased", - "Hemoglobinuria", - "Hemolysis", - "Hemolytic uremic syndrome", - "Hemorrhoidal hemorrhage", - "Hemorrhoids", - "Hepatic failure", - "Hepatic hemorrhage", - "Hepatic infection", - "Hepatic necrosis", - "Hepatic pain", - "Hepatitis B reactivation", - "Hepatitis viral", - "Hepatobiliary disorders - Other, specify", - "Herpes simplex reactivation", - "Hiccups", - "Hip fracture", - "Hirsutism", - "Hoarseness", - "Hot flashes", - "Hydrocephalus", - "Hypercalcemia", - "Hyperglycemia", - "Hyperhidrosis", - "Hyperkalemia", - "Hyperkeratosis", - "Hyperlipidemia", - "Hypermagnesemia", - "Hypernatremia", - "Hyperparathyroidism", - "Hyperphosphatemia", - "Hypersomnia", - "Hypertension", - "Hyperthyroidism", - "Hypertrichosis", - "Hypertriglyceridemia", - "Hyperuricemia", - "Hypoalbuminemia", - "Hypocalcemia", - "Hypoglossal nerve disorder", - "Hypoglycemia", - "Hypohidrosis", - "Hypokalemia", - "Hypomagnesemia", - "Hyponatremia", - "Hypoparathyroidism", - "Hypophosphatemia", - "Hypophysitis", - "Hypopituitarism", - "Hypotension", - "Hypothermia", - "Hypothyroidism", - "Hypoxia", - "Ileal fistula", - "Ileal hemorrhage", - "Ileal obstruction", - "Ileal perforation", - "Ileal stenosis", - "Ileal ulcer", - "Ileus", - "Immune system disorders - Other, specify", - "Infections and infestations - Other, specify", - "Infective myositis", - "Infusion related reaction", - "Infusion site extravasation", - "Injection site reaction", - "Injury to carotid artery", - "Injury to inferior vena cava", - "Injury to jugular vein", - "Injury to superior vena cava", - "Injury, poisoning and procedural complications - Other, specify", - "INR increased", - "Insomnia", - "Intestinal stoma leak", - "Intestinal stoma obstruction", - "Intestinal stoma site bleeding", - "Intra-abdominal hemorrhage", - "Intracranial hemorrhage", - "Intraoperative arterial injury", - "Intraoperative breast injury", - "Intraoperative cardiac injury", - "Intraoperative ear injury", - "Intraoperative endocrine injury", - "Intraoperative gastrointestinal injury", - "Intraoperative head and neck injury", - "Intraoperative hemorrhage", - "Intraoperative hepatobiliary injury", - "Intraoperative musculoskeletal injury", - "Intraoperative neurological injury", - "Intraoperative ocular injury", - "Intraoperative renal injury", - "Intraoperative reproductive tract injury", - "Intraoperative respiratory injury", - "Intraoperative splenic injury", - "Intraoperative urinary injury", - "Intraoperative venous injury", - "Investigations - Other, specify", - "Iron overload", - "Irregular menstruation", - "Irritability", - "Ischemia cerebrovascular", - "Jejunal fistula", - "Jejunal hemorrhage", - "Jejunal obstruction", - "Jejunal perforation", - "Jejunal stenosis", - "Jejunal ulcer", - "Joint effusion", - "Joint infection", - "Joint range of motion decreased", - "Joint range of motion decreased cervical spine", - "Joint range of motion decreased lumbar spine", - "Keratitis", - "Kidney anastomotic leak", - "Kidney infection", - "Kyphosis", - "Lactation disorder", - "Large intestinal anastomotic leak", - "Laryngeal edema", - "Laryngeal fistula", - "Laryngeal hemorrhage", - "Laryngeal inflammation", - "Laryngeal mucositis", - "Laryngeal obstruction", - "Laryngeal stenosis", - "Laryngitis", - "Laryngopharyngeal dysesthesia", - "Laryngospasm", - "Left ventricular systolic dysfunction", - "Lethargy", - "Leukemia secondary to oncology chemotherapy", - "Leukocytosis", - "Leukoencephalopathy", - "Libido decreased", - "Libido increased", - "Lip infection", - "Lip pain", - "Lipase increased", - "Lipohypertrophy", - "Localized edema", - "Lordosis", - "Lower gastrointestinal hemorrhage", - "Lung infection", - "Lymph gland infection", - "Lymph leakage", - "Lymph node pain", - "Lymphedema", - "Lymphocele", - "Lymphocyte count decreased", - "Lymphocyte count increased", - "Malabsorption", - "Malaise", - "Mania", - "Mediastinal hemorrhage", - "Mediastinal infection", - "Memory impairment", - "Meningismus", - "Meningitis", - "Menorrhagia", - "Metabolism and nutrition disorders - Other, specify", - "Methemoglobinemia", - "Middle ear inflammation", - "Mitral valve disease", - "Mobitz (type) II atrioventricular block", - "Mobitz type I", - "Movements involuntary", - "Mucosal infection", - "Mucositis oral", - "Multi-organ failure", - "Muscle cramp", - "Muscle weakness left-sided", - "Muscle weakness lower limb", - "Muscle weakness right-sided", - "Muscle weakness trunk", - "Muscle weakness upper limb", - "Musculoskeletal and connective tissue disorder - Other, specify", - "Musculoskeletal deformity", - "Myalgia", - "Myasthenia gravis", - "Myelitis", - "Myelodysplastic syndrome", - "Myocardial infarction", - "Myocarditis", - "Myositis", - "Nail changes", - "Nail discoloration", - "Nail infection", - "Nail loss", - "Nail ridging", - "Nasal congestion", - "Nausea", - "Neck edema", - "Neck pain", - "Neck soft tissue necrosis", - "Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify", - "Nephrotic syndrome", - "Nervous system disorders - Other, specify", - "Neuralgia", - "Neutrophil count decreased", - "Night blindness", - "Nipple deformity", - "Non-cardiac chest pain", - "None", - "Nystagmus", - "Obesity", - "Obstruction gastric", - "Oculomotor nerve disorder", - "Olfactory nerve disorder", - "Oligospermia", - "Optic nerve disorder", - "Oral cavity fistula", - "Oral dysesthesia", - "Oral hemorrhage", - "Oral pain", - "Oropharyngeal pain", - "Osteonecrosis", - "Osteonecrosis of jaw", - "Osteoporosis", - "Otitis externa", - "Otitis media", - "Ovarian hemorrhage", - "Ovarian infection", - "Ovarian rupture", - "Ovulation pain", - "Pain", - "Pain in extremity", - "Pain of skin", - "Palmar-plantar erythrodysesthesia syndrome", - "Palpitations", - "Pancreas infection", - "Pancreatic anastomotic leak", - "Pancreatic duct stenosis", - "Pancreatic enzymes decreased", - "Pancreatic fistula", - "Pancreatic hemorrhage", - "Pancreatic necrosis", - "Pancreatitis", - "Papilledema", - "Papulopustular rash", - "Paresthesia", - "Paronychia", - "Paroxysmal atrial tachycardia", - "Pelvic floor muscle weakness", - "Pelvic infection", - "Pelvic pain", - "Pelvic soft tissue necrosis", - "Penile infection", - "Penile pain", - "Perforation bile duct", - "Pericardial effusion", - "Pericardial tamponade", - "Pericarditis", - "Perineal pain", - "Periodontal disease", - "Periorbital edema", - "Periorbital infection", - "Peripheral ischemia", - "Peripheral motor neuropathy", - "Peripheral nerve infection", - "Peripheral sensory neuropathy", - "Peritoneal infection", - "Peritoneal necrosis", - "Personality change", - "Phantom pain", - "Pharyngeal anastomotic leak", - "Pharyngeal fistula", - "Pharyngeal hemorrhage", - "Pharyngeal mucositis", - "Pharyngeal necrosis", - "Pharyngeal stenosis", - "Pharyngitis", - "Pharyngolaryngeal pain", - "Phlebitis", - "Phlebitis infective", - "Photophobia", - "Photosensitivity", - "Platelet count decreased", - "Pleural effusion", - "Pleural hemorrhage", - "Pleural infection", - "Pleuritic pain", - "Pneumonitis", - "Pneumothorax", - "Portal hypertension", - "Portal vein thrombosis", - "Postnasal drip", - "Postoperative hemorrhage", - "Postoperative thoracic procedure complication", - "Precocious puberty", - "Pregnancy loss", - "Pregnancy, puerperium and perinatal conditions - Other, specify", - "Premature delivery", - "Premature menopause", - "Presyncope", - "Proctitis", - "Productive cough", - "Prolapse of intestinal stoma", - "Prolapse of urostomy", - "Prostate infection", - "Prostatic hemorrhage", - "Prostatic obstruction", - "Prostatic pain", - "Proteinuria", - "Pruritus", - "Psychiatric disorders - Other, specify", - "Psychosis", - "Pulmonary edema", - "Pulmonary fibrosis", - "Pulmonary fistula", - "Pulmonary hypertension", - "Pulmonary valve disease", - "Purpura", - "Pyramidal tract syndrome", - "Radiation recall reaction (dermatologic)", - "Radiculitis", - "Rash acneiform", - "Rash maculo-papular", - "Rash pustular", - "Rectal anastomotic leak", - "Rectal fissure", - "Rectal fistula", - "Rectal hemorrhage", - "Rectal mucositis", - "Rectal necrosis", - "Rectal obstruction", - "Rectal pain", - "Rectal perforation", - "Rectal stenosis", - "Rectal ulcer", - "Recurrent laryngeal nerve palsy", - "Renal and urinary disorders - Other, specify", - "Renal calculi", - "Renal colic", - "Renal hemorrhage", - "Reproductive system and breast disorders - Other, specify", - "Respiratory failure", - "Respiratory, thoracic and mediastinal disorders - Other, specify", - "Restlessness", - "Restrictive cardiomyopathy", - "Retinal detachment", - "Retinal tear", - "Retinal vascular disorder", - "Retinoic acid syndrome", - "Retinopathy", - "Retroperitoneal hemorrhage", - "Reversible posterior leukoencephalopathy syndrome", - "Rhabdomyolysis", - "Rhinitis infective", - "Rhinorrhea", - "Right ventricular dysfunction", - "Rotator cuff injury", - "Salivary duct inflammation", - "Salivary gland fistula", - "Salivary gland infection", - "Scalp pain", - "Scleral disorder", - "Scoliosis", - "Scrotal infection", - "Scrotal pain", - "Seizure", - "Sepsis", - "Seroma", - "Serum amylase increased", - "Serum sickness", - "Shingles", - "Sick sinus syndrome", - "Sinus bradycardia", - "Sinus disorder", - "Sinus pain", - "Sinus tachycardia", - "Sinusitis", - "Sinusoidal obstruction syndrome", - "Skin and subcutaneous tissue disorders - Other, specify", - "Skin atrophy", - "Skin hyperpigmentation", - "Skin hypopigmentation", - "Skin induration", - "Skin infection", - "Skin papilloma", - "Skin ulceration", - "Sleep apnea", - "Small intestinal anastomotic leak", - "Small intestinal mucositis", - "Small intestinal obstruction", - "Small intestinal perforation", - "Small intestinal stenosis", - "Small intestine infection", - "Small intestine ulcer", - "Sneezing", - "Social circumstances - Other, specify", - "Soft tissue infection", - "Soft tissue necrosis lower limb", - "Soft tissue necrosis upper limb", - "Somnolence", - "Sore throat", - "Spasticity", - "Spermatic cord anastomotic leak", - "Spermatic cord hemorrhage", - "Spermatic cord obstruction", - "Spinal cord compression", - "Spinal fracture", - "Splenic infection", - "Stenosis of gastrointestinal stoma", - "Stevens-Johnson syndrome", - "Stoma site infection", - "Stomach pain", - "Stomal ulcer", - "Stridor", - "Stroke", - "Subcutaneous emphysema", - "Sudden death NOS", - "Suicidal ideation", - "Suicide attempt", - "Superficial soft tissue fibrosis", - "Superficial thrombophlebitis", - "Superior vena cava syndrome", - "Supraventricular tachycardia", - "Surgical and medical procedures - Other, specify", - "Syncope", - "Telangiectasia", - "Tendon reflex decreased", - "Testicular disorder", - "Testicular hemorrhage", - "Testicular pain", - "Testosterone deficiency", - "Thromboembolic event", - "Thrombotic thrombocytopenic purpura", - "Thrush", - "Thyroid stimulating hormone increased", - "Tinnitus", - "Tooth development disorder", - "Tooth discoloration", - "Tooth infection", - "Toothache", - "Toxic epidermal necrolysis", - "Tracheal fistula", - "Tracheal hemorrhage", - "Tracheal mucositis", - "Tracheal obstruction", - "Tracheal stenosis", - "Tracheitis", - "Tracheostomy site bleeding", - "Transient ischemic attacks", - "Treatment related secondary malignancy", - "Tremor", - "Tricuspid valve disease", - "Trigeminal nerve disorder", - "Trismus", - "Trochlear nerve disorder", - "Tumor hemorrhage", - "Tumor lysis syndrome", - "Tumor pain", - "Typhlitis", - "Unequal limb length", - "Unknown", - "Upper gastrointestinal hemorrhage", - "Upper respiratory infection", - "Ureteric anastomotic leak", - "Urethral anastomotic leak", - "Urethral infection", - "Urinary fistula", - "Urinary frequency", - "Urinary incontinence", - "Urinary retention", - "Urinary tract infection", - "Urinary tract obstruction", - "Urinary tract pain", - "Urinary urgency", - "Urine discoloration", - "Urine output decreased", - "Urostomy leak", - "Urostomy obstruction", - "Urostomy site bleeding", - "Urostomy stenosis", - "Urticaria", - "Uterine anastomotic leak", - "Uterine fistula", - "Uterine hemorrhage", - "Uterine infection", - "Uterine obstruction", - "Uterine pain", - "Uterine perforation", - "Uveitis", - "Vaccination complication", - "Vaccination site lymphadenopathy", - "Vaginal anastomotic leak", - "Vaginal discharge", - "Vaginal dryness", - "Vaginal fistula", - "Vaginal hemorrhage", - "Vaginal infection", - "Vaginal inflammation", - "Vaginal obstruction", - "Vaginal pain", - "Vaginal perforation", - "Vaginal stricture", - "Vagus nerve disorder", - "Vas deferens anastomotic leak", - "Vascular access complication", - "Vascular disorders - Other, specify", - "Vasculitis", - "Vasovagal reaction", - "Venous injury", - "Ventricular arrhythmia", - "Ventricular fibrillation", - "Ventricular tachycardia", - "Vertigo", - "Vestibular disorder", - "Viremia", - "Virilization", - "Visceral arterial ischemia", - "Vision decreased", - "Vital capacity abnormal", - "Vitreous hemorrhage", - "Voice alteration", - "Vomiting", - "Vulval infection", - "Watering eyes", - "Weight gain", - "Weight loss", - "Wheezing", - "White blood cell decreased", - "Wound complication", - "Wound dehiscence", - "Wound infection", - "Wrist fracture" - ], - "script": [ - "(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })" - ] - }, - "meta": { - "displayName": "Adverse Events", - "dependsOn": "treatment.treatment_type", - "notes": "To include multiple values, separate values with a pipe delimiter '|' within your file." - } - }, - { - "name": "clinical_trials_database", - "description": "If the donor is a participant in a clinical trial, indicate the clinical trial database where the clinical trial is registered.", - "valueType": "string", - "meta": { - "display name": "Clinical Trials Database", - "notes": "If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added." - }, - "restrictions": { - "codeList": [ - "NCI Clinical Trials", - "EU Clinical Trials Register", - "Not applicable", - "Unknown" - ] - } - }, - { - "name": "clinical_trial_number", - "description": "Based on the clinical_trial_database, indicate the unique NCT or EudraCT clinical trial identifier of which the donor is a participant.", - "valueType": "string", - "meta": { - "display name": "Clinical Trial Number", - "dependsOn": "treatment.clinical_trials_database", - "examples": "2016-002120-83,NCT02465060" - }, - "restrictions": { - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })" - ] - } - } - ] - }, - { - "name": "chemotherapy", - "description": "The collection of data elements describing the details of a chemotherapy treatment regimen completed by a donor. To submit multiple treatment drugs for a single regimen, submit multiple rows in the chemotherapy file.", - "meta": { "parent": "treatment" }, - "fields": [ - { - "name": "program_id", - "valueType": "string", - "description": "Unique identifier of the ARGO program.", - "meta": { - "validationDependency": true, - "primaryId": true, - "foreignKey": "sample_registration.program_id", - "displayName": "Program ID" - }, - "restrictions": { "required": true } - }, - { - "name": "submitter_donor_id", - "valueType": "string", - "description": "Unique identifier of the donor, assigned by the data provider.", - "meta": { - "validationDependency": true, - "primaryId": true, - "foreignKey": "sample_registration.submitter_donor_id", - "displayName": "Submitter Donor ID" - }, - "restrictions": { "required": true, "regex": "^[A-Za-z0-9\\-\\._]{1,64}$" } - }, - { - "name": "submitter_treatment_id", - "valueType": "string", - "description": "Unique identifier of the treatment, as assigned by the data provider.", - "meta": { - "validationDependency": true, - "primaryId": true, - "foreignKey": "treatment.submitter_treatment_id", - "displayName": "Submitter Treatment ID" - }, - "restrictions": { "required": true, "regex": "^[A-Za-z0-9\\-\\._]{1,64}$" } - }, - { - "name": "drug_rxnormcui", - "description": "The unique RxNormID assigned to the treatment regimen drug.", - "valueType": "string", - "meta": { - "validationDependency": true, - "core": true, - "notes": "This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin", - "displayName": "RxNormCUI" - }, - "restrictions": { "required": true } - }, - { - "name": "drug_name", - "description": "Name of agent or drug administered to donor as part of the treatment regimen.", - "valueType": "string", - "meta": { - "validationDependency": true, - "core": true, - "notes": "This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin", - "displayName": "Chemotherapy Drug Name" - }, - "restrictions": { "required": true } - }, - { - "name": "chemotherapy_drug_dose_units", - "description": "Indicate units used to record chemotherapy drug dose.", - "valueType": "string", - "restrictions": { - "required": true, - "codeList": ["mg/m2", "IU/m2", "ug/m2", "g/m2", "mg/kg", "mg"] - }, - "meta": { "core": true, "displayName": "Chemotherapy Drug Dose Units" } - }, - { - "name": "prescribed_cumulative_drug_dose", - "description": "Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.", - "valueType": "number", - "restrictions": { - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })" - ], - "range": { "exclusiveMin": 0 } - }, - "meta": { - "core": true, - "displayName": "Prescribed Cumulative Drug Dose", - "validationDependency": true, - "dependsOn": "chemotherapy.actual_cumulative_drug_dose", - "notes": "Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted." - } - }, - { - "name": "actual_cumulative_drug_dose", - "description": "Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.", - "valueType": "number", - "restrictions": { - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })" - ], - "range": { "exclusiveMin": 0 } - }, - "meta": { - "core": true, - "displayName": "Actual Cumulative Drug Dose", - "validationDependency": true, - "dependsOn": "chemotherapy.prescribed_cumulative_drug_dose", - "notes": "Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted." - } - }, - { - "name": "dose_intensity_reduction", - "description": "Indicate if there was a significant reduction in dose intensity.", - "valueType": "string", - "restrictions": { "codeList": ["Yes", "No", "Unknown"] }, - "meta": { "displayName": "Dose Intensity Reduction" } - }, - { - "name": "dose_intensity_reduction_event", - "description": "If there was a signficiant reduction in dose intensity, indicate which event caused it.", - "valueType": "string", - "restrictions": { - "codeList": ["Dose reduction", "Dose delay or dose omission", "Both"], - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })" - ] - }, - "meta": { - "displayName": "Dose Intensity Reduction Event", - "notes": "This field should only be submitted if 'dose_intensity_reduction' is 'Yes'" - } - }, - { - "name": "dose_intensity_reduction_amount", - "description": "If there was a significant reduction in dose intensity, indicate the amount.", - "valueType": "string", - "restrictions": { - "codeList": ["<20%", "20-49%", ">=50%", "Unknown"], - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })" - ] - }, - "meta": { - "displayName": "Amount of Dose Intensity Reduction", - "notes": "This field should only be submitted if 'dose_intensity_reduction' is 'Yes'" - } - } - ] - }, - { - "name": "hormone_therapy", - "description": "The collection of data elements describing the details of a hormone treatment therapy completed by a donor. To submit multiple treatment drugs for a single regimen, submit multiple rows in the hormone_therapy file.", - "meta": { "parent": "treatment" }, - "fields": [ - { - "name": "program_id", - "valueType": "string", - "description": "Unique identifier of the ARGO program.", - "meta": { - "validationDependency": true, - "primaryId": true, - "foreignKey": "sample_registration.program_id", - "displayName": "Program ID" - }, - "restrictions": { "required": true } - }, - { - "name": "submitter_donor_id", - "valueType": "string", - "description": "Unique identifier of the donor, assigned by the data provider.", - "meta": { - "validationDependency": true, - "primaryId": true, - "foreignKey": "sample_registration.submitter_donor_id", - "displayName": "Submitter Donor ID" - }, - "restrictions": { "required": true, "regex": "^[A-Za-z0-9\\-\\._]{1,64}$" } - }, - { - "name": "submitter_treatment_id", - "valueType": "string", - "description": "Unique identifier of the treatment, assigned by the data provider.", - "meta": { - "validationDependency": true, - "primaryId": true, - "foreignKey": "treatment.submitter_treatment_id", - "displayName": "Submitter Treatment ID" - }, - "restrictions": { "required": true, "regex": "^[A-Za-z0-9\\-\\._]{1,64}$" } - }, - { - "name": "drug_rxnormcui", - "description": "The unique RxNormID assigned to the treatment regimen drug.", - "valueType": "string", - "meta": { - "core": true, - "notes": "This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin", - "displayName": "RxNormCUI" - }, - "restrictions": { "required": true } - }, - { - "name": "drug_name", - "description": "Name of agent or drug administered to donor as part of the treatment regimen.", - "valueType": "string", - "meta": { - "core": true, - "notes": "This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin", - "displayName": "Hormone Therapy Drug Name" - }, - "restrictions": { "required": true } - }, - { - "name": "hormone_drug_dose_units", - "description": "Indicate the units used to record hormone drug dose.", - "valueType": "string", - "restrictions": { - "required": true, - "codeList": ["mg/m2", "IU/m2", "ug/m2", "g/m2", "mg/kg", "mg"] - }, - "meta": { "core": true, "displayName": "Hormone Drug Dose Units" } - }, - { - "name": "prescribed_cumulative_drug_dose", - "description": "Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.", - "valueType": "number", - "restrictions": { - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })" - ], - "range": { "exclusiveMin": 0 } - }, - "meta": { - "core": true, - "displayName": "Prescribed Cumulative Drug Dose", - "dependsOn": "hormone_therapy.actual_cumulative_drug_dose", - "notes": "Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted." - } - }, - { - "name": "actual_cumulative_drug_dose", - "description": "Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.", - "valueType": "number", - "restrictions": { - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })" - ], - "range": { "exclusiveMin": 0 } - }, - "meta": { - "core": true, - "displayName": "Actual Cumulative Drug Dose", - "dependsOn": "hormone_therapy.prescribed_cumulative_drug_dose", - "notes": "Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted." - } - } - ] - }, - { - "name": "radiation", - "description": "The collection of data elements describing the details of a radiation treatment completed by a donor.", - "meta": { "parent": "treatment" }, - "fields": [ - { - "name": "program_id", - "valueType": "string", - "description": "Unique identifier of the ARGO program.", - "meta": { - "validationDependency": true, - "primaryId": true, - "foreignKey": "sample_registration.program_id", - "displayName": "Program ID" - }, - "restrictions": { "required": true } - }, - { - "name": "submitter_donor_id", - "valueType": "string", - "description": "Unique identifier of the donor, assigned by the data provider.", - "meta": { - "validationDependency": true, - "primaryId": true, - "foreignKey": "sample_registration.submitter_donor_id", - "displayName": "Submitter Donor ID" - }, - "restrictions": { "required": true, "regex": "^[A-Za-z0-9\\-\\._]{1,64}$" } - }, - { - "name": "submitter_treatment_id", - "valueType": "string", - "description": "Unique identifier of the treatment, assigned by the data provider.", - "meta": { - "validationDependency": true, - "primaryId": true, - "foreignKey": "treatment.submitter_treatment_id", - "displayName": "Submitter Treatment ID" - }, - "restrictions": { "required": true, "regex": "^[A-Za-z0-9\\-\\._]{1,64}$" } - }, - { - "name": "radiation_therapy_modality", - "description": "Indicate the method of radiation treatment or modality.", - "valueType": "string", - "restrictions": { - "required": true, - "codeList": ["Electron", "Heavy Ions", "Photon", "Proton"] - }, - "meta": { - "validationDependency": true, - "core": true, - "displayName": "Radiation Therapy Modality" - } - }, - { - "name": "radiation_therapy_type", - "description": "Indicate type of radiation therapy administered.", - "valueType": "string", - "restrictions": { "required": true, "codeList": ["External", "Internal"] }, - "meta": { - "core": true, - "displayName": "Type of Radiation Therapy", - "notes": "Internal application includes Brachytherapy." - } - }, - { - "name": "radiation_therapy_fractions", - "description": "Indicate the total number of fractions delivered as part of treatment.", - "valueType": "integer", - "restrictions": { "required": true, "range": { "exclusiveMin": 0 } }, - "meta": { "core": true, "displayName": "Radiation Therapy Fractions" } - }, - { - "name": "radiation_therapy_dosage", - "description": "Indicate the total dose given in units of Gray (Gy).", - "valueType": "number", - "restrictions": { "required": true, "range": { "exclusiveMin": 0 } }, - "meta": { "core": true, "displayName": "Radiation Therapy Dosage" } - }, - { - "name": "anatomical_site_irradiated", - "description": "Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)", - "valueType": "string", - "isArray": true, - "restrictions": { - "required": true, - "codeList": [ - "Abdomen", - "Body", - "Brain", - "Chest", - "Head", - "Liver", - "Lower Limb", - "Lung", - "Neck", - "Pelvis", - "Skin", - "Spine", - "Thorax", - "Upper Limb" - ] - }, - "meta": { "core": true, "displayName": "Anatomical Site Irradiated" } - }, - { - "name": "radiation_boost", - "description": "A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.", - "valueType": "string", - "restrictions": { "codeList": ["Yes", "No", "Not applicable"] }, - "meta": { "displayName": "Radiation Boost" } - }, - { - "name": "reference_radiation_treatment_id", - "description": "If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.", - "valueType": "string", - "restrictions": { - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })" - ] - }, - "meta": { "displayName": "Reference Radiation Treatment for Boost" } - } - ] - }, - { - "name": "immunotherapy", - "description": "The collection of data elements describing the details of an immunotherapy treatment completed by a donor.", - "meta": { "parent": "treatment" }, - "fields": [ - { - "name": "program_id", - "valueType": "string", - "description": "Unique identifier of the ARGO program.", - "meta": { - "validationDependency": true, - "primaryId": true, - "foreignKey": "sample_registration.program_id", - "displayName": "Program ID" - }, - "restrictions": { "required": true } - }, - { - "name": "submitter_donor_id", - "valueType": "string", - "description": "Unique identifier of the donor, assigned by the data provider.", - "meta": { - "validationDependency": true, - "primaryId": true, - "foreignKey": "sample_registration.submitter_donor_id", - "displayName": "Submitter Donor ID" - }, - "restrictions": { "required": true, "regex": "^[A-Za-z0-9\\-\\._]{1,64}$" } - }, - { - "name": "submitter_treatment_id", - "valueType": "string", - "description": "Unique identifier of the treatment, assigned by the data provider.", - "meta": { - "validationDependency": true, - "primaryId": true, - "foreignKey": "treatment.submitter_treatment_id", - "displayName": "Submitter Treatment ID" - }, - "restrictions": { "required": true, "regex": "^[A-Za-z0-9\\-\\._]{1,64}$" } - }, - { - "name": "immunotherapy_type", - "valueType": "string", - "description": "Indicate the type of immunotherapy administered to donor.", - "meta": { "displayName": "Immunotherapy Type", "core": true }, - "restrictions": { - "required": true, - "codeList": [ - "Cell-based", - "Immune checkpoint inhibitors", - "Monoclonal antibodies other than immune checkpoint inhibitors", - "Other immunomodulatory substances" - ] - } - }, - { - "name": "drug_rxnormcui", - "description": "The unique RxNormID assigned to the treatment regimen drug.", - "valueType": "string", - "meta": { - "validationDependency": true, - "core": true, - "notes": "This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin", - "displayName": "RxNormCUI" - }, - "restrictions": { "required": true } - }, - { - "name": "drug_name", - "description": "Name of agent or drug administered to donor as part of the treatment regimen.", - "valueType": "string", - "meta": { - "validationDependency": true, - "core": true, - "notes": "This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin", - "displayName": "Immunotherapy Drug Name" - }, - "restrictions": { "required": true } - }, - { - "name": "immunotherapy_drug_dose_units", - "description": "Indicate units used to record immunotherapy drug dose.", - "valueType": "string", - "restrictions": { - "required": true, - "codeList": ["mg/m2", "IU/m2", "ug/m2", "g/m2", "mg/kg", "mg"] - }, - "meta": { "core": true, "displayName": "Immunotherapy Drug Dose Units" } - }, - { - "name": "prescribed_cumulative_drug_dose", - "description": "Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.", - "valueType": "number", - "restrictions": { - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })" - ], - "range": { "exclusiveMin": 0 } - }, - "meta": { - "core": true, - "displayName": "Prescribed Cumulative Drug Dose", - "dependsOn": "immunotherapy.actual_cumulative_drug_dose", - "notes": "Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted." - } - }, - { - "name": "actual_cumulative_drug_dose", - "description": "Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.", - "valueType": "number", - "restrictions": { - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })" - ], - "range": { "exclusiveMin": 0 } - }, - "meta": { - "core": true, - "displayName": "Actual Cumulative Drug Dose", - "dependsOn": "immunotherapy.prescribed_cumulative_drug_dose", - "notes": "Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted." - } - } - ] - }, - { - "name": "surgery", - "description": "The collection of data elements related to a donor's surgical treatment at a specific point in the clinical record. To submit multiple surgeries, submit multiple rows in the Surgery file. If a specimen was resected during surgery, indicate the unique identifier of the specimen in the 'submitter_specimen_id' field. If multiple specimens were resected during a single surgical procedure, submit each 'submitter_specimen_id' as a new row with the same 'submitter_treatment_id' and 'surgery_type' values.", - "meta": { "parent": "donor" }, - "fields": [ - { - "name": "program_id", - "valueType": "string", - "description": "Unique identifier of the ARGO program.", - "meta": { - "validationDependency": true, - "primaryId": true, - "foreignKey": "sample_registration.program_id", - "displayName": "Program ID" - }, - "restrictions": { "required": true } - }, - { - "name": "submitter_donor_id", - "description": "Unique identifier of the donor, assigned by the data provider.", - "valueType": "string", - "meta": { - "validationDependency": true, - "primaryId": true, - "foreignKey": "sample_registration.submitter_donor_id", - "displayName": "Submitter Donor ID" - }, - "restrictions": { "required": true, "regex": "^[A-Za-z0-9\\-\\._]{1,64}$" } - }, - { - "name": "submitter_specimen_id", - "description": "If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.", - "valueType": "string", - "meta": { - "validationDependency": true, - "primaryId": true, - "foreignKey": "specimen.submitter_specimen_id", - "displayName": "Submitter Specimen ID", - "notes": "Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file" - }, - "restrictions": { "regex": "^[A-Za-z0-9\\-\\._]{1,64}$" } - }, - { - "name": "submitter_treatment_id", - "description": "Unique identifier of the treatment, assigned by the data provider.", - "valueType": "string", - "meta": { - "validationDependency": true, - "primaryId": true, - "foreignKey": "treatment.submitter_treatment_id", - "displayName": "Submitter Treatment ID" - }, - "restrictions": { "required": true, "regex": "^[A-Za-z0-9\\-\\._]{1,64}$" } - }, - { - "name": "surgery_type", - "valueType": "string", - "description": "Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)", - "meta": { "core": true, "displayName": "Surgery Type " }, - "restrictions": { - "required": true, - "codeList": [ - "Axillary Clearance", - "Axillary lymph nodes sampling", - "Biopsy", - "Bypass Gastrojejunostomy", - "Cholecystectomy", - "Cholecystojejunostomy", - "Completion gastrectomy", - "Debridement of pancreatic and peripancreatic necrosis", - "Debulking", - "Distal subtotal pancreatectomy", - "Drainage of abscess", - "Duodenal preserving pancreatic head resection", - "Endoscopic biopsy", - "Endoscopic brushings of GIT", - "Enucleation", - "Esophageal bypass surgery/jejunostomy only", - "Exploratory laparotomy", - "Fine needle aspiration biopsy", - "Gastric Antrectomy", - "Hemithyroidectomy", - "Hepaticojejunostomy", - "Ivor Lewis subtotal esophagectomy", - "Laparotomy (Open and Shut)", - "Left thoracoabdominal incision", - "Lobectomy", - "Mammoplasty", - "Mastectomy", - "McKeown esophagectomy", - "Merendino procedure", - "Minimally invasive esophagectomy", - "Near-total thyroidectomy", - "Pancreaticoduodenectomy", - "Pancreaticojejunostomy, side-to-side anastomosis", - "Pneumonectomy", - "Proximal subtotal gastrectomy", - "Pylorus-sparing Whipple operation", - "Radical pancreaticoduodenectomy", - "Reexcision", - "Segmentectomy", - "Sentinal Lymph Node Biopsy", - "Spleen preserving distal pancreatectomy", - "Splenectomy", - "Subtotal pancreatectomy", - "Subtotal thyroidectomy", - "Thoracotomy (Open & Shut)", - "Total gastrectomy", - "Total gastrectomy with extended lymphadenectomy", - "Total pancreatectomy", - "Total thyroidectomy", - "Transhiatal esophagectomy", - "Triple bypass of pancreas", - "Wedge/localised gastric resection", - "Wide Local Excision" - ] - } - }, - { - "name": "surgery_site", - "valueType": "string", - "description": "Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).", - "meta": { - "displayName": "Surgery Site", - "core": true, - "dependsOn": "surgery.submitter_specimen_id", - "notes": "Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table." - }, - "restrictions": { - "regex": "^[C][0-9]{2}(.[0-9]{1})?$", - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })" - ] - } - }, - { - "name": "surgery_location", - "valueType": "string", - "description": "Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.", - "meta": { - "displayName": "Surgery Location", - "core": true, - "dependsOn": "surgery.submitter_specimen_id", - "notes": "This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table." - }, - "restrictions": { - "codeList": ["Local recurrence", "Metastatic", "Primary"], - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })" - ] - } - }, - { - "name": "tumour_length", - "valueType": "number", - "description": "Indicate the length of the tumour, in millimetres (mm).", - "meta": { "displayName": "Tumour Length" }, - "restrictions": { "range": { "exclusiveMin": 0 } } - }, - { - "name": "tumour_width", - "valueType": "number", - "description": "Indicate the width of the tumour, in millimetres (mm).", - "meta": { "displayName": "Tumour Width" }, - "restrictions": { "range": { "exclusiveMin": 0 } } - }, - { - "name": "greatest_dimension_tumour", - "valueType": "number", - "description": "Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)", - "meta": { "displayName": "Greatest Dimension Tumour" }, - "restrictions": { "range": { "exclusiveMin": 0 } } - }, - { - "name": "tumour_focality", - "valueType": "string", - "description": "Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)", - "meta": { "displayName": "Tumour Focality" }, - "restrictions": { - "codeList": [ - "Cannot be assessed", - "Multifocal", - "Not applicable", - "Unifocal", - "Unknown" - ] - } - }, - { - "name": "residual_tumour_classification", - "valueType": "string", - "description": "Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)", - "meta": { - "displayName": "Residual Tumour Classification", - "notes": "RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)" - }, - "restrictions": { "codeList": ["Not applicable", "RX", "R0", "R1", "R2", "Unknown"] } - }, - { - "name": "margin_types_involved", - "valueType": "string", - "description": "Indicate the margin type(s) involved.", - "isArray": true, - "meta": { - "displayName": "Margin Types Involved", - "notes": "To include multiple values, separate values with a pipe delimiter '|' within your file." - }, - "restrictions": { - "codeList": [ - "Circumferential resection margin", - "Common bile duct margin", - "Distal margin", - "Not applicable", - "Proximal margin", - "Unknown" - ], - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })" - ] - } - }, - { - "name": "margin_types_not_involved", - "valueType": "string", - "description": "Indicate the margin type(s) not involved.", - "isArray": true, - "meta": { - "displayName": "Margin Types Not Involved", - "notes": "To include multiple values, separate values with a pipe delimiter '|' within your file." - }, - "restrictions": { - "codeList": [ - "Circumferential resection margin", - "Common bile duct margin", - "Distal margin", - "Not applicable", - "Proximal margin", - "Unknown" - ], - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })" - ] - } - }, - { - "name": "margin_types_not_assessed", - "valueType": "string", - "description": "Indicate the margin type(s) that cannot be assessed.", - "isArray": true, - "meta": { - "displayName": "Margin Types Not Assessed", - "notes": "To include multiple values, separate values with a pipe delimiter '|' within your file." - }, - "restrictions": { - "codeList": [ - "Circumferential resection margin", - "Common bile duct margin", - "Distal margin", - "Not applicable", - "Proximal margin", - "Unknown" - ] - } - }, - { - "name": "lymphovascular_invasion", - "valueType": "string", - "description": "Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)", - "meta": { "displayName": "Lymphovascular Invasion (LVI)" }, - "restrictions": { - "codeList": [ - "Absent", - "Both lymphatic and small vessel and venous (large vessel) invasion", - "Lymphatic and small vessel invasion only", - "Not applicable", - "Present", - "Venous (large vessel) invasion only", - "Unknown" - ] - } - }, - { - "name": "perineural_invasion", - "valueType": "string", - "description": "A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)", - "meta": { "displayName": "Perineural Invasion" }, - "restrictions": { - "codeList": ["Absent", "Cannot be assessed", "Not applicable", "Present", "Unknown"] - } - }, - { - "name": "extrathyroidal_extension", - "valueType": "string", - "description": "Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)", - "meta": { "displayName": "Extrathyroidal Extension" }, - "restrictions": { - "codeList": ["Absent", "Cannot be assessed", "Not applicable", "Present", "Unknown"] - } - } - ] - }, - { - "name": "follow_up", - "description": "The collection of data elements related to a specific follow-up visit to a donor. A follow-up is defined as any point of contact with a patient after primary diagnosis. To submit multiple follow-ups for a single donor, please submit multiple rows in the follow-up file for this donor.", - "meta": { "parent": "donor" }, - "fields": [ - { - "name": "program_id", - "valueType": "string", - "description": "Unique identifier of the ARGO program.", - "meta": { - "validationDependency": true, - "primaryId": true, - "foreignKey": "sample_registration.program_id", - "displayName": "Program ID" - }, - "restrictions": { "required": true } - }, - { - "description": "Unique identifier of the donor, assigned by the data provider.", - "name": "submitter_donor_id", - "valueType": "string", - "meta": { - "validationDependency": true, - "primaryId": true, - "foreignKey": "sample_registration.submitter_donor_id", - "displayName": "Submitter Donor ID" - }, - "restrictions": { "required": true, "regex": "^[A-Za-z0-9\\-\\._]{1,64}$" } - }, - { - "description": "Unique identifier for a follow-up event in a donor's clinical record, assigned by the data provider.", - "name": "submitter_follow_up_id", - "valueType": "string", - "meta": { - "validationDependency": true, - "primaryId": true, - "displayName": "Submitter Follow-Up ID" - }, - "restrictions": { "required": true, "regex": "^[A-Za-z0-9\\-\\._]{1,64}$" } - }, - { - "description": "Interval from the primary diagnosis date to the follow-up date, in days.", - "name": "interval_of_followup", - "valueType": "integer", - "restrictions": { "required": true, "range": { "exclusiveMin": 0 } }, - "meta": { - "core": true, - "units": "days", - "displayName": "Interval Of Follow-Up", - "notes": "The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis." - } - }, - { - "description": "Indicate the donor's disease status at time of follow-up. (Reference: RECIST)", - "name": "disease_status_at_followup", - "valueType": "string", - "restrictions": { - "required": true, - "codeList": [ - "Complete remission", - "Distant progression", - "Loco-regional progression", - "No evidence of disease", - "Partial remission", - "Progression NOS", - "Relapse or recurrence", - "Stable" - ] - }, - "meta": { "core": true, "displayName": "Disease Status at Follow-Up" } - }, - { - "name": "submitter_primary_diagnosis_id", - "valueType": "string", - "description": "Indicate if the follow-up is related to a specific primary diagnosis event in the clinical timeline.", - "meta": { - "validationDependency": true, - "foreignKey": "primary_diagnosis.submitter_primary_diagnosis_id", - "displayName": "Submitter Primary Diagnosis ID", - "primaryId": true - }, - "restrictions": { "regex": "^[A-Za-z0-9\\-\\._]{1,64}$" } - }, - { - "name": "submitter_treatment_id", - "valueType": "string", - "description": "Indicate if the follow-up is related to a specific treatment event in the clinical timeline.", - "meta": { - "validationDependency": true, - "primaryId": true, - "foreignKey": "treatment.submitter_treatment_id", - "displayName": "Submitter Treatment ID" - }, - "restrictions": { "regex": "^[A-Za-z0-9\\-\\._]{1,64}$" } - }, - { - "description": "Indicate the donor's weight, in kilograms (kg), at the time of follow-up.", - "name": "weight_at_followup", - "valueType": "number", - "restrictions": { "range": { "exclusiveMin": 0 } }, - "meta": { "displayName": "Weight at Follow-Up" } - }, - { - "description": "Indicate the donor's relapse type.", - "name": "relapse_type", - "valueType": "string", - "restrictions": { - "codeList": [ - "Distant recurrence/metastasis", - "Local recurrence", - "Local recurrence and distant metastasis", - "Progression (liquid tumours)" - ], - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })" - ] - }, - "meta": { - "core": true, - "dependsOn": "follow_up.disease_status_at_followup", - "notes": "This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.", - "displayName": "Relapse Type" - } - }, - { - "description": "If the donor was clinically disease free following primary treatment and then relapse or recurrence or progression (for liquid tumours) occurred afterwards, then this field will indicate the length of disease free interval, in days.", - "name": "relapse_interval", - "valueType": "integer", - "restrictions": { - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })" - ], - "range": { "exclusiveMin": 0 } - }, - "meta": { - "core": true, - "units": "days", - "dependsOn": "follow_up.disease_status_at_followup", - "notes": "This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.", - "displayName": "Relapse Interval" - } - }, - { - "description": "Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Reference: caDSR CDE ID 6161031)", - "name": "method_of_progression_status", - "valueType": "string", - "isArray": true, - "restrictions": { - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })" - ], - "codeList": [ - "Biomarker in liquid biopsy (e.g. tumour marker in blood or urine)", - "Biopsy", - "Blood draw", - "Bone marrow aspirate", - "Core biopsy", - "Cystoscopy", - "Cytology", - "Debulking", - "Diagnostic imaging", - "Dilation and curettage procedure", - "Enucleation", - "Excisional biopsy", - "Fine needle aspiration", - "Imaging", - "Incisional biopsy", - "Laparoscopy", - "Laparotomy", - "Other", - "Pap Smear", - "Pathologic review", - "Physical exam", - "Surgical resection", - "Thoracentesis", - "Ultrasound guided biopsy" - ] - }, - "meta": { - "core": true, - "dependsOn": "follow_up.disease_status_at_followup", - "notes": "This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file.", - "displayName": "Method Of Progression Status" - } - }, - { - "description": "Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.", - "name": "anatomic_site_progression_or_recurrence", - "valueType": "string", - "isArray": true, - "restrictions": { - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })" - ], - "regex": "^[C][0-9]{2}(.[0-9]{1})?$" - }, - "meta": { - "core": true, - "dependsOn": "follow_up.disease_status_at_followup", - "displayName": "Anatomic Site Progression or Recurrences", - "examples": "C50.1|C18", - "notes": "This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file." - } - }, - { - "description": "Specify the tumour staging system used to stage the cancer at time of retreatment for recurrence or disease progression. This may be represented as rTNM in the medical report.", - "name": "recurrence_tumour_staging_system", - "valueType": "string", - "restrictions": { - "codeList": [ - "AJCC 8th edition", - "AJCC 7th edition", - "AJCC 6th edition", - "Ann Arbor staging system", - "Binet staging system", - "Durie-Salmon staging system", - "FIGO staging system", - "Lugano staging system", - "Rai staging system", - "Revised International staging system (R-ISS)", - "St Jude staging system" - ], - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })", - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })" - ] - }, - "meta": { - "dependsOn": "follow_up.disease_status_at_followup", - "notes": "This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.", - "displayName": "Recurrance Tumour Staging System" - } - }, - { - "name": "recurrence_t_category", - "description": "The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.", - "valueType": "string", - "meta": { - "dependsOn": "follow_up.recurrence_tumour_staging_system", - "notes": "This field is required only if the selected recurrence_tumour_staging_system is any edition of the AJCC cancer staging system.", - "displayName": "Recurrence T Category" - }, - "restrictions": { - "codeList": [ - "T0", - "T1", - "T1a", - "T1a1", - "T1a2", - "T1a(s)", - "T1a(m)", - "T1b", - "T1b1", - "T1b2", - "T1b(s)", - "T1b(m)", - "T1c", - "T1d", - "T1mi", - "T2", - "T2(s)", - "T2(m)", - "T2a", - "T2a1", - "T2a2", - "T2b", - "T2c", - "T2d", - "T3", - "T3(s)", - "T3(m)", - "T3a", - "T3b", - "T3c", - "T3d", - "T3e", - "T4", - "T4a", - "T4a(s)", - "T4a(m)", - "T4b", - "T4b(s)", - "T4b(m)", - "T4c", - "T4d", - "T4e", - "Ta", - "Tis", - "Tis(DCIS)", - "Tis(LAMN)", - "Tis(LCIS)", - "Tis(Paget)", - "Tis(Paget’s)", - "Tis pd", - "Tis pu", - "TX" - ] - } - }, - { - "name": "recurrence_n_category", - "description": "The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.", - "valueType": "string", - "meta": { - "dependsOn": "follow_up.recurrence_tumour_staging_system", - "notes": "This field is required only if the selected recurrence_tumour_staging_system is any edition of the AJCC cancer staging system.", - "displayName": "Recurrence N Category" - }, - "restrictions": { - "codeList": [ - "N0", - "N0a", - "N0a (biopsy)", - "N0b", - "N0b (no biopsy)", - "N0(i+)", - "N0(i-)", - "N0(mol+)", - "N0(mol-)", - "N1", - "N1a", - "N1a(sn)", - "N1b", - "N1c", - "N1mi", - "N2", - "N2a", - "N2b", - "N2c", - "N2mi", - "N3", - "N3a", - "N3b", - "N3c", - "N4", - "NX" - ] - } - }, - { - "name": "recurrence_m_category", - "description": "The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.", - "valueType": "string", - "meta": { - "dependsOn": "follow_up.recurrence_tumour_staging_system", - "notes": "This field is required only if the selected recurrence_tumour_staging_system is any edition of the AJCC cancer staging system.", - "displayName": "Recurrence M Category" - }, - "restrictions": { - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})" - ], - "codeList": [ - "M0", - "M0(i+)", - "M1", - "M1a", - "M1a(0)", - "M1a(1)", - "M1b", - "M1b(0)", - "M1b(1)", - "M1c", - "M1c(0)", - "M1c(1)", - "M1d", - "M1d(0)", - "M1d(1)", - "M1e", - "MX", - "Not applicable" - ] - } - }, - { - "name": "recurrence_stage_group", - "description": "The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) at the time of retreatment for a recurrence or disease progression.", - "valueType": "string", - "meta": { - "dependsOn": "follow_up.recurrence_tumour_staging_system", - "notes": "This field is dependent on the selected recurrence_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications", - "displayName": "Recurrence Stage Group" - }, - "restrictions": { - "codeList": [ - "Occult Carcinoma", - "Stage 0", - "Stage 0a", - "Stage 0is", - "Stage 1", - "Stage 1A", - "Stage 1B", - "Stage A", - "Stage B", - "Stage C", - "Stage I", - "Stage IA", - "Stage IA1", - "Stage IA2", - "Stage IA3", - "Stage IAB", - "Stage IAE", - "Stage IAES", - "Stage IAS", - "Stage IB", - "Stage IB1", - "Stage IB2", - "Stage IBE", - "Stage IBES", - "Stage IBS", - "Stage IC", - "Stage IE", - "Stage IEA", - "Stage IEB", - "Stage IES", - "Stage II", - "Stage II bulky", - "Stage IIA", - "Stage IIA1", - "Stage IIA2", - "Stage IIAE", - "Stage IIAES", - "Stage IIAS", - "Stage IIB", - "Stage IIBE", - "Stage IIBES", - "Stage IIBS", - "Stage IIC", - "Stage IIE", - "Stage IIEA", - "Stage IIEB", - "Stage IIES", - "Stage III", - "Stage IIIA", - "Stage IIIA1", - "Stage IIIA2", - "Stage IIIAE", - "Stage IIIAES", - "Stage IIIAS", - "Stage IIIB", - "Stage IIIBE", - "Stage IIIBES", - "Stage IIIBS", - "Stage IIIC", - "Stage IIIC1", - "Stage IIIC2", - "Stage IIID", - "Stage IIIE", - "Stage IIIES", - "Stage IIIS", - "Stage IIS", - "Stage IS", - "Stage IV", - "Stage IVA", - "Stage IVA1", - "Stage IVA2", - "Stage IVAE", - "Stage IVAES", - "Stage IVAS", - "Stage IVB", - "Stage IVBE", - "Stage IVBES", - "Stage IVBS", - "Stage IVC", - "Stage IVE", - "Stage IVES", - "Stage IVS", - "Cannot be assessed" - ], - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })" - ] - } - }, - { - "description": "Specify the tumour staging system used to stage the cancer after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery. This may be represented as ypTNM or ycTNM in the medical report.", - "name": "posttherapy_tumour_staging_system", - "valueType": "string", - "restrictions": { - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })" - ], - "codeList": [ - "AJCC 8th edition", - "AJCC 7th edition", - "AJCC 6th edition", - "Ann Arbor staging system", - "Binet staging system", - "Durie-Salmon staging system", - "FIGO staging system", - "Lugano staging system", - "Rai staging system", - "Revised International staging system (R-ISS)", - "St Jude staging system" - ] - }, - "meta": { "displayName": "Post-therapy Tumour Staging System" } - }, - { - "name": "posttherapy_t_category", - "description": "The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.", - "valueType": "string", - "meta": { - "dependsOn": "follow_up.posttherapy_tumour_staging_system", - "notes": "This field is required only if the selected posttherapy_tumour_staging_system is any edition of the AJCC cancer staging system.", - "displayName": "Post-therapy T Category" - }, - "restrictions": { - "codeList": [ - "T0", - "T1", - "T1a", - "T1a1", - "T1a2", - "T1a(s)", - "T1a(m)", - "T1b", - "T1b1", - "T1b2", - "T1b(s)", - "T1b(m)", - "T1c", - "T1d", - "T1mi", - "T2", - "T2(s)", - "T2(m)", - "T2a", - "T2a1", - "T2a2", - "T2b", - "T2c", - "T2d", - "T3", - "T3(s)", - "T3(m)", - "T3a", - "T3b", - "T3c", - "T3d", - "T3e", - "T4", - "T4a", - "T4a(s)", - "T4a(m)", - "T4b", - "T4b(s)", - "T4b(m)", - "T4c", - "T4d", - "T4e", - "Ta", - "Tis", - "Tis(DCIS)", - "Tis(LAMN)", - "Tis(LCIS)", - "Tis(Paget)", - "Tis(Paget’s)", - "Tis pd", - "Tis pu", - "TX" - ] - } - }, - { - "name": "posttherapy_n_category", - "description": "The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.", - "valueType": "string", - "meta": { - "dependsOn": "follow_up.posttherapy_tumour_staging_system", - "notes": "This field is required only if the selected posttherapy_tumour_staging_system is any edition of the AJCC cancer staging system.", - "displayName": "Post-therapy N Category" - }, - "restrictions": { - "codeList": [ - "N0", - "N0a", - "N0a (biopsy)", - "N0b", - "N0b (no biopsy)", - "N0(i+)", - "N0(i-)", - "N0(mol+)", - "N0(mol-)", - "N1", - "N1a", - "N1a(sn)", - "N1b", - "N1c", - "N1mi", - "N2", - "N2a", - "N2b", - "N2c", - "N2mi", - "N3", - "N3a", - "N3b", - "N3c", - "N4", - "NX" - ] - } - }, - { - "name": "posttherapy_m_category", - "description": "The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.", - "valueType": "string", - "meta": { - "dependsOn": "follow_up.posttherapy_tumour_staging_system", - "notes": "This field is required only if the selected posttherapy_tumour_staging_system is any edition of the AJCC cancer staging system.", - "displayName": "Post-therapy M Category" - }, - "restrictions": { - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})" - ], - "codeList": [ - "M0", - "M0(i+)", - "M1", - "M1a", - "M1a(0)", - "M1a(1)", - "M1b", - "M1b(0)", - "M1b(1)", - "M1c", - "M1c(0)", - "M1c(1)", - "M1d", - "M1d(0)", - "M1d(1)", - "M1e", - "MX", - "Not applicable" - ] - } - }, - { - "name": "posttherapy_stage_group", - "description": "The code to represent the stage group of the tumour, as assigned by the reporting posttherapy_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery.", - "valueType": "string", - "meta": { - "dependsOn": "follow_up.posttherapy_tumour_staging_system", - "notes": "This field is dependent on the selected posttherapy_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications", - "displayName": "Post-therapy Stage Group" - }, - "restrictions": { - "codeList": [ - "Occult Carcinoma", - "Stage 0", - "Stage 0a", - "Stage 0is", - "Stage 1", - "Stage 1A", - "Stage 1B", - "Stage A", - "Stage B", - "Stage C", - "Stage I", - "Stage IA", - "Stage IA1", - "Stage IA2", - "Stage IA3", - "Stage IAB", - "Stage IAE", - "Stage IAES", - "Stage IAS", - "Stage IB", - "Stage IB1", - "Stage IB2", - "Stage IBE", - "Stage IBES", - "Stage IBS", - "Stage IC", - "Stage IE", - "Stage IEA", - "Stage IEB", - "Stage IES", - "Stage II", - "Stage II bulky", - "Stage IIA", - "Stage IIA1", - "Stage IIA2", - "Stage IIAE", - "Stage IIAES", - "Stage IIAS", - "Stage IIB", - "Stage IIBE", - "Stage IIBES", - "Stage IIBS", - "Stage IIC", - "Stage IIE", - "Stage IIEA", - "Stage IIEB", - "Stage IIES", - "Stage III", - "Stage IIIA", - "Stage IIIA1", - "Stage IIIA2", - "Stage IIIAE", - "Stage IIIAES", - "Stage IIIAS", - "Stage IIIB", - "Stage IIIBE", - "Stage IIIBES", - "Stage IIIBS", - "Stage IIIC", - "Stage IIIC1", - "Stage IIIC2", - "Stage IIID", - "Stage IIIE", - "Stage IIIES", - "Stage IIIS", - "Stage IIS", - "Stage IS", - "Stage IV", - "Stage IVA", - "Stage IVA1", - "Stage IVA2", - "Stage IVAE", - "Stage IVAES", - "Stage IVAS", - "Stage IVB", - "Stage IVBE", - "Stage IVBES", - "Stage IVBS", - "Stage IVC", - "Stage IVE", - "Stage IVES", - "Stage IVS", - "Cannot be assessed" - ], - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })" - ] - } - } - ] - }, - { - "name": "exposure", - "description": "The collection of data elements related to a donor's clinically relevant information not immediately resulting from genetic predispositions.", - "meta": { "parent": "donor" }, - "fields": [ - { - "name": "program_id", - "valueType": "string", - "description": "Unique identifier of the ARGO program.", - "meta": { - "validationDependency": true, - "primaryId": true, - "foreignKey": "sample_registration.program_id", - "displayName": "Program ID" - }, - "restrictions": { "required": true } - }, - { - "description": "Unique identifier of the donor, assigned by the data provider.", - "name": "submitter_donor_id", - "valueType": "string", - "meta": { - "validationDependency": true, - "primaryId": true, - "foreignKey": "sample_registration.submitter_donor_id", - "displayName": "Submitter Donor ID" - }, - "restrictions": { "required": true, "regex": "^[A-Za-z0-9\\-\\._]{1,64}$" } - }, - { - "description": "Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)", - "name": "tobacco_smoking_status", - "valueType": "string", - "meta": { - "displayName": "Tobacco Smoking Status", - "notes": "Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown." - }, - "restrictions": { - "codeList": [ - "Current reformed smoker for <= 15 years", - "Current reformed smoker for > 15 years", - "Current reformed smoker, duration not specified", - "Current smoker", - "Lifelong non-smoker (<100 cigarettes smoked in lifetime)", - "Not applicable", - "Smoking history not documented" - ] - } - }, - { - "description": "Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)", - "name": "tobacco_type", - "valueType": "string", - "meta": { - "displayName": "Tobacco Type", - "dependsOn": "exposure.tobacco_smoking_status", - "notes": "To include multiple values, separate values with a pipe delimiter '|' within your file." - }, - "isArray": true, - "restrictions": { - "codeList": [ - "Chewing Tobacco", - "Cigar", - "Cigarettes", - "Electronic cigarettes", - "Not applicable", - "Pipe", - "Roll-ups", - "Snuff", - "Unknown", - "Waterpipe" - ], - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })" - ] - } - }, - { - "description": "This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)", - "name": "pack_years_smoked", - "valueType": "number", - "meta": { - "displayName": "Pack Years Smoked", - "dependsOn": "exposure.tobacco_smoking_status" - }, - "restrictions": { - "range": { "min": 0 }, - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })" - ] - } - }, - { - "description": "Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)", - "name": "alcohol_history", - "valueType": "string", - "meta": { "displayName": "Alcohol History" }, - "restrictions": { - "codeList": ["Yes", "No", "Not applicable", "Unknown"], - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })" - ] - } - }, - { - "description": "Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)", - "name": "alcohol_consumption_category", - "valueType": "string", - "meta": { "displayName": "Alcohol Consumption Category", "notes": "" }, - "restrictions": { - "codeList": [ - "Daily Drinker", - "None", - "Not applicable", - "Occasional Drinker (< once a month)", - "Social Drinker (> once a month, < once a week)", - "Unknown", - "Weekly Drinker (>=1x a week)" - ], - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })" - ] - } - }, - { - "description": "Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)", - "name": "alcohol_type", - "valueType": "string", - "meta": { - "displayName": "Alcohol Type", - "dependsOn": "exposure.alcohol_consumption_category", - "notes": "To include multiple values, separate values with a pipe delimiter '|' within your file." - }, - "isArray": true, - "restrictions": { - "codeList": ["Beer", "Liquor", "Not applicable", "Other", "Unknown", "Wine"], - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })" - ] - } - }, - { - "description": "Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).", - "name": "opiate_use", - "valueType": "string", - "meta": { "displayName": "Opiate Use" }, - "restrictions": { - "codeList": [ - "Never", - "Not applicable", - "Unknown", - "Yes, currently", - "Yes, only in the past" - ] - } - }, - { - "description": "Indicate if the donor regularly drinks tea, coffee, or other hot drinks.", - "name": "hot_drinks_consumption", - "valueType": "string", - "meta": { "displayName": "Hot Drink Consumption" }, - "restrictions": { - "codeList": [ - "Never", - "Not applicable", - "Unknown", - "Yes, currently", - "Yes, only in the past" - ] - } - }, - { - "description": "Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.", - "name": "red_meat_frequency", - "valueType": "string", - "meta": { "displayName": "Red Meat Consumption Frequency" }, - "restrictions": { - "codeList": [ - "Never", - "Less than once a month", - "1-3 times a month", - "Not applicable", - "Once or twice a week", - "Most days but not every day", - "Every day", - "Unknown" - ] - } - }, - { - "description": "Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.", - "name": "processed_meat_frequency", - "valueType": "string", - "meta": { "displayName": "Processed Meat Consumption Frequency" }, - "restrictions": { - "codeList": [ - "Never", - "Less than once a month", - "1-3 times a month", - "Not applicable", - "Once or twice a week", - "Most days but not every day", - "Every day", - "Unknown" - ] - } - }, - { - "description": "Indicate the frequency of soft drink consumption by the donor.", - "name": "soft_drinks_frequency", - "valueType": "string", - "meta": { "displayName": "Soft Drink Consumption Frequency" }, - "restrictions": { - "codeList": [ - "Never", - "Less than once a month", - "1-3 times a month", - "Not applicable", - "Once or twice a week", - "Most days but not every day", - "Every day", - "Unknown" - ] - } - }, - { - "description": "Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)", - "name": "exercise_frequency", - "valueType": "string", - "meta": { "displayName": "Exercise Frequency" }, - "restrictions": { - "codeList": [ - "Never", - "Less than once a month", - "1-3 times a month", - "Not applicable", - "Once or twice a week", - "Most days but not every day", - "Every day", - "Unknown" - ] - } - }, - { - "description": "Indicate the intensity of exercise. (Reference: NCIt CDE C25539)", - "name": "exercise_intensity", - "valueType": "string", - "meta": { - "displayName": "Exercise Intensity", - "dependsOn": "exposure.exercise_frequency" - }, - "restrictions": { - "codeList": [ - "Low: No increase in the heart beat, and no perspiration", - "Moderate: Increase in the heart beat slightly with some light perspiration", - "Not applicable", - "Vigorous: Increase in the heart beat substantially with heavy perspiration", - "Unknown" - ], - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })" - ] - } - } - ] - }, - { - "name": "family_history", - "description": "The collection of data elements describing a donor's familial relationships and familial cancer history.", - "meta": { "parent": "donor" }, - "fields": [ - { - "name": "program_id", - "valueType": "string", - "description": "Unique identifier of the ARGO program.", - "meta": { - "validationDependency": true, - "primaryId": true, - "foreignKey": "sample_registration.program_id", - "displayName": "Program ID" - }, - "restrictions": { "required": true } - }, - { - "description": "Unique identifier of the donor, assigned by the data provider.", - "name": "submitter_donor_id", - "valueType": "string", - "meta": { - "validationDependency": true, - "primaryId": true, - "foreignKey": "sample_registration.submitter_donor_id", - "displayName": "Submitter Donor ID" - }, - "restrictions": { "required": true, "regex": "^[A-Za-z0-9\\-\\._]{1,64}$" } - }, - { - "description": "Unique identifier of the relative, assigned by the data provider.", - "name": "family_relative_id", - "valueType": "string", - "meta": { - "displayName": "Family Relative ID", - "primaryId": true, - "notes": "This field is required to ensure that family members are identified in unique records. Ids can be as simple as an incremented numeral to ensure uniqueness." - }, - "restrictions": { "required": true, "regex": "^[A-Za-z0-9\\-\\._]{1,64}$" } - }, - { - "description": "Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)", - "name": "relative_with_cancer_history", - "restrictions": { "codeList": ["Yes", "No", "Unknown"] }, - "valueType": "string", - "meta": { "displayName": "Relative with Cancer History" } - }, - { - "description": "Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)", - "name": "relationship_type", - "restrictions": { - "codeList": [ - "Aunt", - "Brother", - "Cousin", - "Daughter", - "Father", - "Grandchild", - "Grandfather", - "Grandmother", - "Maternal Aunt", - "Maternal Cousin", - "Maternal Grandfather", - "Maternal Grandmother", - "Maternal Half-brother", - "Maternal Half-sister", - "Maternal Uncle", - "Mother", - "Nephew", - "Niece", - "Other", - "Paternal Aunt", - "Paternal Cousin", - "Paternal Grandfather", - "Paternal Grandmother", - "Paternal Half-brother", - "Paternal Half-sister", - "Paternal Uncle", - "Sister", - "Son", - "Uncle", - "Unknown" - ] - }, - "valueType": "string", - "meta": { "displayName": "Relationship Type" } - }, - { - "description": "The self-reported gender of related individual.", - "name": "gender_of_relative", - "restrictions": { "codeList": ["Female", "Male", "Other", "Unknown"] }, - "valueType": "string", - "meta": { "displayName": "Gender of Relative" } - }, - { - "description": "The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)", - "name": "age_of_relative_at_diagnosis", - "restrictions": { - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })" - ] - }, - "valueType": "integer", - "meta": { - "dependsOn": "family_history.relative_with_cancer_history", - "displayName": "Age Of Relative At Diagnosis" - } - }, - { - "name": "cancer_type_code_of_relative", - "valueType": "string", - "description": "The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.", - "restrictions": { - "regex": "^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$", - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })" - ] - }, - "meta": { - "examples": "C41.1,C16.9,C00.5,D46.9", - "dependsOn": "family_history.relative_with_cancer_history", - "displayName": "Cancer Type Code (ICD-10) of Relative" - } - }, - { - "description": "Relative's last known state of living or deceased.", - "name": "relative_vital_status", - "restrictions": { "codeList": ["Alive", "Deceased", "Unknown"] }, - "valueType": "string", - "meta": { "displayName": "Vital Status of Relative" } - }, - { - "description": "Indicate the cause of the death of the relative.", - "name": "cause_of_death_of_relative", - "restrictions": { - "codeList": ["Died of cancer", "Died of other reasons", "Unknown"], - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })" - ] - }, - "valueType": "string", - "meta": { - "dependsOn": "family_history.relative_vital_status", - "displayName": "Cause of Death of Relative" - } - }, - { - "description": "Indicate how long, in days, the relative survived from the time they were diagnosed with cancer.", - "name": "relative_survival_time", - "restrictions": { - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })" - ] - }, - "valueType": "integer", - "meta": { - "dependsOn": "family_history.relative_with_cancer_history", - "units": "days", - "displayName": "Survival Time Of Relative" - } - } - ] - }, - { - "name": "biomarker", - "description": "The collection of data elements describing a donor's biomarker tests. A biomarker is a biological molecule found in blood, other body fluids, or tissues that is indicative of the presence of cancer in the body. Each row should include one or more biomarker test(s) associated with a particular clinical event (submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id field). If the biomarker test is not associated with a particular clinical event, then indicate the time interval at which the biomarker test was performed (test_interval field).", - "meta": { "parent": "donor" }, - "fields": [ - { - "name": "program_id", - "valueType": "string", - "description": "Unique identifier of the ARGO program.", - "meta": { - "validationDependency": true, - "primaryId": true, - "foreignKey": "sample_registration.program_id", - "displayName": "Program ID" - }, - "restrictions": { "required": true } - }, - { - "description": "Unique identifier of the donor, assigned by the data provider.", - "name": "submitter_donor_id", - "valueType": "string", - "meta": { - "validationDependency": true, - "primaryId": true, - "foreignKey": "sample_registration.submitter_donor_id", - "displayName": "Submitter Donor ID" - }, - "restrictions": { "required": true, "regex": "^[A-Za-z0-9\\-\\._]{1,64}$" } - }, - { - "name": "submitter_specimen_id", - "description": "Unique identifier of the specimen, assigned by the data provider.", - "valueType": "string", - "meta": { - "validationDependency": true, - "primaryId": true, - "foreignKey": "sample_registration.submitter_specimen_id", - "displayName": "Submitter Specimen ID", - "notes": "Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required." - }, - "restrictions": { - "regex": "^[A-Za-z0-9\\-\\._]{1,64}$", - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })" - ] - } - }, - { - "name": "submitter_primary_diagnosis_id", - "valueType": "string", - "description": "If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.", - "meta": { - "validationDependency": true, - "displayName": "Submitter Primary Diagnosis ID", - "foreignKey": "primary_diagnosis.submitter_primary_diagnosis_id", - "primaryId": true, - "notes": "Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required." - }, - "restrictions": { - "regex": "^[A-Za-z0-9\\-\\._]{1,64}$", - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })" - ] - } - }, - { - "name": "submitter_treatment_id", - "valueType": "string", - "description": "If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.", - "meta": { - "validationDependency": true, - "primaryId": true, - "foreignKey": "treatment.submitter_treatment_id", - "displayName": "Submitter Treatment ID", - "notes": "Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required." - }, - "restrictions": { - "regex": "^[A-Za-z0-9\\-\\._]{1,64}$", - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })" - ] - } - }, - { - "description": "If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.", - "name": "submitter_follow_up_id", - "valueType": "string", - "meta": { - "validationDependency": true, - "primaryId": true, - "foreignKey": "follow_up.submitter_follow_up_id", - "displayName": "Submitter Follow-Up ID", - "notes": "Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required." - }, - "restrictions": { - "regex": "^[A-Za-z0-9\\-\\._]{1,64}$", - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })" - ] - } - }, - { - "description": "If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.", - "name": "test_interval", - "valueType": "integer", - "restrictions": { - "range": { "exclusiveMin": 0 }, - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })" - ] - }, - "meta": { - "validationDependency": true, - "primaryId": true, - "units": "days", - "displayName": "Interval Of Test", - "notes": "This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis." - } - }, - { - "description": "Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)", - "name": "ca19-9_level", - "valueType": "integer", - "restrictions": { "range": { "exclusiveMin": 0 } }, - "meta": { "displayName": "CA19-9 Level" } - }, - { - "description": "Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)", - "name": "crp_levels", - "valueType": "integer", - "restrictions": { "range": { "exclusiveMin": 0 } }, - "meta": { "displayName": "C-reactive protein (CRP) Level" } - }, - { - "description": "Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)", - "name": "ldh_level", - "valueType": "integer", - "restrictions": { "range": { "exclusiveMin": 0 } }, - "meta": { "displayName": "Lactate Dehydrogenase (LDH) Level" } - }, - { - "description": "Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)", - "name": "anc", - "valueType": "integer", - "restrictions": { "range": { "exclusiveMin": 0 } }, - "meta": { "displayName": "Absolute Neutrophil Count (ANC)" } - }, - { - "description": "Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)", - "name": "alc", - "valueType": "integer", - "restrictions": { "range": { "exclusiveMin": 0 } }, - "meta": { "displayName": "Absolute Lymphocyte Count (ALC)" } - }, - { - "description": "Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.", - "name": "brca_carrier", - "valueType": "string", - "restrictions": { - "codeList": [ - "BRCA1", - "BRCA2", - "Both BRCA1 and BRCA2", - "No", - "Not applicable", - "Unknown" - ] - }, - "meta": { "displayName": "BRCA Carrier" } - }, - { - "description": "Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)", - "name": "er_status", - "valueType": "string", - "restrictions": { - "codeList": [ - "Cannot be determined", - "Negative", - "Not applicable", - "Positive", - "Unknown" - ] - }, - "meta": { "displayName": "Estrogen Receptor Status" } - }, - { - "description": "Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)", - "name": "er_allred_score", - "valueType": "string", - "restrictions": { - "codeList": [ - "Total ER Allred score of 1", - "Total ER Allred score of 2", - "Total ER Allred score of 3", - "Total ER Allred score of 4", - "Total ER Allred score of 5", - "Total ER Allred score of 6", - "Total ER Allred score of 7", - "Total ER Allred score of 8", - "Not applicable", - "Unknown" - ] - }, - "meta": { "displayName": "Estrogen Receptor Allred Score" } - }, - { - "name": "er_percent_positive", - "description": "Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).", - "valueType": "number", - "meta": { "displayName": "Estrogen Receptor Percent Positive" }, - "restrictions": { "range": { "min": 0, "max": 1 } } - }, - { - "description": "Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)", - "name": "her2_ihc_status", - "valueType": "string", - "restrictions": { - "codeList": [ - "Cannot be determined", - "Equivocal", - "Negative", - "Not applicable", - "Positive", - "Unknown" - ] - }, - "meta": { - "displayName": "HER2 IHC Status", - "notes": "Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining" - } - }, - { - "description": "Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)", - "name": "her2_ish_status", - "valueType": "string", - "restrictions": { - "codeList": [ - "Cannot be determined", - "Equivocal", - "Positive", - "Negative", - "Not applicable", - "Unknown" - ] - }, - "meta": { "displayName": "HER2 ISH Status" } - }, - { - "description": "Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)", - "name": "pr_status", - "valueType": "string", - "restrictions": { - "codeList": [ - "Cannot be determined", - "Negative", - "Not applicable", - "Positive", - "Unknown" - ] - }, - "meta": { "displayName": "Progesterone Receptor Status" } - }, - { - "description": "Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)", - "name": "pr_allred_score", - "valueType": "string", - "restrictions": { - "codeList": [ - "Total PR Allred score of 1", - "Total PR Allred score of 2", - "Total PR Allred score of 3", - "Total PR Allred score of 4", - "Total PR Allred score of 5", - "Total PR Allred score of 6", - "Total PR Allred score of 7", - "Total PR Allred score of 8", - "Not applicable", - "Unknown" - ] - }, - "meta": { "displayName": "Progesterone Receptor Allred Score" } - }, - { - "name": "pr_percent_positive", - "description": "Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).", - "valueType": "number", - "meta": { "displayName": "Progesterone Receptor Percent Positive" }, - "restrictions": { "range": { "min": 0, "max": 1 } } - }, - { - "description": "Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)", - "name": "pd-l1_status", - "valueType": "string", - "restrictions": { - "codeList": [ - "Cannot be determined", - "Negative", - "Not applicable", - "Positive", - "Unknown" - ] - }, - "meta": { "displayName": "PD-L1 Status" } - }, - { - "description": "Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.", - "name": "alk_ihc_status", - "valueType": "string", - "restrictions": { - "codeList": [ - "Cannot be determined", - "Negative", - "Not applicable", - "Positive", - "Unknown" - ] - }, - "meta": { "displayName": "ALK IHC Status" } - }, - { - "description": "Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.", - "name": "alk_ihc_intensity", - "valueType": "string", - "restrictions": { "codeList": ["0 (No stain)", "+1", "+2", "+3"] }, - "meta": { "displayName": "ALK IHC Intensity" } - }, - { - "description": "Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.", - "name": "alk_fish_status", - "valueType": "string", - "restrictions": { - "codeList": [ - "Cannot be determined", - "Negative", - "Not applicable", - "Positive", - "Unknown" - ] - }, - "meta": { "displayName": "ALK FISH Status" } - }, - { - "description": "Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.", - "name": "ros1_ihc_status", - "valueType": "string", - "restrictions": { - "codeList": [ - "Cannot be determined", - "Negative", - "Not applicable", - "Positive", - "Unknown" - ] - }, - "meta": { "displayName": "ROS1 IHC Status" } - }, - { - "description": "Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.", - "name": "pan-trk_ihc_status", - "valueType": "string", - "restrictions": { - "codeList": [ - "Cannot be determined", - "Negative", - "Not applicable", - "Positive", - "Unknown" - ] - }, - "meta": { "displayName": "Pan-TRK IHC Status" } - }, - { - "description": "Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)", - "name": "ret_fish_status", - "valueType": "string", - "restrictions": { - "codeList": [ - "Cannot be determined", - "Negative", - "Not applicable", - "Positive", - "Unknown" - ] - }, - "meta": { "displayName": "RET1 FISH Status" } - }, - { - "description": "Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).", - "name": "hpv_ihc_status", - "valueType": "string", - "restrictions": { - "codeList": [ - "Cannot be determined", - "Negative", - "Not applicable", - "Positive", - "Unknown" - ] - }, - "meta": { "displayName": "HPV IHC Status" } - }, - { - "description": "Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)", - "name": "hpv_dna_status", - "valueType": "string", - "restrictions": { - "codeList": [ - "Cannot be determined", - "Negative", - "Not applicable", - "Positive", - "Unknown" - ] - }, - "meta": { "displayName": "HPV DNA Status" } - } - ] - }, - { - "name": "comorbidity", - "description": "The collection of data elements related to a donor's comorbidities. A donor's comorbidities are any medical conditions (e.g diabetes, prior cancer malignancies) that have existed or may occur during the clinical course of the donor who has the index disease under study. To submit multiple comorbidities for a single donor, submit multiple rows in the comorbidity file for this donor.", - "meta": { "parent": "donor" }, - "fields": [ - { - "name": "program_id", - "valueType": "string", - "description": "Unique identifier of the ARGO program.", - "meta": { - "validationDependency": true, - "primaryId": true, - "foreignKey": "sample_registration.program_id", - "displayName": "Program ID" - }, - "restrictions": { "required": true } - }, - { - "name": "submitter_donor_id", - "valueType": "string", - "description": "Unique identifier of the donor, assigned by the data provider.", - "meta": { - "validationDependency": true, - "primaryId": true, - "foreignKey": "sample_registration.submitter_donor_id", - "displayName": "Submitter Donor ID" - }, - "restrictions": { "required": true, "regex": "^[A-Za-z0-9\\-\\._]{1,64}$" } - }, - { - "name": "prior_malignancy", - "description": "Prior malignancy affecting donor.", - "restrictions": { "codeList": ["Yes", "No", "Unknown"] }, - "valueType": "string", - "meta": { "displayName": "Prior Malignancy" } - }, - { - "name": "laterality_of_prior_malignancy", - "description": "If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)", - "valueType": "string", - "restrictions": { - "codeList": [ - "Bilateral", - "Left", - "Midline", - "Not applicable", - "Right", - "Unilateral, Side not specified", - "Unknown" - ], - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })" - ] - }, - "meta": { - "dependsOn": "comorbidity.prior_malignancy", - "displayName": "Laterality at Prior Malignancy" - } - }, - { - "name": "age_at_comorbidity_diagnosis", - "valueType": "integer", - "description": "Indicate the age of comorbidity diagnosis, in years.", - "restrictions": { - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })" - ], - "range": { "exclusiveMin": 0 } - }, - "meta": { - "units": "years", - "dependsOn": "comorbidity.comorbidity_type_code", - "displayName": "Age at Comorbidity Diagnosis" - } - }, - { - "name": "comorbidity_type_code", - "valueType": "string", - "description": "Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).", - "restrictions": { - "required": true, - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })" - ], - "regex": "^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$" - }, - "meta": { - "primaryId": true, - "dependsOn": "comorbidity.prior_malignancy", - "examples": "E10, C50.1, I11, M06", - "displayName": "Comorbidity Type Code", - "notes": "This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field." - } - }, - { - "name": "comorbidity_treatment_status", - "valueType": "string", - "description": "Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).", - "restrictions": { - "codeList": ["Yes", "No", "Unknown"], - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })" - ] - }, - "meta": { - "dependsOn": "comorbidity.comorbidity_type_code", - "displayName": "Comorbidity Treatment" - } - }, - { - "name": "comorbidity_treatment", - "valueType": "string", - "description": "Indicate treatment details for the comorbidity (this includes prior malignancies).", - "restrictions": { - "script": [ - "(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })" - ] - }, - "meta": { - "dependsOn": "comorbidity.comorbidity_treatment_status", - "displayName": "Comorbidity Treatment Type" - } - } - ] - } - ], - "_id": "66c3777f2c44e20031788e59", - "name": "ICGC-ARGO Data Dictionary", - "version": "1.23", - "createdAt": "2024-08-19T16:49:03.624Z", - "updatedAt": "2024-08-19T16:49:03.624Z", - "__v": 0 - }, - "versions": [ - { "version": "1.23", "date": "2024-08-19T16:49:03.624Z" }, - { "version": "1.22", "date": "2024-04-18T15:20:13.668Z" }, - { "version": "1.21", "date": "2024-02-06T17:46:37.784Z" }, - { "version": "1.20", "date": "2023-10-27T20:06:58.227Z" }, - { "version": "1.19", "date": "2023-10-18T19:35:24.055Z" }, - { "version": "1.18", "date": "2023-08-25T15:45:15.320Z" }, - { "version": "1.17", "date": "2023-05-10T19:23:31.428Z" }, - { "version": "1.16", "date": "2022-12-22T21:34:51.645Z" }, - { "version": "1.15", "date": "2022-09-23T20:14:56.970Z" }, - { "version": "1.14", "date": "2022-06-16T19:14:29.303Z" }, - { "version": "1.13", "date": "2021-11-17T17:11:23.272Z" }, - { "version": "1.12", "date": "2021-09-02T15:22:35.426Z" }, - { "version": "1.11", "date": "2021-07-21T15:18:56.040Z" }, - { "version": "1.10", "date": "2021-06-08T15:08:16.060Z" }, - { "version": "1.9", "date": "2021-05-07T20:36:01.508Z" }, - { "version": "1.8", "date": "2021-04-27T20:55:03.034Z" }, - { "version": "1.7", "date": "2021-03-15T16:44:50.896Z" }, - { "version": "1.5", "date": "2020-12-11T19:45:31.441Z" }, - { "version": "1.4", "date": "2020-12-11T17:05:35.605Z" }, - { "version": "1.3", "date": "2020-11-24T17:53:13.272Z" }, - { "version": "1.2", "date": "2020-08-05T18:55:43.082Z" }, - { "version": "1.1", "date": "2020-07-16T20:03:43.021Z" }, - { "version": "1.0", "date": "2020-06-19T18:45:52.437Z" }, - { "version": "0.15", "date": "2020-06-17T17:26:07.747Z" }, - { "version": "0.14", "date": "2020-06-04T16:53:19.349Z" }, - { "version": "0.12", "date": "2020-05-28T19:50:37.756Z" }, - { "version": "0.11", "date": "2020-05-13T21:11:56.331Z" }, - { "version": "0.10", "date": "2020-04-13T16:37:27.645Z" }, - { "version": "0.7", "date": "2020-03-30T21:40:09.710Z" }, - { "version": "0.6", "date": "2020-03-27T20:53:14.913Z" }, - { "version": "0.5", "date": "2020-03-06T21:28:41.074Z" } - ], - "currentVersion": { "version": "1.23", "date": "2024-08-19T16:49:03.624Z" } -} +{"dictionary":{"schemas":[{"name":"sample_registration","description":"The collection of data elements required to register the required Donor-Specimen-Sample data to the ARGO Data Platform. Registration of samples is required before molecular and clinical data submission can proceed.","fields":[{"name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"examples":"TEST-CA","notes":"This is the unique id that is assigned to your program. If you have logged into the platform, this is the Program Id that you see in the Program Services area. For example, TEST-CA is a Program ID.","displayName":"Program ID"},"restrictions":{"required":true}},{"name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"examples":"90234,BLD_donor_89,AML-90","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"gender","valueType":"string","description":"Description of the donor self-reported gender. Gender is described as the assemblage of properties that distinguish people on the basis of their societal roles.","meta":{"validationDependency":true,"core":true,"displayName":"Gender"},"restrictions":{"required":true,"codeList":["Female","Male","Other"]}},{"name":"submitter_specimen_id","valueType":"string","description":"Unique identifier of the specimen, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"examples":"LAML_PO,00445,THY_099-tumour","displayName":"Submitter Specimen ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"specimen_tissue_source","valueType":"string","description":"Tissue source of the biospecimen.","meta":{"validationDependency":true,"core":true,"displayName":"Specimen Tissue Source"},"restrictions":{"required":true,"codeList":["Blood derived - bone marrow","Blood derived - peripheral blood","Blood derived","Bone marrow","Bone","Buccal cell","Buffy coat","Cerebellum","Cerebrospinal fluid","Endometrium","Esophagus","Intestine","Lymph node","Mononuclear cells from bone marrow","Other","Plasma","Pleural effusion","Saliva","Serum","Skin","Solid tissue","Spleen","Sputum","Stomach","Tonsil","Urine"]}},{"name":"tumour_normal_designation","valueType":"string","description":"Description of specimens tumour/normal status for data processing.","restrictions":{"required":true,"codeList":["Normal","Tumour"]},"meta":{"validationDependency":true,"core":true,"displayName":"Tumour Normal Designation"}},{"name":"specimen_type","valueType":"string","description":"Description of the kind of specimen that was collected with respect to tumour/normal tissue origin.","restrictions":{"required":true,"codeList":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"core":true,"displayName":"Specimen Type"}},{"name":"submitter_sample_id","valueType":"string","description":"Unique identifier of the sample, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"examples":"hnc_12,CCG_34_94583,BRCA47832-3239","displayName":"Submitter Sample ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"sample_type","valueType":"string","description":"Description of the type of molecular sample used for testing.","meta":{"validationDependency":true,"core":true,"displayName":"Sample Type"},"restrictions":{"required":true,"codeList":["Amplified DNA","ctDNA","Other DNA enrichments","Other RNA fractions","polyA+ RNA","Ribo-Zero RNA","Total DNA","Total RNA"]}}]},{"name":"donor","description":"The collection of data elements related to a specific donor in an ARGO program.","meta":{"parent":"specimen"},"fields":[{"name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},{"description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"description":"Donor's last known state of living or deceased.","name":"vital_status","restrictions":{"codeList":["Alive","Deceased"],"required":true},"valueType":"string","meta":{"validationDependency":true,"core":true,"displayName":"Vital Status"}},{"description":"Indicate the cause of a donor's death.","name":"cause_of_death","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]},"valueType":"string","meta":{"core":true,"dependsOn":"donor.vital_status","notes":"Cause of death is only required to be submitted if the donor's vital_status is Deceased.","displayName":"Cause of Death"}},{"description":"Interval of how long the donor has survived since primary diagnosis, in days.","name":"survival_time","valueType":"integer","meta":{"dependsOn":"donor.vital_status","notes":"Survival_time is only required to be submitted if the donor's vital_status is Deceased.","validationDependency":true,"units":"days","core":"true","displayName":"Survival Time"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"range":{"exclusiveMin":0}}},{"name":"primary_site","valueType":"string","isArray":true,"description":"The text term used to describe the primary site of disease, as categorized by the World Health Organization's (WHO) International Classification of Diseases for Oncology (ICD-O). This categorization groups cases into general categories.","meta":{"displayName":"Primary Site","core":true,"notes":"To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Breast|Ovary"},"restrictions":{"required":true,"codeList":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"]}},{"description":"Indicate the donor's height, in centimeters (cm).","name":"height","valueType":"number","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Height"}},{"description":"Indicate the donor's weight, in kilograms (kg).","name":"weight","valueType":"number","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Weight"}},{"description":"Indicate the donor's Body Mass Index (BMI) in kg/m².","name":"bmi","valueType":"number","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"BMI"}},{"description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},{"description":"Indicate the donor's menopause status at the time of primary diagnosis. (Reference: caDSR CDE ID 2434914)","name":"menopause_status","restrictions":{"codeList":["Not applicable","Perimenopausal","Postmenopausal","Premenopausal","Unknown"]},"valueType":"string","meta":{"displayName":"Menopause Status"}},{"description":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)","name":"age_at_menarche","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Age at Menarche"}},{"description":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)","name":"number_of_pregnancies","valueType":"integer","restrictions":{"range":{"min":0}},"meta":{"displayName":"Number of Pregnancies"}},{"description":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)","name":"number_of_children","valueType":"integer","restrictions":{"range":{"min":0}},"meta":{"displayName":"Number of Children"}},{"description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},{"description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},{"description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},{"description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},{"description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}]},{"name":"specimen","description":"The collection of data elements related to a donor's specimen. A specimen is any material sample taken for testing, diagnostic or research purposes.","meta":{"parent":"sample_registration"},"fields":[{"name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},{"name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate the primary diagnosis event in the clinical timeline that this specimen acquisition was related to.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"pathological_tumour_staging_system","description":"Specify the tumour staging system used to assess the cancer at the time the tumour specimen was resected. Pathological classification is based on the clinical stage information (acquired before treatment) and supplemented/modified by operative findings and pathological evaluation of the resected specimen.","valueType":"string","meta":{"validationDependency":true,"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Pathological Tumour Staging System"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"codeList":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"]}},{"name":"pathological_t_category","description":"The code to represent the stage of cancer defined by the size or contiguous extension of the primary tumour (T), according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","valueType":"string","meta":{"core":true,"dependsOn":"specimen.pathological_tumour_staging_system","notes":"This field is required only if the selected pathological_tumour_staging_system is any edition of the AJCC cancer staging system.","displayName":"Pathological T Category"},"restrictions":{"codeList":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"]}},{"name":"pathological_n_category","description":"The code to represent the stage of cancer defined by whether or not the cancer has reached nearby lymph nodes (N), according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","valueType":"string","meta":{"core":true,"dependsOn":"specimen.pathological_tumour_staging_system","notes":"This field is required only if the selected pathological_tumour_staging_system is any edition of the AJCC cancer staging system.","displayName":"Pathological N Category"},"restrictions":{"codeList":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"]}},{"name":"pathological_m_category","description":"The code to represent the stage of cancer defined by whether there are distant metastases (M), meaning spread of cancer to other parts of the body, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","valueType":"string","meta":{"core":true,"dependsOn":"specimen.pathological_tumour_staging_system","notes":"This field is required only if the selected pathological_tumour_staging_system is any edition of the AJCC cancer staging system.","displayName":"Pathological M Category"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"codeList":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"]}},{"name":"pathological_stage_group","description":"Specify the tumour stage, based on pathological_tumour_staging_system, used to assess the cancer at the time the tumour specimen was resected.","valueType":"string","meta":{"core":true,"dependsOn":"specimen.pathological_tumour_staging_system","notes":"This field depends on the selected pathological_tumour_staging_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","displayName":"Pathological Stage Group"},"restrictions":{"codeList":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}},{"name":"specimen_acquisition_interval","description":"Interval between primary diagnosis and specimen acquisition, in days.","valueType":"integer","meta":{"validationDependency":true,"units":"days","core":true,"notes":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","displayName":"Specimen Acquisition Interval"},"restrictions":{"required":true}},{"name":"tumour_histological_type","description":"The code to represent the histology (morphology) of neoplasms that is usually obtained from a pathology report, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","valueType":"string","meta":{"validationDependency":true,"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","examples":"8260/3,9691/36","displayName":"Tumour Histological Type"},"restrictions":{"regex":"^[8,9]{1}[0-9]{3}/[0,1,2,3,6,9]{1}[1-9]{0,1}$"}},{"name":"specimen_anatomic_location","description":"Indicate the ICD-O-3 topography code for the anatomic location of a specimen when it was collected. Refer to the guidelines provided in the ICD-O-3 manual at https://apps.who.int/iris/handle/10665/42344.","valueType":"string","meta":{"core":true,"displayName":"Specimen Anatomic Location","examples":"C50.1,C18"},"restrictions":{"required":true,"regex":"^[C][0-9]{2}(.[0-9]{1})?$"}},{"name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},{"name":"specimen_processing","description":"Indicate the technique used to process specimen.","valueType":"string","restrictions":{"codeList":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"]},"meta":{"displayName":"Specimen Processing"}},{"name":"specimen_storage","description":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured.","valueType":"string","meta":{"notes":"For specimens that were freshly extracted or immediately cultured, select Not Applicable.","displayName":"Specimen Storage"},"restrictions":{"codeList":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"]}},{"name":"reference_pathology_confirmed","description":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)","valueType":"string","meta":{"validationDependency":true,"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Reference Pathology Confirmed"},"restrictions":{"codeList":["Yes","No","Unknown"]}},{"name":"tumour_grading_system","description":"Specify the tumour staging system used to assess the description of a tumour based on how abnormal the tumour cells and the tumour tissue look under a microscope. Tumour grade is an indicator of how quickly a tumour is likely to grow.","valueType":"string","meta":{"validationDependency":true,"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Tumour Grading System"},"restrictions":{"codeList":["FNCLCC grading system","Four-tier grading system","Gleason grade group system","Grading system for GISTs","Grading system for GNETs","ISUP grading system","Nuclear grading system for DCIS","Scarff-Bloom-Richardson grading system","Three-tier grading system","Two-tier grading system","WHO grading system for CNS tumours"]}},{"name":"tumour_grade","description":"Grade of the tumour as assigned by the reporting tumour_grading_system.","valueType":"string","meta":{"core":true,"dependsOn":"specimen.tumour_grading_system","notes":"This field depends on the selected tumour_grading_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Grading Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-grading-classifications","displayName":"Tumour Grade"},"restrictions":{"codeList":["Low grade","High grade","GX","G1","G2","G3","G4","Low","High","Grade I","Grade II","Grade III","Grade IV","Grade Group 1","Grade Group 2","Grade Group 3","Grade Group 4","Grade Group 5"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]}},{"name":"percent_tumour_cells","description":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)","valueType":"number","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells"},"restrictions":{"range":{"min":0,"max":1},"script":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"]}},{"name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}},{"name":"percent_proliferating_cells","description":"Indicate a value, in decimals, that represents the count of proliferating cells determined during pathologic review of the specimen.","valueType":"number","meta":{"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field should only be submitted if the specimen is tumour.","displayName":"Percent Proliferating Cells"},"restrictions":{"range":{"min":0,"max":1}}},{"name":"percent_inflammatory_tissue","description":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)","valueType":"number","meta":{"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field should only be submitted if the specimen is tumour.","displayName":"Percent Inflammatory Tissue"},"restrictions":{"range":{"min":0,"max":1}}},{"name":"percent_stromal_cells","description":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)","valueType":"number","meta":{"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field should only be submitted if the specimen is tumour.","displayName":"Percent Stromal Cells"},"restrictions":{"range":{"min":0,"max":1}}},{"name":"percent_necrosis","description":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)","valueType":"number","meta":{"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field should only be submitted if the specimen is tumour.","displayName":"Percent Necrosis"},"restrictions":{"range":{"min":0,"max":1}}}]},{"name":"primary_diagnosis","description":"The collection of data elements related to a donor's primary diagnosis. The primary diagnosis is the first diagnosed case of cancer in a donor. To submit multiple primary diagnoses for a single donor, submit multiple rows in the primary diagnosis file for this donor.","meta":{"parent":"donor"},"fields":[{"name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},{"name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"submitter_primary_diagnosis_id","valueType":"string","description":"Unique identifier of the primary diagnosis event, assigned by the data provider.","meta":{"primaryId":true,"displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"age_at_diagnosis","valueType":"integer","description":"Age that the donor was first diagnosed with cancer, in years. This should be based on the earliest diagnosis of cancer.","restrictions":{"required":true,"range":{"exclusiveMin":0,"max":90}},"meta":{"units":"years","core":true,"displayName":"Age at Diagnosis"}},{"name":"cancer_type_code","valueType":"string","description":"The code to represent the cancer type using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"required":true,"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"core":true,"examples":"C41.1,C16.9,C00.5,D46.9","displayName":"Cancer Type Code"}},{"name":"cancer_type_additional_information","valueType":"string","description":"Additional details related to the cancer type that are not covered by the ICD-10 code provided in the cancer_type field.","meta":{"displayName":"Cancer Type Additional Information"}},{"name":"basis_of_diagnosis","description":"Indicate the most valid basis of how the primary diagnosis was identified. If more than one diagnosis technique was used, select the term that has the highest code number (see notes). (Reference: IACR Standard for Basis of Diagnosis http://www.iacr.com.fr/images/doc/basis.pdf)","restrictions":{"codeList":["Clinical investigation","Clinical","Cytology","Death certificate only","Histology of a metastasis","Histology of a primary tumour","Specific tumour markers","Unknown"]},"valueType":"string","meta":{"notes":"0: Death certificate only: Information provided is from a death certificate.\n1: Clinical: Diagnosis made before death.\n2: Clinical investigation: All diagnostic techniques, including X-ray, endoscopy, imaging, ultrasound, exploratory surgery (such as laparotomy), and autopsy, without a tissue diagnosis.\n4: Specific tumour markers: Including biochemical and/or immunologic markers that are specific for a tumour site.\n5: Cytology: Examination of cells from a primary or secondary site, including fluids aspirated by endoscopy or needle; also includes the microscopic examination of peripheral blood and bone marrow aspirates.\n6: Histology of a metastasis: Histologic examination of tissue from a metastasis, including autopsy specimens.\n7: Histology of a primary tumour: Histologic examination of tissue from primary tumour, however obtained, including all cutting techniques and bone marrow biopsies; also includes autopsy specimens of primary tumour.\n9: Unknown: No information on how the diagnosis has been made.","displayName":"Basis of Diagnosis"}},{"name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},{"name":"lymph_nodes_examined_status","description":"Indicate if lymph nodes were examined for metastases.","valueType":"string","restrictions":{"required":true,"codeList":["Cannot be determined","No","No lymph nodes found in resected specimen","Not applicable","Yes"]},"meta":{"core":true,"displayName":"Lymph Nodes Examined Status"}},{"name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}},{"name":"number_lymph_nodes_examined","description":"The total number of lymph nodes tested for the presence of cancer. (Reference: caDSR CDE ID 3)","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"range":{"min":0}},"meta":{"displayName":"Number Of Lymph Nodes Examined","dependsOn":"primary_diagnosis.lymph_nodes_examined_status","notes":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'."}},{"name":"number_lymph_nodes_positive","description":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: caDSR CDE ID 6113694)","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"range":{"min":0}},"meta":{"core":true,"displayName":"Number Of Lymph Nodes Positive","dependsOn":"primary_diagnosis.lymph_nodes_examined_status","notes":"This field is only required if 'lymph_nodes_examined_status' is 'Yes'."}},{"name":"clinical_tumour_staging_system","valueType":"string","description":"Indicate the tumour staging system used to stage the cancer at the time of primary diagnosis (prior to treatment).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"codeList":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"]},"meta":{"validationDependency":true,"core":true,"displayName":"Clinical Tumour Staging System"}},{"name":"clinical_t_category","description":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","valueType":"string","meta":{"core":true,"dependsOn":"primary_diagnosis.clinical_tumour_staging_system","notes":"This field is required only if the selected clinical_tumour_staging_system is any edition of the AJCC cancer staging system.","displayName":"Clinical T Category"},"restrictions":{"codeList":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"]}},{"name":"clinical_n_category","description":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","valueType":"string","meta":{"core":true,"dependsOn":"primary_diagnosis.clinical_tumour_staging_system","notes":"This field is required only if the selected clinical_tumour_staging_system is any edition of the AJCC cancer staging system.","displayName":"Clinical N Category"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"],"codeList":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"]}},{"name":"clinical_m_category","description":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned.","valueType":"string","meta":{"core":true,"dependsOn":"primary_diagnosis.clinical_tumour_staging_system","notes":"This field is required only if the selected clinical_tumour_staging_system is any edition of the AJCC cancer staging system.","displayName":"Clinical M Category"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"codeList":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"]}},{"name":"clinical_stage_group","description":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage.","valueType":"string","restrictions":{"codeList":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.clinical_tumour_staging_system","notes":"This field is dependent on the selected clinical_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","displayName":"Clinical Stage Group","examples":"Stage I, Stage IIB"}},{"name":"presenting_symptoms","description":"Indicate presenting symptoms at time of primary diagnosis.","valueType":"string","isArray":true,"restrictions":{"codeList":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Loss of Appetite","Nausea","None","Not Reported","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Swelling in the Neck","Unknown","Vomiting","Weight Loss"]},"meta":{"displayName":"Presenting Symptoms","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Anemia|Bloating|Diabetes"}},{"name":"performance_status","description":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status).","valueType":"string","restrictions":{"codeList":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"]},"meta":{"notes":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction.\nGrade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work).\nGrade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours.\nGrade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours.\nGrade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair","displayName":"Performance Status"}}]},{"name":"treatment","description":"The collection of data elements related to a donor's treatment at a specific point in the clinical record. To submit multiple treatments for a single donor, please submit treatment rows in the treatment file for this donor.","meta":{"parent":"donor"},"fields":[{"name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},{"name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate the primary diagnosis event in the clinical timeline that this treatment was related to.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"treatment_type","description":"Indicate the type of treatment regimen that the donor completed.","valueType":"string","isArray":true,"restrictions":{"required":true,"codeList":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"]},"meta":{"validationDependency":true,"core":true,"notes":"Depending on the treatment_type(s) selected, additional treatment details may be required to be submitted. For example, if treatment_type includes 'Chemotherapy', the supplemental Chemotherapy treatment type file is required.\nTo include multiple values, separate values with a pipe delimiter '|' within your file.","displayName":"Treatment Type","examples":"Chemotherapy|Hormonal therapy"}},{"name":"is_primary_treatment","description":"Indicate if the treatment was the primary treatment following the initial diagnosis.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Yes","No"]},"meta":{"core":true,"displayName":"Is Primary Treatment","dependsOn":"treatment.treatment_type"}},{"name":"line_of_treatment","description":"Indicate the line of treatment if it is not the primary treatment.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Line Of treatment","dependsOn":"treatment.is_primary_treatment","examples":"2,3,4"}},{"name":"treatment_start_interval","description":"The interval between the primary diagnosis and initiation of treatment, in days.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"core":true,"units":"days","notes":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","displayName":"Treatment Start Interval","dependsOn":"treatment.treatment_type"}},{"name":"treatment_duration","description":"The duration of treatment regimen, in days.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"units":"days","displayName":"Treatment Duration","dependsOn":"treatment.treatment_type"}},{"name":"days_per_cycle","description":"Indicate the number of days in a treatment cycle.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Days Per Cycle","dependsOn":"treatment.treatment_type"}},{"name":"number_of_cycles","description":"Indicate the number of treatment cycles.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Number Of Cycles","dependsOn":"treatment.treatment_type"}},{"name":"treatment_intent","description":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"]},"meta":{"core":true,"displayName":"Treatment Intent","dependsOn":"treatment.treatment_type"}},{"name":"treatment_setting","description":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: NCIt C124308)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"]},"meta":{"core":true,"displayName":"Treatment Setting","dependsOn":"treatment.treatment_type"}},{"name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},{"name":"response_to_treatment","description":"The donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"codeList":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"]},"meta":{"core":true,"displayName":"Response To Treatment","dependsOn":"treatment.response_to_treatment_criteria_method","notes":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},{"name":"outcome_of_treatment","description":"Indicate the donor's outcome of the prescribed treatment.","valueType":"string","restrictions":{"codeList":["Treatment completed as prescribed","Treatment incomplete due to technical or organizational problems","Treatment incomplete because patient died","Patient choice (stopped or interrupted treatment)","Physician decision (stopped or interrupted treatment)","Treatment stopped due to lack of efficacy (disease progression)","Treatment stopped due to acute toxicity","Other","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Outcome Of Treatment","dependsOn":"treatment.treatment_type"}},{"name":"toxicity_type","description":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity.","valueType":"string","restrictions":{"codeList":["Hematological","Non-hematological","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Toxicity Type","dependsOn":"treatment.outcome_of_treatment"}},{"name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},{"name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},{"name":"adverse_events","description":"Report any treatment related adverse events. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Adverse Events","dependsOn":"treatment.treatment_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},{"name":"clinical_trials_database","description":"If the donor is a participant in a clinical trial, indicate the clinical trial database where the clinical trial is registered.","valueType":"string","meta":{"display name":"Clinical Trials Database","notes":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added."},"restrictions":{"codeList":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"]}},{"name":"clinical_trial_number","description":"Based on the clinical_trial_database, indicate the unique NCT or EudraCT clinical trial identifier of which the donor is a participant.","valueType":"string","meta":{"display name":"Clinical Trial Number","dependsOn":"treatment.clinical_trials_database","examples":"2016-002120-83,NCT02465060"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"]}}]},{"name":"chemotherapy","description":"The collection of data elements describing the details of a chemotherapy treatment regimen completed by a donor. To submit multiple treatment drugs for a single regimen, submit multiple rows in the chemotherapy file.","meta":{"parent":"treatment"},"fields":[{"name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},{"name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, as assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},{"name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},{"name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},{"name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},{"name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},{"name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},{"name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},{"name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},{"name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},{"name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},{"name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}]},{"name":"hormone_therapy","description":"The collection of data elements describing the details of a hormone treatment therapy completed by a donor. To submit multiple treatment drugs for a single regimen, submit multiple rows in the hormone_therapy file.","meta":{"parent":"treatment"},"fields":[{"name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},{"name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},{"name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Hormone Therapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},{"name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},{"name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},{"name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},{"name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},{"name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},{"name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}]},{"name":"radiation","description":"The collection of data elements describing the details of a radiation treatment completed by a donor.","meta":{"parent":"treatment"},"fields":[{"name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},{"name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"radiation_therapy_modality","description":"Indicate the method of radiation treatment or modality.","valueType":"string","restrictions":{"required":true,"codeList":["Electron","Heavy Ions","Photon","Proton"]},"meta":{"validationDependency":true,"core":true,"displayName":"Radiation Therapy Modality"}},{"name":"radiation_therapy_type","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal"]},"meta":{"core":true,"displayName":"Type of Radiation Therapy","notes":"Internal application includes Brachytherapy."}},{"name":"radiation_therapy_fractions","description":"Indicate the total number of fractions delivered as part of treatment.","valueType":"integer","restrictions":{"required":true,"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Radiation Therapy Fractions"}},{"name":"radiation_therapy_dosage","description":"Indicate the total dose given in units of Gray (Gy).","valueType":"number","restrictions":{"required":true,"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Radiation Therapy Dosage"}},{"name":"anatomical_site_irradiated","description":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)","valueType":"string","isArray":true,"restrictions":{"required":true,"codeList":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"]},"meta":{"core":true,"displayName":"Anatomical Site Irradiated"}},{"name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},{"name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}]},{"name":"immunotherapy","description":"The collection of data elements describing the details of an immunotherapy treatment completed by a donor.","meta":{"parent":"treatment"},"fields":[{"name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},{"name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"immunotherapy_type","valueType":"string","description":"Indicate the type of immunotherapy administered to donor.","meta":{"displayName":"Immunotherapy Type","core":true},"restrictions":{"required":true,"codeList":["Cell-based","Immune checkpoint inhibitors","Monoclonal antibodies other than immune checkpoint inhibitors","Other immunomodulatory substances"]}},{"name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},{"name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},{"name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},{"name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},{"name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},{"name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},{"name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},{"name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}]},{"name":"surgery","description":"The collection of data elements related to a donor's surgical treatment at a specific point in the clinical record. To submit multiple surgeries, submit multiple rows in the Surgery file. If a specimen was resected during surgery, indicate the unique identifier of the specimen in the 'submitter_specimen_id' field. If multiple specimens were resected during a single surgical procedure, submit each 'submitter_specimen_id' as a new row with the same 'submitter_treatment_id' and 'surgery_type' values.","meta":{"parent":"donor"},"fields":[{"name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},{"name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},{"name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},{"name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},{"name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},{"name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},{"name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},{"name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},{"name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},{"name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},{"name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},{"name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},{"name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},{"name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},{"name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}]},{"name":"follow_up","description":"The collection of data elements related to a specific follow-up visit to a donor. A follow-up is defined as any point of contact with a patient after primary diagnosis. To submit multiple follow-ups for a single donor, please submit multiple rows in the follow-up file for this donor.","meta":{"parent":"donor"},"fields":[{"name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},{"description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"description":"Unique identifier for a follow-up event in a donor's clinical record, assigned by the data provider.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"displayName":"Submitter Follow-Up ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"description":"Interval from the primary diagnosis date to the follow-up date, in days.","name":"interval_of_followup","valueType":"integer","restrictions":{"required":true},"meta":{"core":true,"units":"days","displayName":"Interval Of Follow-Up","notes":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},{"description":"Indicate the donor's disease status at time of follow-up. (Reference: RECIST)","name":"disease_status_at_followup","valueType":"string","restrictions":{"required":true,"codeList":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Progression NOS","Relapse or recurrence","Stable"]},"meta":{"core":true,"displayName":"Disease Status at Follow-Up"}},{"name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate if the follow-up is related to a specific primary diagnosis event in the clinical timeline.","meta":{"validationDependency":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID","primaryId":true},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"submitter_treatment_id","valueType":"string","description":"Indicate if the follow-up is related to a specific treatment event in the clinical timeline.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"description":"Indicate the donor's weight, in kilograms (kg), at the time of follow-up.","name":"weight_at_followup","valueType":"number","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Weight at Follow-Up"}},{"description":"Indicate the donor's relapse type.","name":"relapse_type","valueType":"string","restrictions":{"codeList":["Distant recurrence/metastasis","Local recurrence","Local recurrence and distant metastasis","Progression (liquid tumours)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.","displayName":"Relapse Type"}},{"description":"If the donor was clinically disease free following primary treatment and then relapse or recurrence or progression (for liquid tumours) occurred afterwards, then this field will indicate the length of disease free interval, in days.","name":"relapse_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"]},"meta":{"core":true,"units":"days","dependsOn":"follow_up.disease_status_at_followup","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.","displayName":"Relapse Interval"}},{"description":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Reference: caDSR CDE ID 6161031)","name":"method_of_progression_status","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"codeList":["Biomarker in liquid biopsy (e.g. tumour marker in blood or urine)","Biopsy","Blood draw","Bone marrow aspirate","Core biopsy","Cystoscopy","Cytology","Debulking","Diagnostic imaging","Dilation and curettage procedure","Enucleation","Excisional biopsy","Fine needle aspiration","Imaging","Incisional biopsy","Laparoscopy","Laparotomy","Other","Pap Smear","Pathologic review","Physical exam","Surgical resection","Thoracentesis","Ultrasound guided biopsy"]},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file.","displayName":"Method Of Progression Status"}},{"description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}},{"description":"Specify the tumour staging system used to stage the cancer at time of retreatment for recurrence or disease progression. This may be represented as rTNM in the medical report.","name":"recurrence_tumour_staging_system","valueType":"string","restrictions":{"codeList":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"follow_up.disease_status_at_followup","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.","displayName":"Recurrance Tumour Staging System"}},{"name":"recurrence_t_category","description":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","valueType":"string","meta":{"dependsOn":"follow_up.recurrence_tumour_staging_system","notes":"This field is required only if the selected recurrence_tumour_staging_system is any edition of the AJCC cancer staging system.","displayName":"Recurrence T Category"},"restrictions":{"codeList":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"]}},{"name":"recurrence_n_category","description":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","valueType":"string","meta":{"dependsOn":"follow_up.recurrence_tumour_staging_system","notes":"This field is required only if the selected recurrence_tumour_staging_system is any edition of the AJCC cancer staging system.","displayName":"Recurrence N Category"},"restrictions":{"codeList":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"]}},{"name":"recurrence_m_category","description":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","valueType":"string","meta":{"dependsOn":"follow_up.recurrence_tumour_staging_system","notes":"This field is required only if the selected recurrence_tumour_staging_system is any edition of the AJCC cancer staging system.","displayName":"Recurrence M Category"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"codeList":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"]}},{"name":"recurrence_stage_group","description":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) at the time of retreatment for a recurrence or disease progression.","valueType":"string","meta":{"dependsOn":"follow_up.recurrence_tumour_staging_system","notes":"This field is dependent on the selected recurrence_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","displayName":"Recurrence Stage Group"},"restrictions":{"codeList":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}},{"description":"Specify the tumour staging system used to stage the cancer after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery. This may be represented as ypTNM or ycTNM in the medical report.","name":"posttherapy_tumour_staging_system","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"codeList":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"]},"meta":{"displayName":"Post-therapy Tumour Staging System"}},{"name":"posttherapy_t_category","description":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","valueType":"string","meta":{"dependsOn":"follow_up.posttherapy_tumour_staging_system","notes":"This field is required only if the selected posttherapy_tumour_staging_system is any edition of the AJCC cancer staging system.","displayName":"Post-therapy T Category"},"restrictions":{"codeList":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"]}},{"name":"posttherapy_n_category","description":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","valueType":"string","meta":{"dependsOn":"follow_up.posttherapy_tumour_staging_system","notes":"This field is required only if the selected posttherapy_tumour_staging_system is any edition of the AJCC cancer staging system.","displayName":"Post-therapy N Category"},"restrictions":{"codeList":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"]}},{"name":"posttherapy_m_category","description":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","valueType":"string","meta":{"dependsOn":"follow_up.posttherapy_tumour_staging_system","notes":"This field is required only if the selected posttherapy_tumour_staging_system is any edition of the AJCC cancer staging system.","displayName":"Post-therapy M Category"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"codeList":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"]}},{"name":"posttherapy_stage_group","description":"The code to represent the stage group of the tumour, as assigned by the reporting posttherapy_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery.","valueType":"string","meta":{"dependsOn":"follow_up.posttherapy_tumour_staging_system","notes":"This field is dependent on the selected posttherapy_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","displayName":"Post-therapy Stage Group"},"restrictions":{"codeList":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}]},{"name":"exposure","description":"The collection of data elements related to a donor's clinically relevant information not immediately resulting from genetic predispositions.","meta":{"parent":"donor"},"fields":[{"name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},{"description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},{"description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},{"description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},{"description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},{"description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},{"description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},{"description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},{"description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},{"description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},{"description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},{"description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},{"description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},{"description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}]},{"name":"family_history","description":"The collection of data elements describing a donor's familial relationships and familial cancer history.","meta":{"parent":"donor"},"fields":[{"name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},{"description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"description":"Unique identifier of the relative, assigned by the data provider.","name":"family_relative_id","valueType":"string","meta":{"displayName":"Family Relative ID","primaryId":true,"notes":"This field is required to ensure that family members are identified in unique records. Ids can be as simple as an incremented numeral to ensure uniqueness."},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"description":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","name":"relative_with_cancer_history","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Relative with Cancer History"}},{"description":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","name":"relationship_type","restrictions":{"codeList":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"]},"valueType":"string","meta":{"displayName":"Relationship Type"}},{"description":"The self-reported gender of related individual.","name":"gender_of_relative","restrictions":{"codeList":["Female","Male","Other","Unknown"]},"valueType":"string","meta":{"displayName":"Gender of Relative"}},{"description":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","name":"age_of_relative_at_diagnosis","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","displayName":"Age Of Relative At Diagnosis"}},{"name":"cancer_type_code_of_relative","valueType":"string","description":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"examples":"C41.1,C16.9,C00.5,D46.9","dependsOn":"family_history.relative_with_cancer_history","displayName":"Cancer Type Code (ICD-10) of Relative"}},{"description":"Relative's last known state of living or deceased.","name":"relative_vital_status","restrictions":{"codeList":["Alive","Deceased","Unknown"]},"valueType":"string","meta":{"displayName":"Vital Status of Relative"}},{"description":"Indicate the cause of the death of the relative.","name":"cause_of_death_of_relative","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]},"valueType":"string","meta":{"dependsOn":"family_history.relative_vital_status","displayName":"Cause of Death of Relative"}},{"description":"Indicate how long, in days, the relative survived from the time they were diagnosed with cancer.","name":"relative_survival_time","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","units":"days","displayName":"Survival Time Of Relative"}}]},{"name":"biomarker","description":"The collection of data elements describing a donor's biomarker tests. A biomarker is a biological molecule found in blood, other body fluids, or tissues that is indicative of the presence of cancer in the body. Each row should include one or more biomarker test(s) associated with a particular clinical event (submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id field). If the biomarker test is not associated with a particular clinical event, then indicate the time interval at which the biomarker test was performed (test_interval field).","meta":{"parent":"donor"},"fields":[{"name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},{"description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},{"name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},{"name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},{"description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},{"description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},{"description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},{"description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},{"description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},{"description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},{"description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},{"description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},{"description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},{"description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},{"name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},{"description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},{"description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},{"description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},{"description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},{"name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},{"description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},{"description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},{"description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},{"description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},{"description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},{"description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},{"description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},{"description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},{"description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}]},{"name":"comorbidity","description":"The collection of data elements related to a donor's comorbidities. A donor's comorbidities are any medical conditions (e.g diabetes, prior cancer malignancies) that have existed or may occur during the clinical course of the donor who has the index disease under study. To submit multiple comorbidities for a single donor, submit multiple rows in the comorbidity file for this donor.","meta":{"parent":"donor"},"fields":[{"name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},{"name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},{"name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},{"name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},{"name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},{"name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},{"name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}]}],"_id":"66fbc19f8d738c00323e8c30","name":"ICGC-ARGO Data Dictionary","version":"1.24","createdAt":"2024-10-01T09:32:15.397Z","updatedAt":"2024-10-01T09:32:15.397Z","__v":0},"versions":[{"version":"1.24","date":"2024-10-01T09:32:15.397Z"},{"version":"1.23","date":"2024-08-19T16:49:03.624Z"},{"version":"1.22","date":"2024-04-18T15:20:13.668Z"},{"version":"1.21","date":"2024-02-06T17:46:37.784Z"},{"version":"1.20","date":"2023-10-27T20:06:58.227Z"},{"version":"1.19","date":"2023-10-18T19:35:24.055Z"},{"version":"1.18","date":"2023-08-25T15:45:15.320Z"},{"version":"1.17","date":"2023-05-10T19:23:31.428Z"},{"version":"1.16","date":"2022-12-22T21:34:51.645Z"},{"version":"1.15","date":"2022-09-23T20:14:56.970Z"},{"version":"1.14","date":"2022-06-16T19:14:29.303Z"},{"version":"1.13","date":"2021-11-17T17:11:23.272Z"},{"version":"1.12","date":"2021-09-02T15:22:35.426Z"},{"version":"1.11","date":"2021-07-21T15:18:56.040Z"},{"version":"1.10","date":"2021-06-08T15:08:16.060Z"},{"version":"1.9","date":"2021-05-07T20:36:01.508Z"},{"version":"1.8","date":"2021-04-27T20:55:03.034Z"},{"version":"1.7","date":"2021-03-15T16:44:50.896Z"},{"version":"1.5","date":"2020-12-11T19:45:31.441Z"},{"version":"1.4","date":"2020-12-11T17:05:35.605Z"},{"version":"1.3","date":"2020-11-24T17:53:13.272Z"},{"version":"1.2","date":"2020-08-05T18:55:43.082Z"},{"version":"1.1","date":"2020-07-16T20:03:43.021Z"},{"version":"1.0","date":"2020-06-19T18:45:52.437Z"},{"version":"0.15","date":"2020-06-17T17:26:07.747Z"},{"version":"0.14","date":"2020-06-04T16:53:19.349Z"},{"version":"0.12","date":"2020-05-28T19:50:37.756Z"},{"version":"0.11","date":"2020-05-13T21:11:56.331Z"},{"version":"0.10","date":"2020-04-13T16:37:27.645Z"},{"version":"0.7","date":"2020-03-30T21:40:09.710Z"},{"version":"0.6","date":"2020-03-27T20:53:14.913Z"},{"version":"0.5","date":"2020-03-06T21:28:41.074Z"}],"currentVersion":{"version":"1.24","date":"2024-10-01T09:32:15.397Z"}} \ No newline at end of file diff --git a/website/static/data/schemas/1.24.json b/website/static/data/schemas/1.24.json new file mode 100644 index 00000000..02ceb11b --- /dev/null +++ b/website/static/data/schemas/1.24.json @@ -0,0 +1 @@ +{"schemas":[{"name":"sample_registration","description":"The collection of data elements required to register the required Donor-Specimen-Sample data to the ARGO Data Platform. Registration of samples is required before molecular and clinical data submission can proceed.","fields":[{"name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"examples":"TEST-CA","notes":"This is the unique id that is assigned to your program. If you have logged into the platform, this is the Program Id that you see in the Program Services area. For example, TEST-CA is a Program ID.","displayName":"Program ID"},"restrictions":{"required":true}},{"name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"examples":"90234,BLD_donor_89,AML-90","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"gender","valueType":"string","description":"Description of the donor self-reported gender. Gender is described as the assemblage of properties that distinguish people on the basis of their societal roles.","meta":{"validationDependency":true,"core":true,"displayName":"Gender"},"restrictions":{"required":true,"codeList":["Female","Male","Other"]}},{"name":"submitter_specimen_id","valueType":"string","description":"Unique identifier of the specimen, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"examples":"LAML_PO,00445,THY_099-tumour","displayName":"Submitter Specimen ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"specimen_tissue_source","valueType":"string","description":"Tissue source of the biospecimen.","meta":{"validationDependency":true,"core":true,"displayName":"Specimen Tissue Source"},"restrictions":{"required":true,"codeList":["Blood derived - bone marrow","Blood derived - peripheral blood","Blood derived","Bone marrow","Bone","Buccal cell","Buffy coat","Cerebellum","Cerebrospinal fluid","Endometrium","Esophagus","Intestine","Lymph node","Mononuclear cells from bone marrow","Other","Plasma","Pleural effusion","Saliva","Serum","Skin","Solid tissue","Spleen","Sputum","Stomach","Tonsil","Urine"]}},{"name":"tumour_normal_designation","valueType":"string","description":"Description of specimens tumour/normal status for data processing.","restrictions":{"required":true,"codeList":["Normal","Tumour"]},"meta":{"validationDependency":true,"core":true,"displayName":"Tumour Normal Designation"}},{"name":"specimen_type","valueType":"string","description":"Description of the kind of specimen that was collected with respect to tumour/normal tissue origin.","restrictions":{"required":true,"codeList":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"core":true,"displayName":"Specimen Type"}},{"name":"submitter_sample_id","valueType":"string","description":"Unique identifier of the sample, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"examples":"hnc_12,CCG_34_94583,BRCA47832-3239","displayName":"Submitter Sample ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"sample_type","valueType":"string","description":"Description of the type of molecular sample used for testing.","meta":{"validationDependency":true,"core":true,"displayName":"Sample Type"},"restrictions":{"required":true,"codeList":["Amplified DNA","ctDNA","Other DNA enrichments","Other RNA fractions","polyA+ RNA","Ribo-Zero RNA","Total DNA","Total RNA"]}}]},{"name":"donor","description":"The collection of data elements related to a specific donor in an ARGO program.","meta":{"parent":"specimen"},"fields":[{"name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},{"description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"description":"Donor's last known state of living or deceased.","name":"vital_status","restrictions":{"codeList":["Alive","Deceased"],"required":true},"valueType":"string","meta":{"validationDependency":true,"core":true,"displayName":"Vital Status"}},{"description":"Indicate the cause of a donor's death.","name":"cause_of_death","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]},"valueType":"string","meta":{"core":true,"dependsOn":"donor.vital_status","notes":"Cause of death is only required to be submitted if the donor's vital_status is Deceased.","displayName":"Cause of Death"}},{"description":"Interval of how long the donor has survived since primary diagnosis, in days.","name":"survival_time","valueType":"integer","meta":{"dependsOn":"donor.vital_status","notes":"Survival_time is only required to be submitted if the donor's vital_status is Deceased.","validationDependency":true,"units":"days","core":"true","displayName":"Survival Time"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"range":{"exclusiveMin":0}}},{"name":"primary_site","valueType":"string","isArray":true,"description":"The text term used to describe the primary site of disease, as categorized by the World Health Organization's (WHO) International Classification of Diseases for Oncology (ICD-O). This categorization groups cases into general categories.","meta":{"displayName":"Primary Site","core":true,"notes":"To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Breast|Ovary"},"restrictions":{"required":true,"codeList":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"]}},{"description":"Indicate the donor's height, in centimeters (cm).","name":"height","valueType":"number","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Height"}},{"description":"Indicate the donor's weight, in kilograms (kg).","name":"weight","valueType":"number","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Weight"}},{"description":"Indicate the donor's Body Mass Index (BMI) in kg/m².","name":"bmi","valueType":"number","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"BMI"}},{"description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},{"description":"Indicate the donor's menopause status at the time of primary diagnosis. (Reference: caDSR CDE ID 2434914)","name":"menopause_status","restrictions":{"codeList":["Not applicable","Perimenopausal","Postmenopausal","Premenopausal","Unknown"]},"valueType":"string","meta":{"displayName":"Menopause Status"}},{"description":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)","name":"age_at_menarche","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Age at Menarche"}},{"description":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)","name":"number_of_pregnancies","valueType":"integer","restrictions":{"range":{"min":0}},"meta":{"displayName":"Number of Pregnancies"}},{"description":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)","name":"number_of_children","valueType":"integer","restrictions":{"range":{"min":0}},"meta":{"displayName":"Number of Children"}},{"description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},{"description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},{"description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},{"description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},{"description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}]},{"name":"specimen","description":"The collection of data elements related to a donor's specimen. A specimen is any material sample taken for testing, diagnostic or research purposes.","meta":{"parent":"sample_registration"},"fields":[{"name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},{"name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate the primary diagnosis event in the clinical timeline that this specimen acquisition was related to.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"pathological_tumour_staging_system","description":"Specify the tumour staging system used to assess the cancer at the time the tumour specimen was resected. Pathological classification is based on the clinical stage information (acquired before treatment) and supplemented/modified by operative findings and pathological evaluation of the resected specimen.","valueType":"string","meta":{"validationDependency":true,"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Pathological Tumour Staging System"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"codeList":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"]}},{"name":"pathological_t_category","description":"The code to represent the stage of cancer defined by the size or contiguous extension of the primary tumour (T), according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","valueType":"string","meta":{"core":true,"dependsOn":"specimen.pathological_tumour_staging_system","notes":"This field is required only if the selected pathological_tumour_staging_system is any edition of the AJCC cancer staging system.","displayName":"Pathological T Category"},"restrictions":{"codeList":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"]}},{"name":"pathological_n_category","description":"The code to represent the stage of cancer defined by whether or not the cancer has reached nearby lymph nodes (N), according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","valueType":"string","meta":{"core":true,"dependsOn":"specimen.pathological_tumour_staging_system","notes":"This field is required only if the selected pathological_tumour_staging_system is any edition of the AJCC cancer staging system.","displayName":"Pathological N Category"},"restrictions":{"codeList":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"]}},{"name":"pathological_m_category","description":"The code to represent the stage of cancer defined by whether there are distant metastases (M), meaning spread of cancer to other parts of the body, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","valueType":"string","meta":{"core":true,"dependsOn":"specimen.pathological_tumour_staging_system","notes":"This field is required only if the selected pathological_tumour_staging_system is any edition of the AJCC cancer staging system.","displayName":"Pathological M Category"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"codeList":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"]}},{"name":"pathological_stage_group","description":"Specify the tumour stage, based on pathological_tumour_staging_system, used to assess the cancer at the time the tumour specimen was resected.","valueType":"string","meta":{"core":true,"dependsOn":"specimen.pathological_tumour_staging_system","notes":"This field depends on the selected pathological_tumour_staging_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","displayName":"Pathological Stage Group"},"restrictions":{"codeList":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}},{"name":"specimen_acquisition_interval","description":"Interval between primary diagnosis and specimen acquisition, in days.","valueType":"integer","meta":{"validationDependency":true,"units":"days","core":true,"notes":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","displayName":"Specimen Acquisition Interval"},"restrictions":{"required":true}},{"name":"tumour_histological_type","description":"The code to represent the histology (morphology) of neoplasms that is usually obtained from a pathology report, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","valueType":"string","meta":{"validationDependency":true,"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","examples":"8260/3,9691/36","displayName":"Tumour Histological Type"},"restrictions":{"regex":"^[8,9]{1}[0-9]{3}/[0,1,2,3,6,9]{1}[1-9]{0,1}$"}},{"name":"specimen_anatomic_location","description":"Indicate the ICD-O-3 topography code for the anatomic location of a specimen when it was collected. Refer to the guidelines provided in the ICD-O-3 manual at https://apps.who.int/iris/handle/10665/42344.","valueType":"string","meta":{"core":true,"displayName":"Specimen Anatomic Location","examples":"C50.1,C18"},"restrictions":{"required":true,"regex":"^[C][0-9]{2}(.[0-9]{1})?$"}},{"name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},{"name":"specimen_processing","description":"Indicate the technique used to process specimen.","valueType":"string","restrictions":{"codeList":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"]},"meta":{"displayName":"Specimen Processing"}},{"name":"specimen_storage","description":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured.","valueType":"string","meta":{"notes":"For specimens that were freshly extracted or immediately cultured, select Not Applicable.","displayName":"Specimen Storage"},"restrictions":{"codeList":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"]}},{"name":"reference_pathology_confirmed","description":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)","valueType":"string","meta":{"validationDependency":true,"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Reference Pathology Confirmed"},"restrictions":{"codeList":["Yes","No","Unknown"]}},{"name":"tumour_grading_system","description":"Specify the tumour staging system used to assess the description of a tumour based on how abnormal the tumour cells and the tumour tissue look under a microscope. Tumour grade is an indicator of how quickly a tumour is likely to grow.","valueType":"string","meta":{"validationDependency":true,"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Tumour Grading System"},"restrictions":{"codeList":["FNCLCC grading system","Four-tier grading system","Gleason grade group system","Grading system for GISTs","Grading system for GNETs","ISUP grading system","Nuclear grading system for DCIS","Scarff-Bloom-Richardson grading system","Three-tier grading system","Two-tier grading system","WHO grading system for CNS tumours"]}},{"name":"tumour_grade","description":"Grade of the tumour as assigned by the reporting tumour_grading_system.","valueType":"string","meta":{"core":true,"dependsOn":"specimen.tumour_grading_system","notes":"This field depends on the selected tumour_grading_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Grading Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-grading-classifications","displayName":"Tumour Grade"},"restrictions":{"codeList":["Low grade","High grade","GX","G1","G2","G3","G4","Low","High","Grade I","Grade II","Grade III","Grade IV","Grade Group 1","Grade Group 2","Grade Group 3","Grade Group 4","Grade Group 5"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]}},{"name":"percent_tumour_cells","description":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)","valueType":"number","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells"},"restrictions":{"range":{"min":0,"max":1},"script":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"]}},{"name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}},{"name":"percent_proliferating_cells","description":"Indicate a value, in decimals, that represents the count of proliferating cells determined during pathologic review of the specimen.","valueType":"number","meta":{"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field should only be submitted if the specimen is tumour.","displayName":"Percent Proliferating Cells"},"restrictions":{"range":{"min":0,"max":1}}},{"name":"percent_inflammatory_tissue","description":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)","valueType":"number","meta":{"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field should only be submitted if the specimen is tumour.","displayName":"Percent Inflammatory Tissue"},"restrictions":{"range":{"min":0,"max":1}}},{"name":"percent_stromal_cells","description":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)","valueType":"number","meta":{"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field should only be submitted if the specimen is tumour.","displayName":"Percent Stromal Cells"},"restrictions":{"range":{"min":0,"max":1}}},{"name":"percent_necrosis","description":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)","valueType":"number","meta":{"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field should only be submitted if the specimen is tumour.","displayName":"Percent Necrosis"},"restrictions":{"range":{"min":0,"max":1}}}]},{"name":"primary_diagnosis","description":"The collection of data elements related to a donor's primary diagnosis. The primary diagnosis is the first diagnosed case of cancer in a donor. To submit multiple primary diagnoses for a single donor, submit multiple rows in the primary diagnosis file for this donor.","meta":{"parent":"donor"},"fields":[{"name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},{"name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"submitter_primary_diagnosis_id","valueType":"string","description":"Unique identifier of the primary diagnosis event, assigned by the data provider.","meta":{"primaryId":true,"displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"age_at_diagnosis","valueType":"integer","description":"Age that the donor was first diagnosed with cancer, in years. This should be based on the earliest diagnosis of cancer.","restrictions":{"required":true,"range":{"exclusiveMin":0,"max":90}},"meta":{"units":"years","core":true,"displayName":"Age at Diagnosis"}},{"name":"cancer_type_code","valueType":"string","description":"The code to represent the cancer type using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"required":true,"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"core":true,"examples":"C41.1,C16.9,C00.5,D46.9","displayName":"Cancer Type Code"}},{"name":"cancer_type_additional_information","valueType":"string","description":"Additional details related to the cancer type that are not covered by the ICD-10 code provided in the cancer_type field.","meta":{"displayName":"Cancer Type Additional Information"}},{"name":"basis_of_diagnosis","description":"Indicate the most valid basis of how the primary diagnosis was identified. If more than one diagnosis technique was used, select the term that has the highest code number (see notes). (Reference: IACR Standard for Basis of Diagnosis http://www.iacr.com.fr/images/doc/basis.pdf)","restrictions":{"codeList":["Clinical investigation","Clinical","Cytology","Death certificate only","Histology of a metastasis","Histology of a primary tumour","Specific tumour markers","Unknown"]},"valueType":"string","meta":{"notes":"0: Death certificate only: Information provided is from a death certificate.\n1: Clinical: Diagnosis made before death.\n2: Clinical investigation: All diagnostic techniques, including X-ray, endoscopy, imaging, ultrasound, exploratory surgery (such as laparotomy), and autopsy, without a tissue diagnosis.\n4: Specific tumour markers: Including biochemical and/or immunologic markers that are specific for a tumour site.\n5: Cytology: Examination of cells from a primary or secondary site, including fluids aspirated by endoscopy or needle; also includes the microscopic examination of peripheral blood and bone marrow aspirates.\n6: Histology of a metastasis: Histologic examination of tissue from a metastasis, including autopsy specimens.\n7: Histology of a primary tumour: Histologic examination of tissue from primary tumour, however obtained, including all cutting techniques and bone marrow biopsies; also includes autopsy specimens of primary tumour.\n9: Unknown: No information on how the diagnosis has been made.","displayName":"Basis of Diagnosis"}},{"name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},{"name":"lymph_nodes_examined_status","description":"Indicate if lymph nodes were examined for metastases.","valueType":"string","restrictions":{"required":true,"codeList":["Cannot be determined","No","No lymph nodes found in resected specimen","Not applicable","Yes"]},"meta":{"core":true,"displayName":"Lymph Nodes Examined Status"}},{"name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}},{"name":"number_lymph_nodes_examined","description":"The total number of lymph nodes tested for the presence of cancer. (Reference: caDSR CDE ID 3)","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"range":{"min":0}},"meta":{"displayName":"Number Of Lymph Nodes Examined","dependsOn":"primary_diagnosis.lymph_nodes_examined_status","notes":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'."}},{"name":"number_lymph_nodes_positive","description":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: caDSR CDE ID 6113694)","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"range":{"min":0}},"meta":{"core":true,"displayName":"Number Of Lymph Nodes Positive","dependsOn":"primary_diagnosis.lymph_nodes_examined_status","notes":"This field is only required if 'lymph_nodes_examined_status' is 'Yes'."}},{"name":"clinical_tumour_staging_system","valueType":"string","description":"Indicate the tumour staging system used to stage the cancer at the time of primary diagnosis (prior to treatment).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"codeList":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"]},"meta":{"validationDependency":true,"core":true,"displayName":"Clinical Tumour Staging System"}},{"name":"clinical_t_category","description":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","valueType":"string","meta":{"core":true,"dependsOn":"primary_diagnosis.clinical_tumour_staging_system","notes":"This field is required only if the selected clinical_tumour_staging_system is any edition of the AJCC cancer staging system.","displayName":"Clinical T Category"},"restrictions":{"codeList":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"]}},{"name":"clinical_n_category","description":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","valueType":"string","meta":{"core":true,"dependsOn":"primary_diagnosis.clinical_tumour_staging_system","notes":"This field is required only if the selected clinical_tumour_staging_system is any edition of the AJCC cancer staging system.","displayName":"Clinical N Category"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"],"codeList":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"]}},{"name":"clinical_m_category","description":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned.","valueType":"string","meta":{"core":true,"dependsOn":"primary_diagnosis.clinical_tumour_staging_system","notes":"This field is required only if the selected clinical_tumour_staging_system is any edition of the AJCC cancer staging system.","displayName":"Clinical M Category"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"codeList":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"]}},{"name":"clinical_stage_group","description":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage.","valueType":"string","restrictions":{"codeList":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.clinical_tumour_staging_system","notes":"This field is dependent on the selected clinical_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","displayName":"Clinical Stage Group","examples":"Stage I, Stage IIB"}},{"name":"presenting_symptoms","description":"Indicate presenting symptoms at time of primary diagnosis.","valueType":"string","isArray":true,"restrictions":{"codeList":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Loss of Appetite","Nausea","None","Not Reported","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Swelling in the Neck","Unknown","Vomiting","Weight Loss"]},"meta":{"displayName":"Presenting Symptoms","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Anemia|Bloating|Diabetes"}},{"name":"performance_status","description":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status).","valueType":"string","restrictions":{"codeList":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"]},"meta":{"notes":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction.\nGrade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work).\nGrade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours.\nGrade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours.\nGrade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair","displayName":"Performance Status"}}]},{"name":"treatment","description":"The collection of data elements related to a donor's treatment at a specific point in the clinical record. To submit multiple treatments for a single donor, please submit treatment rows in the treatment file for this donor.","meta":{"parent":"donor"},"fields":[{"name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},{"name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate the primary diagnosis event in the clinical timeline that this treatment was related to.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"treatment_type","description":"Indicate the type of treatment regimen that the donor completed.","valueType":"string","isArray":true,"restrictions":{"required":true,"codeList":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"]},"meta":{"validationDependency":true,"core":true,"notes":"Depending on the treatment_type(s) selected, additional treatment details may be required to be submitted. For example, if treatment_type includes 'Chemotherapy', the supplemental Chemotherapy treatment type file is required.\nTo include multiple values, separate values with a pipe delimiter '|' within your file.","displayName":"Treatment Type","examples":"Chemotherapy|Hormonal therapy"}},{"name":"is_primary_treatment","description":"Indicate if the treatment was the primary treatment following the initial diagnosis.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Yes","No"]},"meta":{"core":true,"displayName":"Is Primary Treatment","dependsOn":"treatment.treatment_type"}},{"name":"line_of_treatment","description":"Indicate the line of treatment if it is not the primary treatment.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Line Of treatment","dependsOn":"treatment.is_primary_treatment","examples":"2,3,4"}},{"name":"treatment_start_interval","description":"The interval between the primary diagnosis and initiation of treatment, in days.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"core":true,"units":"days","notes":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","displayName":"Treatment Start Interval","dependsOn":"treatment.treatment_type"}},{"name":"treatment_duration","description":"The duration of treatment regimen, in days.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"units":"days","displayName":"Treatment Duration","dependsOn":"treatment.treatment_type"}},{"name":"days_per_cycle","description":"Indicate the number of days in a treatment cycle.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Days Per Cycle","dependsOn":"treatment.treatment_type"}},{"name":"number_of_cycles","description":"Indicate the number of treatment cycles.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Number Of Cycles","dependsOn":"treatment.treatment_type"}},{"name":"treatment_intent","description":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"]},"meta":{"core":true,"displayName":"Treatment Intent","dependsOn":"treatment.treatment_type"}},{"name":"treatment_setting","description":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: NCIt C124308)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"]},"meta":{"core":true,"displayName":"Treatment Setting","dependsOn":"treatment.treatment_type"}},{"name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},{"name":"response_to_treatment","description":"The donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"codeList":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"]},"meta":{"core":true,"displayName":"Response To Treatment","dependsOn":"treatment.response_to_treatment_criteria_method","notes":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},{"name":"outcome_of_treatment","description":"Indicate the donor's outcome of the prescribed treatment.","valueType":"string","restrictions":{"codeList":["Treatment completed as prescribed","Treatment incomplete due to technical or organizational problems","Treatment incomplete because patient died","Patient choice (stopped or interrupted treatment)","Physician decision (stopped or interrupted treatment)","Treatment stopped due to lack of efficacy (disease progression)","Treatment stopped due to acute toxicity","Other","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Outcome Of Treatment","dependsOn":"treatment.treatment_type"}},{"name":"toxicity_type","description":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity.","valueType":"string","restrictions":{"codeList":["Hematological","Non-hematological","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Toxicity Type","dependsOn":"treatment.outcome_of_treatment"}},{"name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},{"name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},{"name":"adverse_events","description":"Report any treatment related adverse events. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Adverse Events","dependsOn":"treatment.treatment_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},{"name":"clinical_trials_database","description":"If the donor is a participant in a clinical trial, indicate the clinical trial database where the clinical trial is registered.","valueType":"string","meta":{"display name":"Clinical Trials Database","notes":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added."},"restrictions":{"codeList":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"]}},{"name":"clinical_trial_number","description":"Based on the clinical_trial_database, indicate the unique NCT or EudraCT clinical trial identifier of which the donor is a participant.","valueType":"string","meta":{"display name":"Clinical Trial Number","dependsOn":"treatment.clinical_trials_database","examples":"2016-002120-83,NCT02465060"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"]}}]},{"name":"chemotherapy","description":"The collection of data elements describing the details of a chemotherapy treatment regimen completed by a donor. To submit multiple treatment drugs for a single regimen, submit multiple rows in the chemotherapy file.","meta":{"parent":"treatment"},"fields":[{"name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},{"name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, as assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},{"name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},{"name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},{"name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},{"name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},{"name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},{"name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},{"name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},{"name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},{"name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},{"name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}]},{"name":"hormone_therapy","description":"The collection of data elements describing the details of a hormone treatment therapy completed by a donor. To submit multiple treatment drugs for a single regimen, submit multiple rows in the hormone_therapy file.","meta":{"parent":"treatment"},"fields":[{"name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},{"name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},{"name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Hormone Therapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},{"name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},{"name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},{"name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},{"name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},{"name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},{"name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}]},{"name":"radiation","description":"The collection of data elements describing the details of a radiation treatment completed by a donor.","meta":{"parent":"treatment"},"fields":[{"name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},{"name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"radiation_therapy_modality","description":"Indicate the method of radiation treatment or modality.","valueType":"string","restrictions":{"required":true,"codeList":["Electron","Heavy Ions","Photon","Proton"]},"meta":{"validationDependency":true,"core":true,"displayName":"Radiation Therapy Modality"}},{"name":"radiation_therapy_type","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal"]},"meta":{"core":true,"displayName":"Type of Radiation Therapy","notes":"Internal application includes Brachytherapy."}},{"name":"radiation_therapy_fractions","description":"Indicate the total number of fractions delivered as part of treatment.","valueType":"integer","restrictions":{"required":true,"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Radiation Therapy Fractions"}},{"name":"radiation_therapy_dosage","description":"Indicate the total dose given in units of Gray (Gy).","valueType":"number","restrictions":{"required":true,"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Radiation Therapy Dosage"}},{"name":"anatomical_site_irradiated","description":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)","valueType":"string","isArray":true,"restrictions":{"required":true,"codeList":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"]},"meta":{"core":true,"displayName":"Anatomical Site Irradiated"}},{"name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},{"name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}]},{"name":"immunotherapy","description":"The collection of data elements describing the details of an immunotherapy treatment completed by a donor.","meta":{"parent":"treatment"},"fields":[{"name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},{"name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"immunotherapy_type","valueType":"string","description":"Indicate the type of immunotherapy administered to donor.","meta":{"displayName":"Immunotherapy Type","core":true},"restrictions":{"required":true,"codeList":["Cell-based","Immune checkpoint inhibitors","Monoclonal antibodies other than immune checkpoint inhibitors","Other immunomodulatory substances"]}},{"name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},{"name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},{"name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},{"name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},{"name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},{"name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},{"name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},{"name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}]},{"name":"surgery","description":"The collection of data elements related to a donor's surgical treatment at a specific point in the clinical record. To submit multiple surgeries, submit multiple rows in the Surgery file. If a specimen was resected during surgery, indicate the unique identifier of the specimen in the 'submitter_specimen_id' field. If multiple specimens were resected during a single surgical procedure, submit each 'submitter_specimen_id' as a new row with the same 'submitter_treatment_id' and 'surgery_type' values.","meta":{"parent":"donor"},"fields":[{"name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},{"name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},{"name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},{"name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},{"name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},{"name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},{"name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},{"name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},{"name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},{"name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},{"name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},{"name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},{"name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},{"name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},{"name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}]},{"name":"follow_up","description":"The collection of data elements related to a specific follow-up visit to a donor. A follow-up is defined as any point of contact with a patient after primary diagnosis. To submit multiple follow-ups for a single donor, please submit multiple rows in the follow-up file for this donor.","meta":{"parent":"donor"},"fields":[{"name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},{"description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"description":"Unique identifier for a follow-up event in a donor's clinical record, assigned by the data provider.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"displayName":"Submitter Follow-Up ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"description":"Interval from the primary diagnosis date to the follow-up date, in days.","name":"interval_of_followup","valueType":"integer","restrictions":{"required":true},"meta":{"core":true,"units":"days","displayName":"Interval Of Follow-Up","notes":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},{"description":"Indicate the donor's disease status at time of follow-up. (Reference: RECIST)","name":"disease_status_at_followup","valueType":"string","restrictions":{"required":true,"codeList":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Progression NOS","Relapse or recurrence","Stable"]},"meta":{"core":true,"displayName":"Disease Status at Follow-Up"}},{"name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate if the follow-up is related to a specific primary diagnosis event in the clinical timeline.","meta":{"validationDependency":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID","primaryId":true},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"submitter_treatment_id","valueType":"string","description":"Indicate if the follow-up is related to a specific treatment event in the clinical timeline.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"description":"Indicate the donor's weight, in kilograms (kg), at the time of follow-up.","name":"weight_at_followup","valueType":"number","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Weight at Follow-Up"}},{"description":"Indicate the donor's relapse type.","name":"relapse_type","valueType":"string","restrictions":{"codeList":["Distant recurrence/metastasis","Local recurrence","Local recurrence and distant metastasis","Progression (liquid tumours)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.","displayName":"Relapse Type"}},{"description":"If the donor was clinically disease free following primary treatment and then relapse or recurrence or progression (for liquid tumours) occurred afterwards, then this field will indicate the length of disease free interval, in days.","name":"relapse_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"]},"meta":{"core":true,"units":"days","dependsOn":"follow_up.disease_status_at_followup","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.","displayName":"Relapse Interval"}},{"description":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Reference: caDSR CDE ID 6161031)","name":"method_of_progression_status","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"codeList":["Biomarker in liquid biopsy (e.g. tumour marker in blood or urine)","Biopsy","Blood draw","Bone marrow aspirate","Core biopsy","Cystoscopy","Cytology","Debulking","Diagnostic imaging","Dilation and curettage procedure","Enucleation","Excisional biopsy","Fine needle aspiration","Imaging","Incisional biopsy","Laparoscopy","Laparotomy","Other","Pap Smear","Pathologic review","Physical exam","Surgical resection","Thoracentesis","Ultrasound guided biopsy"]},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file.","displayName":"Method Of Progression Status"}},{"description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}},{"description":"Specify the tumour staging system used to stage the cancer at time of retreatment for recurrence or disease progression. This may be represented as rTNM in the medical report.","name":"recurrence_tumour_staging_system","valueType":"string","restrictions":{"codeList":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"follow_up.disease_status_at_followup","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.","displayName":"Recurrance Tumour Staging System"}},{"name":"recurrence_t_category","description":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","valueType":"string","meta":{"dependsOn":"follow_up.recurrence_tumour_staging_system","notes":"This field is required only if the selected recurrence_tumour_staging_system is any edition of the AJCC cancer staging system.","displayName":"Recurrence T Category"},"restrictions":{"codeList":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"]}},{"name":"recurrence_n_category","description":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","valueType":"string","meta":{"dependsOn":"follow_up.recurrence_tumour_staging_system","notes":"This field is required only if the selected recurrence_tumour_staging_system is any edition of the AJCC cancer staging system.","displayName":"Recurrence N Category"},"restrictions":{"codeList":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"]}},{"name":"recurrence_m_category","description":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","valueType":"string","meta":{"dependsOn":"follow_up.recurrence_tumour_staging_system","notes":"This field is required only if the selected recurrence_tumour_staging_system is any edition of the AJCC cancer staging system.","displayName":"Recurrence M Category"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"codeList":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"]}},{"name":"recurrence_stage_group","description":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) at the time of retreatment for a recurrence or disease progression.","valueType":"string","meta":{"dependsOn":"follow_up.recurrence_tumour_staging_system","notes":"This field is dependent on the selected recurrence_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","displayName":"Recurrence Stage Group"},"restrictions":{"codeList":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}},{"description":"Specify the tumour staging system used to stage the cancer after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery. This may be represented as ypTNM or ycTNM in the medical report.","name":"posttherapy_tumour_staging_system","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"codeList":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"]},"meta":{"displayName":"Post-therapy Tumour Staging System"}},{"name":"posttherapy_t_category","description":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","valueType":"string","meta":{"dependsOn":"follow_up.posttherapy_tumour_staging_system","notes":"This field is required only if the selected posttherapy_tumour_staging_system is any edition of the AJCC cancer staging system.","displayName":"Post-therapy T Category"},"restrictions":{"codeList":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"]}},{"name":"posttherapy_n_category","description":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","valueType":"string","meta":{"dependsOn":"follow_up.posttherapy_tumour_staging_system","notes":"This field is required only if the selected posttherapy_tumour_staging_system is any edition of the AJCC cancer staging system.","displayName":"Post-therapy N Category"},"restrictions":{"codeList":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"]}},{"name":"posttherapy_m_category","description":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","valueType":"string","meta":{"dependsOn":"follow_up.posttherapy_tumour_staging_system","notes":"This field is required only if the selected posttherapy_tumour_staging_system is any edition of the AJCC cancer staging system.","displayName":"Post-therapy M Category"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"codeList":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"]}},{"name":"posttherapy_stage_group","description":"The code to represent the stage group of the tumour, as assigned by the reporting posttherapy_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery.","valueType":"string","meta":{"dependsOn":"follow_up.posttherapy_tumour_staging_system","notes":"This field is dependent on the selected posttherapy_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","displayName":"Post-therapy Stage Group"},"restrictions":{"codeList":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}]},{"name":"exposure","description":"The collection of data elements related to a donor's clinically relevant information not immediately resulting from genetic predispositions.","meta":{"parent":"donor"},"fields":[{"name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},{"description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},{"description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},{"description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},{"description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},{"description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},{"description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},{"description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},{"description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},{"description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},{"description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},{"description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},{"description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},{"description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}]},{"name":"family_history","description":"The collection of data elements describing a donor's familial relationships and familial cancer history.","meta":{"parent":"donor"},"fields":[{"name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},{"description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"description":"Unique identifier of the relative, assigned by the data provider.","name":"family_relative_id","valueType":"string","meta":{"displayName":"Family Relative ID","primaryId":true,"notes":"This field is required to ensure that family members are identified in unique records. Ids can be as simple as an incremented numeral to ensure uniqueness."},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"description":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","name":"relative_with_cancer_history","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Relative with Cancer History"}},{"description":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","name":"relationship_type","restrictions":{"codeList":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"]},"valueType":"string","meta":{"displayName":"Relationship Type"}},{"description":"The self-reported gender of related individual.","name":"gender_of_relative","restrictions":{"codeList":["Female","Male","Other","Unknown"]},"valueType":"string","meta":{"displayName":"Gender of Relative"}},{"description":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","name":"age_of_relative_at_diagnosis","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","displayName":"Age Of Relative At Diagnosis"}},{"name":"cancer_type_code_of_relative","valueType":"string","description":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"examples":"C41.1,C16.9,C00.5,D46.9","dependsOn":"family_history.relative_with_cancer_history","displayName":"Cancer Type Code (ICD-10) of Relative"}},{"description":"Relative's last known state of living or deceased.","name":"relative_vital_status","restrictions":{"codeList":["Alive","Deceased","Unknown"]},"valueType":"string","meta":{"displayName":"Vital Status of Relative"}},{"description":"Indicate the cause of the death of the relative.","name":"cause_of_death_of_relative","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]},"valueType":"string","meta":{"dependsOn":"family_history.relative_vital_status","displayName":"Cause of Death of Relative"}},{"description":"Indicate how long, in days, the relative survived from the time they were diagnosed with cancer.","name":"relative_survival_time","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","units":"days","displayName":"Survival Time Of Relative"}}]},{"name":"biomarker","description":"The collection of data elements describing a donor's biomarker tests. A biomarker is a biological molecule found in blood, other body fluids, or tissues that is indicative of the presence of cancer in the body. Each row should include one or more biomarker test(s) associated with a particular clinical event (submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id field). If the biomarker test is not associated with a particular clinical event, then indicate the time interval at which the biomarker test was performed (test_interval field).","meta":{"parent":"donor"},"fields":[{"name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},{"description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},{"name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},{"name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},{"description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},{"description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},{"description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},{"description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},{"description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},{"description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},{"description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},{"description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},{"description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},{"description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},{"name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},{"description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},{"description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},{"description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},{"description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},{"name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},{"description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},{"description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},{"description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},{"description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},{"description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},{"description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},{"description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},{"description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},{"description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}]},{"name":"comorbidity","description":"The collection of data elements related to a donor's comorbidities. A donor's comorbidities are any medical conditions (e.g diabetes, prior cancer malignancies) that have existed or may occur during the clinical course of the donor who has the index disease under study. To submit multiple comorbidities for a single donor, submit multiple rows in the comorbidity file for this donor.","meta":{"parent":"donor"},"fields":[{"name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},{"name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},{"name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},{"name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},{"name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},{"name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},{"name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},{"name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}]}],"_id":"66fbc19f8d738c00323e8c30","name":"ICGC-ARGO Data Dictionary","version":"1.24","createdAt":"2024-10-01T09:32:15.397Z","updatedAt":"2024-10-01T09:32:15.397Z","__v":0} diff --git a/website/static/data/schemas/diffs/0.10/0.10-diff-1.24.json b/website/static/data/schemas/diffs/0.10/0.10-diff-1.24.json new file mode 100644 index 00000000..17a0f2a2 --- /dev/null +++ b/website/static/data/schemas/diffs/0.10/0.10-diff-1.24.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"program_id":{"meta":{"examples":{"left":"PACA-AU,BR-CA","right":"TEST-CA"},"notes":{"left":"This is the unique id that is assigned to your program. If you have logged into the platform, this is the Program Id that you see in the Submiission area.","right":"This is the unique id that is assigned to your program. If you have logged into the platform, this is the Program Id that you see in the Program Services area. For example, TEST-CA is a Program ID."}}},"gender":{},"specimen_tissue_source":{},"specimen_type":{"restrictions":{"codeList":{"left":["Normal","Normal - tissue adjacent to primary tumour","Primary tumour","Primary tumour - adjacent to normal","Primary tumour - additional new primary","Recurrent tumour","Metastatic tumour","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour - additional metastatic","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line","Cell line - derived from xenograft tumour","Cell line - derived from tumour","Cell line - derived from normal"],"right":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"],"deleted":[]}},"script":{"left":["(function validate() {\n\n const row = $row;\n let result = {valid: true, message: \"Ok\"};\n \n const designation = row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\"){\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when tumour_normal_designation is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when tumour_normal_designation is set to Tumour.\"};\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"]}}},"sample_type":{}},"created":{},"deleted":{}},"donor":{"updated":{"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased","Unknown"],"right":["Alive","Deceased"],"data":{"added":[],"deleted":["Unknown"]}}}},"cause_of_death":{"restrictions":{"codeList":{"left":["Died of cancer","Died of other reasons"],"right":["Died of cancer","Died of other reasons","Unknown"],"data":{"added":["Unknown"],"deleted":[]}},"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]}}},"survival_time":{"restrictions":{"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"height":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"weight":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"bmi":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"menopause_status":{"description":{"left":"Indicate the donor's menopause status at the time of primary diagnosis. (Codelist reference: NCI CDE ID: 2434914)","right":"Indicate the donor's menopause status at the time of primary diagnosis. (Reference: caDSR CDE ID 2434914)"},"restrictions":{"codeList":{"left":["Premenopausal","Perimenopausal","Postmenopausal","Indeterminate or unknown","Not applicable"],"right":["Not applicable","Perimenopausal","Postmenopausal","Premenopausal","Unknown"],"data":{"added":["Unknown"],"deleted":["Indeterminate or unknown"]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age of menarche, the first occurrence of menstruation.","right":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)"},"restrictions":{}},"number_of_pregnancies":{"description":{"left":"Indicate the number of pregnancies a donor has had.","right":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)"},"restrictions":{}},"number_of_children":{"description":{"left":"Indicate the number of children the donor has birthed.","right":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)"},"restrictions":{}}},"created":{"primary_site":{"changeType":"created","name":"primary_site","valueType":"string","isArray":true,"description":"The text term used to describe the primary site of disease, as categorized by the World Health Organization's (WHO) International Classification of Diseases for Oncology (ICD-O). This categorization groups cases into general categories.","meta":{"displayName":"Primary Site","core":true,"notes":"To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Breast|Ovary"},"restrictions":{"required":true,"codeList":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"]}},"genetic_disorders":{"changeType":"created","description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},"hrt_type":{"changeType":"created","description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},"hrt_duration":{"changeType":"created","description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},"contraception_type":{"changeType":"created","description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},"contraception_duration":{"changeType":"created","description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},"lost_to_followup_after_clinical_event_id":{"changeType":"created","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}},"deleted":{"prior_malignancy":{"changeType":"deleted","description":"Prior malignancy affecting donor.","name":"prior_malignancy","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"cancer_type_prior_malignancy":{"changeType":"deleted","description":"ICD-10 diagnostic code for type of cancer in a prior malignancy.","name":"cancer_type_prior_malignancy","restrictions":{"regex":"[A-Z]{1}[0-9]{2}.[0-9]{0,3}[A-Z]{0,1}$"},"valueType":"string","meta":{"displayName":"Cancer Type Prior Malignancy"}},"age_at_prior_malignancy":{"changeType":"deleted","description":"If donor has history of prior malignancy, indicate age at previous diagnosis, in years.","name":"age_at_prior_malignancy","valueType":"integer"},"laterality_of_prior_malignancy":{"changeType":"deleted","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis.","name":"laterality_of_prior_malignancy","valueType":"string","meta":{"displayName":"Age at Prior Malignancy"}}}},"specimen":{"updated":{"pathological_tumour_staging_system":{"meta":{"validationDependency":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(\n field =>\n Object.keys(convertedRow).includes(field) &&\n (!convertedRow[field] || checkforEmpty(convertedRow[field])),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"deleted":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"]}}}},"pathological_t_category":{"restrictions":{}},"pathological_n_category":{"restrictions":{}},"pathological_m_category":{"restrictions":{}},"pathological_stage_group":{"description":{"left":"Specify the tumour stage, based on tumour_staging_system, used to assess the cancer at the time the tumour specimen was resected.","right":"Specify the tumour stage, based on pathological_tumour_staging_system, used to assess the cancer at the time the tumour specimen was resected."},"meta":{"notes":{"left":"This field depends on the selected pathological staging system, and is only required if the specimen is a tumour.","right":"This field depends on the selected pathological_tumour_staging_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications"}},"restrictions":{}},"specimen_acquisition_interval":{"meta":{"displayName":{"left":"Specimen Aquisition Interval","right":"Specimen Acquisition Interval"},"notes":{"left":null,"right":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"restrictions":{"notes":{"left":"The associated Primary Diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":null}}},"tumour_histological_type":{"description":{"left":"The code to represent the histology (morphology) of neoplasms that is usually obtained from a pathology report, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Please refer to the guidelines provided in the ICD-O-3 manual at https://apps.who.int/iris/handle/10665/42344.","right":"The code to represent the histology (morphology) of neoplasms that is usually obtained from a pathology report, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344."},"meta":{"validationDependency":{"left":null,"right":true}}},"specimen_anatomic_location":{"description":{"left":"Anatomic location of a specimen when it was collected.","right":"Indicate the ICD-O-3 topography code for the anatomic location of a specimen when it was collected. Refer to the guidelines provided in the ICD-O-3 manual at https://apps.who.int/iris/handle/10665/42344."},"meta":{"examples":{"left":null,"right":"C50.1,C18"}},"restrictions":{"codeList":{"left":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear, pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal; distal","Esophageal; mid","Esophageal; proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck, NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es), maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"],"data":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear, pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal; distal","Esophageal; mid","Esophageal; proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck, NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es), maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"]},"regex":{"left":null,"right":"^[C][0-9]{2}(.[0-9]{1})?$"}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation, other","Formalin fixed & paraffin embedded","Formalin fixed, buffered","Formalin fixed, unbuffered","Fresh","Other"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"data":{"added":["Cryopreservation - other","Formalin fixed - buffered","Formalin fixed - unbuffered","Unknown"],"deleted":["Cryopreservation, other","Formalin fixed, buffered","Formalin fixed, unbuffered"]}}}},"specimen_storage":{"description":{"left":"Indicate the method of specimen storage for specimens that were not extracted freshly or immediately cultured.","right":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured."},"restrictions":{"codeList":{"left":["Cut slide","Frozen, -70 freezer","Frozen, liquid nitrogen","Frozen, vapor phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"data":{"added":["Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Unknown"],"deleted":["Frozen, -70 freezer","Frozen, liquid nitrogen","Frozen, vapor phase"]}}}},"tumour_grading_system":{"meta":{"validationDependency":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["Default","Gleason","Nottingham","Brain cancer","ISUP","Lymphoid neoplasms"],"right":["FNCLCC grading system","Four-tier grading system","Gleason grade group system","Grading system for GISTs","Grading system for GNETs","ISUP grading system","Nuclear grading system for DCIS","Scarff-Bloom-Richardson grading system","Three-tier grading system","Two-tier grading system","WHO grading system for CNS tumours"],"data":{"added":["FNCLCC grading system","Four-tier grading system","Gleason grade group system","Grading system for GISTs","Grading system for GNETs","ISUP grading system","Nuclear grading system for DCIS","Scarff-Bloom-Richardson grading system","Three-tier grading system","Two-tier grading system","WHO grading system for CNS tumours"],"deleted":["Default","Gleason","Nottingham","Brain cancer","ISUP","Lymphoid neoplasms"]}}}},"tumour_grade":{"meta":{"notes":{"left":"This field depends on the selected tumour grading system, and is only required if the specimen is a tumour.","right":"This field depends on the selected tumour_grading_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Grading Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-grading-classifications"}},"restrictions":{"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'default':\n codeList = [\n 'gx - cannot be assessed',\n 'g1 well differentiated/low grade',\n 'g2 moderately differentiated/intermediated grade',\n 'g3 poorly differentiated/high grade',\n 'g4 undifferentiated/high grade',\n ];\n break;\n case 'gleason':\n codeList = [\n 'gleason x: gleason score cannot be determined',\n 'gleason 2–6: the tumor tissue is well differentiated',\n 'gleason 7: the tumor tissue is moderately differentiated',\n 'gleason 8–10: the tumor tissue is poorly differentiated or undifferentiated',\n ];\n break;\n case 'nottingham':\n codeList = [\n 'g1 (low grade or well differentiated)',\n 'g2 (intermediate grade or moderately differentiated)',\n 'g3 (high grade or poorly differentiated)',\n ];\n break;\n case 'brain cancer':\n codeList = ['grade i', 'grade ii', 'grade iii', 'grade iv'];\n break;\n case 'isup for renal cell carcinoma':\n codeList = [\n 'grade 1: tumor cell nucleoli invisible or small and basophilic at 400 x magnification',\n 'grade 2: tumor cell nucleoli conspicuous at 400 x magnification but inconspicuous at 100 x magnification',\n 'grade 3: tumor cell nucleoli eosinophilic and clearly visible at 100 x magnification',\n 'grade 4: tumors showing extreme nuclear pleomorphism and/or containing tumor giant cells and/or the presence of any proportion of tumor showing sarcomatoid and/or rhabdoid dedifferentiation',\n ];\n break;\n case 'lymphoid neoplasms':\n codeList = ['low grade or indolent nhl', 'high grade or aggressive nhl'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]},"codeList":{"right":["Low grade","High grade","GX","G1","G2","G3","G4","Low","High","Grade I","Grade II","Grade III","Grade IV","Grade Group 1","Grade Group 2","Grade Group 3","Grade Group 4","Grade Group 5"],"data":["Low grade","High grade","GX","G1","G2","G3","G4","Low","High","Grade I","Grade II","Grade III","Grade IV","Grade Group 1","Grade Group 2","Grade Group 3","Grade Group 4","Grade Group 5"]}}},"percent_tumour_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of infiltration by tumour cells in a specimen.","right":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)"},"restrictions":{}},"percent_proliferating_cells":{"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_inflammatory_tissue":{"description":{"left":"Indicate a value, in decimals, that represents local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue.","right":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_stromal_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a malignant tumour specimen but are not malignant such as fibroblasts, vascular structures, etc.","right":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_necrosis":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of cell death in a malignant tumour specimen.","right":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}}},"created":{"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate the primary diagnosis event in the clinical timeline that this specimen acquisition was related to.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"specimen_laterality":{"changeType":"created","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"reference_pathology_confirmed":{"changeType":"created","name":"reference_pathology_confirmed","description":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)","valueType":"string","meta":{"validationDependency":true,"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Reference Pathology Confirmed"},"restrictions":{"codeList":["Yes","No","Unknown"]}},"percent_tumour_cells_measurement_method":{"changeType":"created","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}},"deleted":{"central_pathology_confirmed":{"changeType":"deleted","name":"central_pathology_confirmed","description":"Indicate whether the histologic description of tissue or cells was confirmed by a pathology review of frozen or formalin fixed slide(s) completed after the diagnostic pathology review of the tumour sample used to extract analyte(s).","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Central Pathology Confirmed"},"restrictions":{"codeList":["Yes","No","Unknown"]}}}},"primary_diagnosis":{"updated":{"age_at_diagnosis":{"description":{"left":"Age that the donor was first diagnosed with cancer, in years.","right":"Age that the donor was first diagnosed with cancer, in years. This should be based on the earliest diagnosis of cancer."},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0,"max":90}}}},"cancer_type_code":{"meta":{"examples":{"left":"C41.1,C16.9,C00.543A","right":"C41.1,C16.9,C00.5,D46.9"}},"restrictions":{"regex":{"left":"^[C][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","right":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"}}},"basis_of_diagnosis":{},"number_lymph_nodes_positive":{"description":{"left":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: NCI CDE ID: 6113694)","right":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: caDSR CDE ID 6113694)"},"meta":{"dependsOn":{"left":null,"right":"primary_diagnosis.lymph_nodes_examined_status"},"notes":{"left":null,"right":"This field is only required if 'lymph_nodes_examined_status' is 'Yes'."}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"]},"range":{"left":null,"right":{"min":0}}}},"number_lymph_nodes_examined":{"description":{"left":"The total number of lymph nodes tested for the presence of cancer. (Reference: NCI CDE ID: 3)","right":"The total number of lymph nodes tested for the presence of cancer. (Reference: caDSR CDE ID 3)"},"meta":{"dependsOn":{"left":null,"right":"primary_diagnosis.lymph_nodes_examined_status"},"notes":{"left":null,"right":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'."}},"restrictions":{}},"clinical_tumour_staging_system":{"meta":{"validationDependency":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(\n field =>\n Object.keys(convertedRow).includes(field) &&\n (!convertedRow[field] || checkforEmpty(convertedRow[field])),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"required":{"left":true,"right":null},"codeList":{"left":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"deleted":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"]}}}},"clinical_stage_group":{"description":{"left":"Stage group of the tumour, as assigned by the reporting tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.).","right":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage."},"meta":{"notes":{"left":null,"right":"This field is dependent on the selected clinical_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications"},"examples":{"left":null,"right":"Stage I, Stage IIB"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"clinical_t_category":{"restrictions":{}},"clinical_n_category":{"description":{"left":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"restrictions":{}},"clinical_m_category":{"description":{"left":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned.","right":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned."},"restrictions":{}},"presenting_symptoms":{"meta":{"notes":{"left":null,"right":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"examples":{"left":null,"right":"Anemia|Bloating|Diabetes"}},"restrictions":{"codeList":{"left":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Nausea","None","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Unknown","Vomiting","Weight Loss"],"right":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Loss of Appetite","Nausea","None","Not Reported","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Swelling in the Neck","Unknown","Vomiting","Weight Loss"],"data":{"added":["Loss of Appetite","Not Reported","Swelling in the Neck"],"deleted":[]}}}},"performance_status":{"description":{"left":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference source: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status).","right":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status)."},"meta":{"notes":{"left":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction \n Grade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work) \n Grade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours \n Grade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours \n Grade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair","right":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction.\nGrade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work).\nGrade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours.\nGrade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours.\nGrade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair"}},"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}}},"created":{"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Unique identifier of the primary diagnosis event, assigned by the data provider.","meta":{"primaryId":true,"displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"cancer_type_additional_information":{"changeType":"created","name":"cancer_type_additional_information","valueType":"string","description":"Additional details related to the cancer type that are not covered by the ICD-10 code provided in the cancer_type field.","meta":{"displayName":"Cancer Type Additional Information"}},"laterality":{"changeType":"created","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_status":{"changeType":"created","name":"lymph_nodes_examined_status","description":"Indicate if lymph nodes were examined for metastases.","valueType":"string","restrictions":{"required":true,"codeList":["Cannot be determined","No","No lymph nodes found in resected specimen","Not applicable","Yes"]},"meta":{"core":true,"displayName":"Lymph Nodes Examined Status"}},"lymph_nodes_examined_method":{"changeType":"created","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}},"deleted":{"stage_suffix":{"changeType":"deleted","name":"stage_suffix","description":"If necessary, use this field to add any applicable stage suffixes. Stage suffixes may apply to certain staging systems such as Ann Arbour staging system where the four stages are divided into 4 categories (A, B, X and E).","valueType":"string","meta":{"core":true,"dependsOn":"primary_diagnosis.clinical_tumour_staging_system","displayName":"Stage Suffix"}}}},"treatment":{"updated":{"treatment_type":{"meta":{"notes":{"left":"Depending on the treatment_type selected, additional treament details may be required to be submitted.","right":"Depending on the treatment_type(s) selected, additional treatment details may be required to be submitted. For example, if treatment_type includes 'Chemotherapy', the supplemental Chemotherapy treatment type file is required.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."},"examples":{"left":null,"right":"Chemotherapy|Hormonal therapy"}},"restrictions":{"codeList":{"left":["Chemotherapy","Ablation","Bone marrow transplant","Combined chemo+immunotherapy","Combined chemo+radiation therapy","Combined chemo-radiotherapy and surgery","Endoscopic therapy","Hormonal therapy","Immunotherapy","Monoclonal antibodies (for liquid tumours)","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgical resection"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":["End of life care","Surgery"],"deleted":["Combined chemo+immunotherapy","Combined chemo+radiation therapy","Combined chemo-radiotherapy and surgery","Monoclonal antibodies (for liquid tumours)","Surgical resection"]}}}},"is_primary_treatment":{"description":{"left":"Indicate if the treamtment was the primary treatment following the initial diagnosis.","right":"Indicate if the treatment was the primary treatment following the initial diagnosis."},"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Yes","No","Unknown"],"right":["Yes","No"],"data":{"added":[],"deleted":["Unknown"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_start_interval":{"description":{"left":"The interval between primary diagnosis and initiation of treatment, in days.","right":"The interval between the primary diagnosis and initiation of treatment, in days."},"meta":{"notes":{"left":"The associated Primary Diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis","right":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."},"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_duration":{"description":{"left":"The duration of treatment regimen, in days","right":"The duration of treatment regimen, in days."},"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}}},"created":{"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate the primary diagnosis event in the clinical timeline that this treatment was related to.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"line_of_treatment":{"changeType":"created","name":"line_of_treatment","description":"Indicate the line of treatment if it is not the primary treatment.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Line Of treatment","dependsOn":"treatment.is_primary_treatment","examples":"2,3,4"}},"days_per_cycle":{"changeType":"created","name":"days_per_cycle","description":"Indicate the number of days in a treatment cycle.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Days Per Cycle","dependsOn":"treatment.treatment_type"}},"number_of_cycles":{"changeType":"created","name":"number_of_cycles","description":"Indicate the number of treatment cycles.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Number Of Cycles","dependsOn":"treatment.treatment_type"}},"treatment_intent":{"changeType":"created","name":"treatment_intent","description":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"]},"meta":{"core":true,"displayName":"Treatment Intent","dependsOn":"treatment.treatment_type"}},"treatment_setting":{"changeType":"created","name":"treatment_setting","description":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: NCIt C124308)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"]},"meta":{"core":true,"displayName":"Treatment Setting","dependsOn":"treatment.treatment_type"}},"response_to_treatment_criteria_method":{"changeType":"created","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},"response_to_treatment":{"changeType":"created","name":"response_to_treatment","description":"The donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"codeList":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"]},"meta":{"core":true,"displayName":"Response To Treatment","dependsOn":"treatment.response_to_treatment_criteria_method","notes":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"outcome_of_treatment":{"changeType":"created","name":"outcome_of_treatment","description":"Indicate the donor's outcome of the prescribed treatment.","valueType":"string","restrictions":{"codeList":["Treatment completed as prescribed","Treatment incomplete due to technical or organizational problems","Treatment incomplete because patient died","Patient choice (stopped or interrupted treatment)","Physician decision (stopped or interrupted treatment)","Treatment stopped due to lack of efficacy (disease progression)","Treatment stopped due to acute toxicity","Other","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Outcome Of Treatment","dependsOn":"treatment.treatment_type"}},"toxicity_type":{"changeType":"created","name":"toxicity_type","description":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity.","valueType":"string","restrictions":{"codeList":["Hematological","Non-hematological","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Toxicity Type","dependsOn":"treatment.outcome_of_treatment"}},"hematological_toxicity":{"changeType":"created","name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"non-hematological_toxicity":{"changeType":"created","name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"adverse_events":{"changeType":"created","name":"adverse_events","description":"Report any treatment related adverse events. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Adverse Events","dependsOn":"treatment.treatment_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"clinical_trials_database":{"changeType":"created","name":"clinical_trials_database","description":"If the donor is a participant in a clinical trial, indicate the clinical trial database where the clinical trial is registered.","valueType":"string","meta":{"display name":"Clinical Trials Database","notes":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added."},"restrictions":{"codeList":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"]}},"clinical_trial_number":{"changeType":"created","name":"clinical_trial_number","description":"Based on the clinical_trial_database, indicate the unique NCT or EudraCT clinical trial identifier of which the donor is a participant.","valueType":"string","meta":{"display name":"Clinical Trial Number","dependsOn":"treatment.clinical_trials_database","examples":"2016-002120-83,NCT02465060"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"]}}},"deleted":{"age_at_consent_for_treatment":{"changeType":"deleted","name":"age_at_consent_for_treatment","description":"Indicate the age of donor when consent was given for treatment.","valueType":"integer","meta":{"displayName":"Age At Consent For Treatment"}},"therapeutic_intent":{"changeType":"deleted","name":"therapeutic_intent","description":"The therapeutic intent, the reason behind the choice of a therapy, of the treatment.","valueType":"string","restrictions":{"required":true,"codeList":["Adjuvant","Concurrent","Curative","Neoadjuvant","Not applicable","Palliative","Unknown"]},"meta":{"core":true,"displayName":"Therapeutic Intent"}},"response_to_therapy":{"changeType":"deleted","name":"response_to_therapy","description":"The donors's response to the applied treatment regimen. (Source: RECIST)","valueType":"string","restrictions":{"required":true,"codeList":["Complete response","Disease progression","NED","Partial response","Stable disease"]},"meta":{"core":true,"displayName":"Response to Therapy"}}}},"chemotherapy":{"updated":{},"created":{"drug_rxnormcui":{"changeType":"created","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"created","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"created","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"created","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"created","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"created","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}},"deleted":{"chemotherapy_drug_name":{"changeType":"deleted","name":"chemotherapy_drug_name","description":"Name of agent or drug administered to patient as part of the chemotherapy treatment regimen.","valueType":"string","restrictions":{"required":true,"codeList":["Placeholder list 1","Need list","Still need it"]},"meta":{"validationDependency":true,"core":true,"notes":"This field uses a controlled vocabulary gathered from the DrugBank database of drug names.","examples":"Allopurinol, Dronabinol, Sucralfate, Lapatinib","displayName":"Chemotherapy Drug Name"}},"chemotherapy_dosage_units":{"changeType":"deleted","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","µg/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate the total drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"integer","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"hormone_therapy":{"updated":{},"created":{"drug_rxnormcui":{"changeType":"created","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"created","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Hormone Therapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"created","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{"hormone_therapy_drug_name":{"changeType":"deleted","name":"hormone_therapy_drug_name","description":"Name of agent or drug administered to patient as part of the hormone therapy treatment regimen.","valueType":"string","restrictions":{"required":true,"codeList":["Placeholder list 1","Need list","Still need it"]},"meta":{"validationDependency":true,"core":true,"notes":"This field uses a controlled vocabulary gathered from the DrugBank database of drug names.","displayName":"Hormone Therapy Drug Name"}},"hormone_drug_dosage_units":{"changeType":"deleted","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","µg/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"integer","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dose"}}}},"radiation":{"updated":{"radiation_therapy_fractions":{"description":{"left":"Indicate the number of total fractions delivered as part of treatment.","right":"Indicate the total number of fractions delivered as part of treatment."},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"radiation_therapy_dosage":{"valueType":{"left":"integer","right":"number"},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"anatomical_site_irradiated":{"description":{"left":"Indicate localization site where radiation therapy was administered.","right":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)"},"restrictions":{"codeList":{"left":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"right":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"data":{"added":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"],"deleted":["Bone","Extremities","Head-Neck","Peritoneum"]}}}}},"created":{"radiation_therapy_type":{"changeType":"created","name":"radiation_therapy_type","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal"]},"meta":{"core":true,"displayName":"Type of Radiation Therapy","notes":"Internal application includes Brachytherapy."}},"radiation_boost":{"changeType":"created","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"created","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}},"deleted":{"application_form":{"changeType":"deleted","name":"application_form","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal (including Brachytherapy)"]},"meta":{"core":true,"displayName":"Application Form"}}}},"follow_up":{"updated":{"submitter_follow_up_id":{"description":{"left":"Unique identifier for a follow-up event in a donors clincal record, assigned by the data provider.","right":"Unique identifier for a follow-up event in a donor's clinical record, assigned by the data provider."}},"interval_of_followup":{"meta":{"notes":{"left":"The associated Primary Diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}}},"disease_status_at_followup":{"description":{"left":"Indicate the donor's disease status at time of follow-up.","right":"Indicate the donor's disease status at time of follow-up. (Reference: RECIST)"},"restrictions":{"codeList":{"left":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Relapse","Stable"],"right":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Progression NOS","Relapse or recurrence","Stable"],"data":{"added":["Progression NOS","Relapse or recurrence"],"deleted":["Relapse"]}}}},"weight_at_followup":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"relapse_type":{"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}},"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"relapse_interval":{"description":{"left":"If the donor was clinically disease free following primary treatment and then relapse or progression (for liquid tumours) occurred afterwards, then this field will indicate the length of disease free interval, in days.","right":"If the donor was clinically disease free following primary treatment and then relapse or recurrence or progression (for liquid tumours) occurred afterwards, then this field will indicate the length of disease free interval, in days."},"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a progression or relapse value.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}},"restrictions":{"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"]}}},"method_of_progression_status":{"description":{"left":"Indicate the method(s) used to confirm the donor's progression disease status. (Codelist reference: NCI CDE ID: 6161031)","right":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Reference: caDSR CDE ID 6161031)"},"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}},"restrictions":{"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]},"codeList":{"left":["Autopsy","Biomarker in liquid biopsy (e.g. tumour marker in blood or urine)","Biopsy","Blood draw","Bone marrow aspirate","Core biopsy","Cystoscopy","Cytology","Debulking","Diagnostic imaging","Dilation and curettage procedure","Enucleation","Excisional biopsy","Fine needle aspiration","Imaging","Incisional biopsy","Laparoscopy","Laparotomy","Other","Pap Smear","Pathologic review","Physical exam","Surgical resection","Thoracentesis","Ultrasound guided biopsy"],"right":["Biomarker in liquid biopsy (e.g. tumour marker in blood or urine)","Biopsy","Blood draw","Bone marrow aspirate","Core biopsy","Cystoscopy","Cytology","Debulking","Diagnostic imaging","Dilation and curettage procedure","Enucleation","Excisional biopsy","Fine needle aspiration","Imaging","Incisional biopsy","Laparoscopy","Laparotomy","Other","Pap Smear","Pathologic review","Physical exam","Surgical resection","Thoracentesis","Ultrasound guided biopsy"],"data":{"added":[],"deleted":["Autopsy"]}}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}},"restrictions":{"codeList":{"left":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"deleted":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"]}},"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(\n field =>\n Object.keys(convertedRow).includes(field) &&\n (!convertedRow[field] || checkforEmpty(convertedRow[field])),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_t_category":{"description":{"left":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":true,"right":null}},"restrictions":{}},"recurrence_n_category":{"description":{"left":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":true,"right":null}},"restrictions":{}},"recurrence_m_category":{"description":{"left":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":true,"right":null}},"restrictions":{}},"recurrence_stage_group":{"description":{"left":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery.","right":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) at the time of retreatment for a recurrence or disease progression."},"meta":{"core":{"left":true,"right":null},"notes":{"left":null,"right":"This field is dependent on the selected recurrence_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications"}},"restrictions":{}},"posttherapy_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(\n field =>\n Object.keys(convertedRow).includes(field) &&\n (!convertedRow[field] || checkforEmpty(convertedRow[field])),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"deleted":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"]}}}},"posttherapy_t_category":{"meta":{"dependsOn":{"left":"follow_up.post_therapy_tumour_staging_system","right":"follow_up.posttherapy_tumour_staging_system"}},"restrictions":{}},"posttherapy_n_category":{"description":{"left":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"dependsOn":{"left":"follow_up.post_therapy_tumour_staging_system","right":"follow_up.posttherapy_tumour_staging_system"}},"restrictions":{}},"posttherapy_m_category":{"description":{"left":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"dependsOn":{"left":"follow_up.post_therapy_tumour_staging_system","right":"follow_up.posttherapy_tumour_staging_system"}},"restrictions":{}},"posttherapy_stage_group":{"meta":{"dependsOn":{"left":"follow_up.post_therapy_tumour_staging_system","right":"follow_up.posttherapy_tumour_staging_system"},"notes":{"left":"This field value is dependent on the selected posttherapy_tumour_staging_system.","right":"This field is dependent on the selected posttherapy_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications"}},"restrictions":{}}},"created":{"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate if the follow-up is related to a specific primary diagnosis event in the clinical timeline.","meta":{"validationDependency":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID","primaryId":true},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"Indicate if the follow-up is related to a specific treatment event in the clinical timeline.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"anatomic_site_progression_or_recurrence":{"changeType":"created","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"anatomic_site_progression_or_recurrences":{"changeType":"deleted","description":"Indicate the anatomic site where disease progression or recurrence occurred. (Codelist reference: NCI CDE ID: 4742851)","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"],"codeList":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear, pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal; distal","Esophageal; mid","Esophageal; proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck, NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es), maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"]},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","notes":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse.","displayName":"Anatomic Site Progression or Recurrences"}}}},"immunotherapy":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"immunotherapy_type":{"changeType":"created","name":"immunotherapy_type","valueType":"string","description":"Indicate the type of immunotherapy administered to donor.","meta":{"displayName":"Immunotherapy Type","core":true},"restrictions":{"required":true,"codeList":["Cell-based","Immune checkpoint inhibitors","Monoclonal antibodies other than immune checkpoint inhibitors","Other immunomodulatory substances"]}},"drug_rxnormcui":{"changeType":"created","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"created","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"created","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{}},"surgery":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"created","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"created","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"created","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"created","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"created","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"created","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"created","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"created","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"created","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"created","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"created","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"created","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"created","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"created","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}},"deleted":{}},"exposure":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"created","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"created","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"created","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"created","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"created","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"created","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"created","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"created","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"created","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"created","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"created","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"created","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"created","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}},"deleted":{}},"family_history":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"family_relative_id":{"changeType":"created","description":"Unique identifier of the relative, assigned by the data provider.","name":"family_relative_id","valueType":"string","meta":{"displayName":"Family Relative ID","primaryId":true,"notes":"This field is required to ensure that family members are identified in unique records. Ids can be as simple as an incremented numeral to ensure uniqueness."},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"relative_with_cancer_history":{"changeType":"created","description":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","name":"relative_with_cancer_history","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Relative with Cancer History"}},"relationship_type":{"changeType":"created","description":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","name":"relationship_type","restrictions":{"codeList":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"]},"valueType":"string","meta":{"displayName":"Relationship Type"}},"gender_of_relative":{"changeType":"created","description":"The self-reported gender of related individual.","name":"gender_of_relative","restrictions":{"codeList":["Female","Male","Other","Unknown"]},"valueType":"string","meta":{"displayName":"Gender of Relative"}},"age_of_relative_at_diagnosis":{"changeType":"created","description":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","name":"age_of_relative_at_diagnosis","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","displayName":"Age Of Relative At Diagnosis"}},"cancer_type_code_of_relative":{"changeType":"created","name":"cancer_type_code_of_relative","valueType":"string","description":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"examples":"C41.1,C16.9,C00.5,D46.9","dependsOn":"family_history.relative_with_cancer_history","displayName":"Cancer Type Code (ICD-10) of Relative"}},"relative_vital_status":{"changeType":"created","description":"Relative's last known state of living or deceased.","name":"relative_vital_status","restrictions":{"codeList":["Alive","Deceased","Unknown"]},"valueType":"string","meta":{"displayName":"Vital Status of Relative"}},"cause_of_death_of_relative":{"changeType":"created","description":"Indicate the cause of the death of the relative.","name":"cause_of_death_of_relative","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]},"valueType":"string","meta":{"dependsOn":"family_history.relative_vital_status","displayName":"Cause of Death of Relative"}},"relative_survival_time":{"changeType":"created","description":"Indicate how long, in days, the relative survived from the time they were diagnosed with cancer.","name":"relative_survival_time","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","units":"days","displayName":"Survival Time Of Relative"}}},"deleted":{}},"biomarker":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"created","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"created","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"created","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"created","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"created","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"created","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"created","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"created","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"created","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"created","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"created","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"created","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"created","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"created","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"created","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"created","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"created","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"created","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"created","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}},"deleted":{}},"comorbidity":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"created","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"created","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"created","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"created","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"created","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"created","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}},"deleted":{}}}} diff --git a/website/static/data/schemas/diffs/0.11/0.11-diff-1.24.json b/website/static/data/schemas/diffs/0.11/0.11-diff-1.24.json new file mode 100644 index 00000000..ac327ea2 --- /dev/null +++ b/website/static/data/schemas/diffs/0.11/0.11-diff-1.24.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"program_id":{"meta":{"examples":{"left":"PACA-AU,BR-CA","right":"TEST-CA"},"notes":{"left":"This is the unique id that is assigned to your program. If you have logged into the platform, this is the Program Id that you see in the Submiission area.","right":"This is the unique id that is assigned to your program. If you have logged into the platform, this is the Program Id that you see in the Program Services area. For example, TEST-CA is a Program ID."}}},"gender":{},"specimen_tissue_source":{},"specimen_type":{"restrictions":{"codeList":{"left":["Normal","Normal - tissue adjacent to primary tumour","Primary tumour","Primary tumour - adjacent to normal","Primary tumour - additional new primary","Recurrent tumour","Metastatic tumour","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour - additional metastatic","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line","Cell line - derived from xenograft tumour","Cell line - derived from tumour","Cell line - derived from normal"],"right":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"],"deleted":[]}},"script":{"left":["(function validate() {\n\n const row = $row;\n let result = {valid: true, message: \"Ok\"};\n \n const designation = row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\"){\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when tumour_normal_designation is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when tumour_normal_designation is set to Tumour.\"};\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"]}}},"sample_type":{}},"created":{},"deleted":{}},"donor":{"updated":{"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased","Unknown"],"right":["Alive","Deceased"],"data":{"added":[],"deleted":["Unknown"]}}}},"cause_of_death":{"restrictions":{"codeList":{"left":["Died of cancer","Died of other reasons"],"right":["Died of cancer","Died of other reasons","Unknown"],"data":{"added":["Unknown"],"deleted":[]}},"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]}}},"survival_time":{"restrictions":{"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"primary_site":{"meta":{"notes":{"left":null,"right":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"examples":{"left":null,"right":"Breast|Ovary"}},"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva","Unknown","Not Reported"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"data":{"added":["Unknown primary site"],"deleted":["Unknown","Not Reported"]}}}},"height":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"weight":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"bmi":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"menopause_status":{"description":{"left":"Indicate the donor's menopause status at the time of primary diagnosis. (Codelist reference: NCI CDE ID: 2434914)","right":"Indicate the donor's menopause status at the time of primary diagnosis. (Reference: caDSR CDE ID 2434914)"},"restrictions":{"codeList":{"left":["Indeterminate or unknown","Not applicable","Perimenopausal","Postmenopausal","Premenopausal"],"right":["Not applicable","Perimenopausal","Postmenopausal","Premenopausal","Unknown"],"data":{"added":["Unknown"],"deleted":["Indeterminate or unknown"]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age of menarche, the first occurrence of menstruation.","right":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)"},"restrictions":{}},"number_of_pregnancies":{"description":{"left":"Indicate the number of pregnancies a donor has had.","right":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)"},"restrictions":{}},"number_of_children":{"description":{"left":"Indicate the number of children the donor has birthed.","right":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)"},"restrictions":{}}},"created":{"genetic_disorders":{"changeType":"created","description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},"hrt_type":{"changeType":"created","description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},"hrt_duration":{"changeType":"created","description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},"contraception_type":{"changeType":"created","description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},"contraception_duration":{"changeType":"created","description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},"lost_to_followup_after_clinical_event_id":{"changeType":"created","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}},"deleted":{"prior_malignancy":{"changeType":"deleted","description":"Prior malignancy affecting donor.","name":"prior_malignancy","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"cancer_type_prior_malignancy":{"changeType":"deleted","description":"The ICD-10 diagnostic code (https://icd.who.int/browse10/2019/en) for the type of cancer in a prior malignancy.","name":"cancer_type_prior_malignancy","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"valueType":"string","meta":{"displayName":"Cancer Type Prior Malignancy"}},"age_at_prior_malignancy":{"changeType":"deleted","description":"If donor has history of prior malignancy, indicate age at previous diagnosis, in years.","name":"age_at_prior_malignancy","valueType":"integer","meta":{"displayName":"Age at Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"deleted","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis.","name":"laterality_of_prior_malignancy","valueType":"string","meta":{"displayName":"Laterality at Prior Malignancy"}}}},"specimen":{"updated":{"pathological_tumour_staging_system":{"meta":{"validationDependency":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(\n field =>\n Object.keys(convertedRow).includes(field) &&\n (!convertedRow[field] || checkforEmpty(convertedRow[field])),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"deleted":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"]}}}},"pathological_t_category":{"restrictions":{}},"pathological_n_category":{"restrictions":{}},"pathological_m_category":{"restrictions":{}},"pathological_stage_group":{"description":{"left":"Specify the tumour stage, based on tumour_staging_system, used to assess the cancer at the time the tumour specimen was resected.","right":"Specify the tumour stage, based on pathological_tumour_staging_system, used to assess the cancer at the time the tumour specimen was resected."},"meta":{"notes":{"left":"This field depends on the selected pathological staging system, and is only required if the specimen is a tumour.","right":"This field depends on the selected pathological_tumour_staging_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications"}},"restrictions":{}},"specimen_acquisition_interval":{"meta":{"notes":{"left":"The associated Primary Diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."},"displayName":{"left":"Specimen Aquisition Interval","right":"Specimen Acquisition Interval"}}},"tumour_histological_type":{"description":{"left":"The code to represent the histology (morphology) of neoplasms that is usually obtained from a pathology report, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Please refer to the guidelines provided in the ICD-O-3 manual at https://apps.who.int/iris/handle/10665/42344.","right":"The code to represent the histology (morphology) of neoplasms that is usually obtained from a pathology report, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344."},"meta":{"validationDependency":{"left":null,"right":true}}},"specimen_anatomic_location":{"description":{"left":"Anatomic location of a specimen when it was collected.","right":"Indicate the ICD-O-3 topography code for the anatomic location of a specimen when it was collected. Refer to the guidelines provided in the ICD-O-3 manual at https://apps.who.int/iris/handle/10665/42344."},"meta":{"examples":{"left":null,"right":"C50.1,C18"}},"restrictions":{"codeList":{"left":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear - pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal - distal","Esophageal - mid","Esophageal - proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es) - maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"],"data":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear - pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal - distal","Esophageal - mid","Esophageal - proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es) - maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"]},"regex":{"left":null,"right":"^[C][0-9]{2}(.[0-9]{1})?$"}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"specimen_storage":{"description":{"left":"Indicate the method of specimen storage for specimens that were not extracted freshly or immediately cultured.","right":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured."},"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"tumour_grading_system":{"meta":{"validationDependency":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["Default","Gleason","Nottingham","Brain cancer","ISUP","Lymphoid neoplasms"],"right":["FNCLCC grading system","Four-tier grading system","Gleason grade group system","Grading system for GISTs","Grading system for GNETs","ISUP grading system","Nuclear grading system for DCIS","Scarff-Bloom-Richardson grading system","Three-tier grading system","Two-tier grading system","WHO grading system for CNS tumours"],"data":{"added":["FNCLCC grading system","Four-tier grading system","Gleason grade group system","Grading system for GISTs","Grading system for GNETs","ISUP grading system","Nuclear grading system for DCIS","Scarff-Bloom-Richardson grading system","Three-tier grading system","Two-tier grading system","WHO grading system for CNS tumours"],"deleted":["Default","Gleason","Nottingham","Brain cancer","ISUP","Lymphoid neoplasms"]}}}},"tumour_grade":{"meta":{"notes":{"left":"This field depends on the selected tumour grading system, and is only required if the specimen is a tumour.","right":"This field depends on the selected tumour_grading_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Grading Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-grading-classifications"}},"restrictions":{"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'default':\n codeList = [\n 'gx - cannot be assessed',\n 'g1 well differentiated/low grade',\n 'g2 moderately differentiated/intermediated grade',\n 'g3 poorly differentiated/high grade',\n 'g4 undifferentiated/high grade',\n ];\n break;\n case 'gleason':\n codeList = [\n 'gleason x: gleason score cannot be determined',\n 'gleason 2–6: the tumor tissue is well differentiated',\n 'gleason 7: the tumor tissue is moderately differentiated',\n 'gleason 8–10: the tumor tissue is poorly differentiated or undifferentiated',\n ];\n break;\n case 'nottingham':\n codeList = [\n 'g1 (low grade or well differentiated)',\n 'g2 (intermediate grade or moderately differentiated)',\n 'g3 (high grade or poorly differentiated)',\n ];\n break;\n case 'brain cancer':\n codeList = ['grade i', 'grade ii', 'grade iii', 'grade iv'];\n break;\n case 'isup for renal cell carcinoma':\n codeList = [\n 'grade 1: tumor cell nucleoli invisible or small and basophilic at 400 x magnification',\n 'grade 2: tumor cell nucleoli conspicuous at 400 x magnification but inconspicuous at 100 x magnification',\n 'grade 3: tumor cell nucleoli eosinophilic and clearly visible at 100 x magnification',\n 'grade 4: tumors showing extreme nuclear pleomorphism and/or containing tumor giant cells and/or the presence of any proportion of tumor showing sarcomatoid and/or rhabdoid dedifferentiation',\n ];\n break;\n case 'lymphoid neoplasms':\n codeList = ['low grade or indolent nhl', 'high grade or aggressive nhl'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]},"codeList":{"right":["Low grade","High grade","GX","G1","G2","G3","G4","Low","High","Grade I","Grade II","Grade III","Grade IV","Grade Group 1","Grade Group 2","Grade Group 3","Grade Group 4","Grade Group 5"],"data":["Low grade","High grade","GX","G1","G2","G3","G4","Low","High","Grade I","Grade II","Grade III","Grade IV","Grade Group 1","Grade Group 2","Grade Group 3","Grade Group 4","Grade Group 5"]}}},"percent_tumour_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of infiltration by tumour cells in a specimen.","right":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)"},"restrictions":{}},"percent_proliferating_cells":{"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_inflammatory_tissue":{"description":{"left":"Indicate a value, in decimals, that represents local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue.","right":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_stromal_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a malignant tumour specimen but are not malignant such as fibroblasts, vascular structures, etc.","right":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_necrosis":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of cell death in a malignant tumour specimen.","right":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}}},"created":{"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate the primary diagnosis event in the clinical timeline that this specimen acquisition was related to.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"specimen_laterality":{"changeType":"created","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"reference_pathology_confirmed":{"changeType":"created","name":"reference_pathology_confirmed","description":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)","valueType":"string","meta":{"validationDependency":true,"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Reference Pathology Confirmed"},"restrictions":{"codeList":["Yes","No","Unknown"]}},"percent_tumour_cells_measurement_method":{"changeType":"created","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}},"deleted":{"central_pathology_confirmed":{"changeType":"deleted","name":"central_pathology_confirmed","description":"Indicate whether the histologic description of tissue or cells was confirmed by a pathology review of frozen or formalin fixed slide(s) completed after the diagnostic pathology review of the tumour sample used to extract analyte(s).","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Central Pathology Confirmed"},"restrictions":{"codeList":["Yes","No","Unknown"]}}}},"primary_diagnosis":{"updated":{"age_at_diagnosis":{"description":{"left":"Age that the donor was first diagnosed with cancer, in years.","right":"Age that the donor was first diagnosed with cancer, in years. This should be based on the earliest diagnosis of cancer."},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0,"max":90}}}},"basis_of_diagnosis":{},"number_lymph_nodes_positive":{"description":{"left":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: NCI CDE ID: 6113694)","right":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: caDSR CDE ID 6113694)"},"meta":{"dependsOn":{"left":null,"right":"primary_diagnosis.lymph_nodes_examined_status"},"notes":{"left":null,"right":"This field is only required if 'lymph_nodes_examined_status' is 'Yes'."}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"]},"range":{"left":null,"right":{"min":0}}}},"number_lymph_nodes_examined":{"description":{"left":"The total number of lymph nodes tested for the presence of cancer. (Reference: NCI CDE ID: 3)","right":"The total number of lymph nodes tested for the presence of cancer. (Reference: caDSR CDE ID 3)"},"meta":{"dependsOn":{"left":null,"right":"primary_diagnosis.lymph_nodes_examined_status"},"notes":{"left":null,"right":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'."}},"restrictions":{}},"clinical_tumour_staging_system":{"meta":{"validationDependency":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(\n field =>\n Object.keys(convertedRow).includes(field) &&\n (!convertedRow[field] || checkforEmpty(convertedRow[field])),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"required":{"left":true,"right":null},"codeList":{"left":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"deleted":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"]}}}},"clinical_stage_group":{"description":{"left":"Stage group of the tumour, as assigned by the reporting tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.).","right":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage."},"meta":{"notes":{"left":null,"right":"This field is dependent on the selected clinical_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications"},"examples":{"left":null,"right":"Stage I, Stage IIB"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"clinical_t_category":{"restrictions":{}},"clinical_n_category":{"description":{"left":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"restrictions":{}},"clinical_m_category":{"description":{"left":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned.","right":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned."},"restrictions":{}},"presenting_symptoms":{"meta":{"notes":{"left":null,"right":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"examples":{"left":null,"right":"Anemia|Bloating|Diabetes"}},"restrictions":{"codeList":{"left":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Nausea","None","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Unknown","Vomiting","Weight Loss"],"right":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Loss of Appetite","Nausea","None","Not Reported","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Swelling in the Neck","Unknown","Vomiting","Weight Loss"],"data":{"added":["Loss of Appetite","Not Reported","Swelling in the Neck"],"deleted":[]}}}},"performance_status":{"description":{"left":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference source: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status).","right":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status)."},"meta":{"notes":{"left":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction \n Grade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work) \n Grade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours \n Grade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours \n Grade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair","right":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction.\nGrade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work).\nGrade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours.\nGrade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours.\nGrade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair"}},"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}}},"created":{"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Unique identifier of the primary diagnosis event, assigned by the data provider.","meta":{"primaryId":true,"displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"cancer_type_additional_information":{"changeType":"created","name":"cancer_type_additional_information","valueType":"string","description":"Additional details related to the cancer type that are not covered by the ICD-10 code provided in the cancer_type field.","meta":{"displayName":"Cancer Type Additional Information"}},"laterality":{"changeType":"created","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_status":{"changeType":"created","name":"lymph_nodes_examined_status","description":"Indicate if lymph nodes were examined for metastases.","valueType":"string","restrictions":{"required":true,"codeList":["Cannot be determined","No","No lymph nodes found in resected specimen","Not applicable","Yes"]},"meta":{"core":true,"displayName":"Lymph Nodes Examined Status"}},"lymph_nodes_examined_method":{"changeType":"created","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}},"deleted":{"stage_suffix":{"changeType":"deleted","name":"stage_suffix","description":"If necessary, use this field to add any applicable stage suffixes. Stage suffixes may apply to certain staging systems such as Ann Arbour staging system where the four stages are divided into 4 categories (A, B, X and E).","valueType":"string","meta":{"core":true,"dependsOn":"primary_diagnosis.clinical_tumour_staging_system","displayName":"Stage Suffix"}}}},"treatment":{"updated":{"treatment_type":{"meta":{"notes":{"left":"Depending on the treatment_type selected, additional treament details may be required to be submitted.","right":"Depending on the treatment_type(s) selected, additional treatment details may be required to be submitted. For example, if treatment_type includes 'Chemotherapy', the supplemental Chemotherapy treatment type file is required.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."},"examples":{"left":null,"right":"Chemotherapy|Hormonal therapy"}},"restrictions":{"codeList":{"left":["Chemotherapy","Ablation","Bone marrow transplant","Combined chemo+immunotherapy","Combined chemo+radiation therapy","Combined chemo-radiotherapy and surgery","Endoscopic therapy","Hormonal therapy","Immunotherapy","Monoclonal antibodies (for liquid tumours)","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgical resection"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":["End of life care","Surgery"],"deleted":["Combined chemo+immunotherapy","Combined chemo+radiation therapy","Combined chemo-radiotherapy and surgery","Monoclonal antibodies (for liquid tumours)","Surgical resection"]}}}},"is_primary_treatment":{"description":{"left":"Indicate if the treamtment was the primary treatment following the initial diagnosis.","right":"Indicate if the treatment was the primary treatment following the initial diagnosis."},"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Yes","No","Unknown"],"right":["Yes","No"],"data":{"added":[],"deleted":["Unknown"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_start_interval":{"description":{"left":"The interval between primary diagnosis and initiation of treatment, in days.","right":"The interval between the primary diagnosis and initiation of treatment, in days."},"meta":{"notes":{"left":"The associated Primary Diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis","right":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."},"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_duration":{"description":{"left":"The duration of treatment regimen, in days","right":"The duration of treatment regimen, in days."},"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}}},"created":{"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate the primary diagnosis event in the clinical timeline that this treatment was related to.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"line_of_treatment":{"changeType":"created","name":"line_of_treatment","description":"Indicate the line of treatment if it is not the primary treatment.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Line Of treatment","dependsOn":"treatment.is_primary_treatment","examples":"2,3,4"}},"days_per_cycle":{"changeType":"created","name":"days_per_cycle","description":"Indicate the number of days in a treatment cycle.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Days Per Cycle","dependsOn":"treatment.treatment_type"}},"number_of_cycles":{"changeType":"created","name":"number_of_cycles","description":"Indicate the number of treatment cycles.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Number Of Cycles","dependsOn":"treatment.treatment_type"}},"treatment_intent":{"changeType":"created","name":"treatment_intent","description":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"]},"meta":{"core":true,"displayName":"Treatment Intent","dependsOn":"treatment.treatment_type"}},"treatment_setting":{"changeType":"created","name":"treatment_setting","description":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: NCIt C124308)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"]},"meta":{"core":true,"displayName":"Treatment Setting","dependsOn":"treatment.treatment_type"}},"response_to_treatment_criteria_method":{"changeType":"created","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},"response_to_treatment":{"changeType":"created","name":"response_to_treatment","description":"The donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"codeList":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"]},"meta":{"core":true,"displayName":"Response To Treatment","dependsOn":"treatment.response_to_treatment_criteria_method","notes":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"outcome_of_treatment":{"changeType":"created","name":"outcome_of_treatment","description":"Indicate the donor's outcome of the prescribed treatment.","valueType":"string","restrictions":{"codeList":["Treatment completed as prescribed","Treatment incomplete due to technical or organizational problems","Treatment incomplete because patient died","Patient choice (stopped or interrupted treatment)","Physician decision (stopped or interrupted treatment)","Treatment stopped due to lack of efficacy (disease progression)","Treatment stopped due to acute toxicity","Other","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Outcome Of Treatment","dependsOn":"treatment.treatment_type"}},"toxicity_type":{"changeType":"created","name":"toxicity_type","description":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity.","valueType":"string","restrictions":{"codeList":["Hematological","Non-hematological","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Toxicity Type","dependsOn":"treatment.outcome_of_treatment"}},"hematological_toxicity":{"changeType":"created","name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"non-hematological_toxicity":{"changeType":"created","name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"adverse_events":{"changeType":"created","name":"adverse_events","description":"Report any treatment related adverse events. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Adverse Events","dependsOn":"treatment.treatment_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"clinical_trials_database":{"changeType":"created","name":"clinical_trials_database","description":"If the donor is a participant in a clinical trial, indicate the clinical trial database where the clinical trial is registered.","valueType":"string","meta":{"display name":"Clinical Trials Database","notes":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added."},"restrictions":{"codeList":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"]}},"clinical_trial_number":{"changeType":"created","name":"clinical_trial_number","description":"Based on the clinical_trial_database, indicate the unique NCT or EudraCT clinical trial identifier of which the donor is a participant.","valueType":"string","meta":{"display name":"Clinical Trial Number","dependsOn":"treatment.clinical_trials_database","examples":"2016-002120-83,NCT02465060"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"]}}},"deleted":{"age_at_consent_for_treatment":{"changeType":"deleted","name":"age_at_consent_for_treatment","description":"Indicate the age of donor when consent was given for treatment.","valueType":"integer","meta":{"displayName":"Age At Consent For Treatment"}},"therapeutic_intent":{"changeType":"deleted","name":"therapeutic_intent","description":"The therapeutic intent, the reason behind the choice of a therapy, of the treatment.","valueType":"string","restrictions":{"required":true,"codeList":["Adjuvant","Concurrent","Curative","Neoadjuvant","Not applicable","Palliative","Unknown"]},"meta":{"core":true,"displayName":"Therapeutic Intent"}},"response_to_therapy":{"changeType":"deleted","name":"response_to_therapy","description":"The donors's response to the applied treatment regimen. (Source: RECIST)","valueType":"string","restrictions":{"required":true,"codeList":["Complete response","Disease progression","NED","Partial response","Stable disease"]},"meta":{"core":true,"displayName":"Response to Therapy"}}}},"chemotherapy":{"updated":{"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses a controlled vocabulary gathered from the RxNorm database of drug names provided by the NIH (https://www.nlm.nih.gov/research/umls/rxnorm).","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"description":{"left":"Name of agent or drug administered to patient as part of the treatment regimen.","right":"Name of agent or drug administered to donor as part of the treatment regimen."},"meta":{"notes":{"left":"This field uses a controlled vocabulary gathered from the RxNorm database of drug names provided by the NIH (https://www.nlm.nih.gov/research/umls/rxnorm).","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"created","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"created","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"created","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"created","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}},"deleted":{"chemotherapy_dosage_units":{"changeType":"deleted","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","µg/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate the total drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"integer","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"hormone_therapy":{"updated":{"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses a controlled vocabulary gathered from the RxNorm database of drug names provided by the NIH (https://www.nlm.nih.gov/research/umls/rxnorm).","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"description":{"left":"Name of agent or drug administered to patient as part of the treatment regimen.","right":"Name of agent or drug administered to donor as part of the treatment regimen."},"meta":{"notes":{"left":"This field uses a controlled vocabulary gathered from the RxNorm database of drug names provided by the NIH (https://www.nlm.nih.gov/research/umls/rxnorm).","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"created","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{"hormone_drug_dosage_units":{"changeType":"deleted","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","µg/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"integer","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dose"}}}},"radiation":{"updated":{"radiation_therapy_fractions":{"description":{"left":"Indicate the number of total fractions delivered as part of treatment.","right":"Indicate the total number of fractions delivered as part of treatment."},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"radiation_therapy_dosage":{"valueType":{"left":"integer","right":"number"},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"anatomical_site_irradiated":{"description":{"left":"Indicate localization site where radiation therapy was administered.","right":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)"},"restrictions":{"codeList":{"left":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"right":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"data":{"added":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"],"deleted":["Bone","Extremities","Head-Neck","Peritoneum"]}}}}},"created":{"radiation_therapy_type":{"changeType":"created","name":"radiation_therapy_type","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal"]},"meta":{"core":true,"displayName":"Type of Radiation Therapy","notes":"Internal application includes Brachytherapy."}},"radiation_boost":{"changeType":"created","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"created","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}},"deleted":{"application_form":{"changeType":"deleted","name":"application_form","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal (including Brachytherapy)"]},"meta":{"core":true,"displayName":"Application Form"}}}},"follow_up":{"updated":{"submitter_follow_up_id":{"description":{"left":"Unique identifier for a follow-up event in a donors clincal record, assigned by the data provider.","right":"Unique identifier for a follow-up event in a donor's clinical record, assigned by the data provider."}},"interval_of_followup":{"meta":{"notes":{"left":"The associated Primary Diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}}},"disease_status_at_followup":{"description":{"left":"Indicate the donor's disease status at time of follow-up.","right":"Indicate the donor's disease status at time of follow-up. (Reference: RECIST)"},"restrictions":{"codeList":{"left":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Relapse","Stable"],"right":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Progression NOS","Relapse or recurrence","Stable"],"data":{"added":["Progression NOS","Relapse or recurrence"],"deleted":["Relapse"]}}}},"weight_at_followup":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"relapse_type":{"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}},"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"relapse_interval":{"description":{"left":"If the donor was clinically disease free following primary treatment and then relapse or progression (for liquid tumours) occurred afterwards, then this field will indicate the length of disease free interval, in days.","right":"If the donor was clinically disease free following primary treatment and then relapse or recurrence or progression (for liquid tumours) occurred afterwards, then this field will indicate the length of disease free interval, in days."},"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a progression or relapse value.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}},"restrictions":{"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"]}}},"method_of_progression_status":{"description":{"left":"Indicate the method(s) used to confirm the donor's progression disease status. (Codelist reference: NCI CDE ID: 6161031)","right":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Reference: caDSR CDE ID 6161031)"},"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}},"restrictions":{"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]},"codeList":{"left":["Autopsy","Biomarker in liquid biopsy (e.g. tumour marker in blood or urine)","Biopsy","Blood draw","Bone marrow aspirate","Core biopsy","Cystoscopy","Cytology","Debulking","Diagnostic imaging","Dilation and curettage procedure","Enucleation","Excisional biopsy","Fine needle aspiration","Imaging","Incisional biopsy","Laparoscopy","Laparotomy","Other","Pap Smear","Pathologic review","Physical exam","Surgical resection","Thoracentesis","Ultrasound guided biopsy"],"right":["Biomarker in liquid biopsy (e.g. tumour marker in blood or urine)","Biopsy","Blood draw","Bone marrow aspirate","Core biopsy","Cystoscopy","Cytology","Debulking","Diagnostic imaging","Dilation and curettage procedure","Enucleation","Excisional biopsy","Fine needle aspiration","Imaging","Incisional biopsy","Laparoscopy","Laparotomy","Other","Pap Smear","Pathologic review","Physical exam","Surgical resection","Thoracentesis","Ultrasound guided biopsy"],"data":{"added":[],"deleted":["Autopsy"]}}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}},"restrictions":{"codeList":{"left":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"deleted":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"]}},"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(\n field =>\n Object.keys(convertedRow).includes(field) &&\n (!convertedRow[field] || checkforEmpty(convertedRow[field])),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_t_category":{"description":{"left":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":true,"right":null}},"restrictions":{}},"recurrence_n_category":{"description":{"left":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":true,"right":null}},"restrictions":{}},"recurrence_m_category":{"description":{"left":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":true,"right":null}},"restrictions":{}},"recurrence_stage_group":{"description":{"left":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery.","right":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) at the time of retreatment for a recurrence or disease progression."},"meta":{"core":{"left":true,"right":null},"notes":{"left":null,"right":"This field is dependent on the selected recurrence_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications"}},"restrictions":{}},"posttherapy_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(\n field =>\n Object.keys(convertedRow).includes(field) &&\n (!convertedRow[field] || checkforEmpty(convertedRow[field])),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"deleted":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"]}}}},"posttherapy_t_category":{"meta":{"dependsOn":{"left":"follow_up.post_therapy_tumour_staging_system","right":"follow_up.posttherapy_tumour_staging_system"}},"restrictions":{}},"posttherapy_n_category":{"description":{"left":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"dependsOn":{"left":"follow_up.post_therapy_tumour_staging_system","right":"follow_up.posttherapy_tumour_staging_system"}},"restrictions":{}},"posttherapy_m_category":{"description":{"left":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"dependsOn":{"left":"follow_up.post_therapy_tumour_staging_system","right":"follow_up.posttherapy_tumour_staging_system"}},"restrictions":{}},"posttherapy_stage_group":{"meta":{"dependsOn":{"left":"follow_up.post_therapy_tumour_staging_system","right":"follow_up.posttherapy_tumour_staging_system"},"notes":{"left":"This field value is dependent on the selected posttherapy_tumour_staging_system.","right":"This field is dependent on the selected posttherapy_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications"}},"restrictions":{}}},"created":{"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate if the follow-up is related to a specific primary diagnosis event in the clinical timeline.","meta":{"validationDependency":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID","primaryId":true},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"Indicate if the follow-up is related to a specific treatment event in the clinical timeline.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"anatomic_site_progression_or_recurrence":{"changeType":"created","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"anatomic_site_progression_or_recurrences":{"changeType":"deleted","description":"Indicate the anatomic site where disease progression or recurrence occurred. (Codelist reference: NCI CDE ID: 4742851)","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"],"codeList":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear - pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal - distal","Esophageal - mid","Esophageal - proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es) - maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"]},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","notes":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse.","displayName":"Anatomic Site Progression or Recurrences"}}}},"immunotherapy":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"immunotherapy_type":{"changeType":"created","name":"immunotherapy_type","valueType":"string","description":"Indicate the type of immunotherapy administered to donor.","meta":{"displayName":"Immunotherapy Type","core":true},"restrictions":{"required":true,"codeList":["Cell-based","Immune checkpoint inhibitors","Monoclonal antibodies other than immune checkpoint inhibitors","Other immunomodulatory substances"]}},"drug_rxnormcui":{"changeType":"created","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"created","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"created","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{}},"surgery":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"created","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"created","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"created","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"created","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"created","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"created","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"created","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"created","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"created","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"created","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"created","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"created","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"created","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"created","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}},"deleted":{}},"exposure":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"created","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"created","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"created","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"created","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"created","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"created","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"created","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"created","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"created","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"created","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"created","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"created","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"created","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}},"deleted":{}},"family_history":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"family_relative_id":{"changeType":"created","description":"Unique identifier of the relative, assigned by the data provider.","name":"family_relative_id","valueType":"string","meta":{"displayName":"Family Relative ID","primaryId":true,"notes":"This field is required to ensure that family members are identified in unique records. Ids can be as simple as an incremented numeral to ensure uniqueness."},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"relative_with_cancer_history":{"changeType":"created","description":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","name":"relative_with_cancer_history","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Relative with Cancer History"}},"relationship_type":{"changeType":"created","description":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","name":"relationship_type","restrictions":{"codeList":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"]},"valueType":"string","meta":{"displayName":"Relationship Type"}},"gender_of_relative":{"changeType":"created","description":"The self-reported gender of related individual.","name":"gender_of_relative","restrictions":{"codeList":["Female","Male","Other","Unknown"]},"valueType":"string","meta":{"displayName":"Gender of Relative"}},"age_of_relative_at_diagnosis":{"changeType":"created","description":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","name":"age_of_relative_at_diagnosis","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","displayName":"Age Of Relative At Diagnosis"}},"cancer_type_code_of_relative":{"changeType":"created","name":"cancer_type_code_of_relative","valueType":"string","description":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"examples":"C41.1,C16.9,C00.5,D46.9","dependsOn":"family_history.relative_with_cancer_history","displayName":"Cancer Type Code (ICD-10) of Relative"}},"relative_vital_status":{"changeType":"created","description":"Relative's last known state of living or deceased.","name":"relative_vital_status","restrictions":{"codeList":["Alive","Deceased","Unknown"]},"valueType":"string","meta":{"displayName":"Vital Status of Relative"}},"cause_of_death_of_relative":{"changeType":"created","description":"Indicate the cause of the death of the relative.","name":"cause_of_death_of_relative","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]},"valueType":"string","meta":{"dependsOn":"family_history.relative_vital_status","displayName":"Cause of Death of Relative"}},"relative_survival_time":{"changeType":"created","description":"Indicate how long, in days, the relative survived from the time they were diagnosed with cancer.","name":"relative_survival_time","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","units":"days","displayName":"Survival Time Of Relative"}}},"deleted":{}},"biomarker":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"created","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"created","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"created","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"created","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"created","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"created","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"created","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"created","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"created","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"created","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"created","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"created","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"created","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"created","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"created","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"created","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"created","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"created","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"created","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}},"deleted":{}},"comorbidity":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"created","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"created","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"created","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"created","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"created","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"created","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}},"deleted":{}}}} diff --git a/website/static/data/schemas/diffs/0.12/0.12-diff-1.24.json b/website/static/data/schemas/diffs/0.12/0.12-diff-1.24.json new file mode 100644 index 00000000..f7286d76 --- /dev/null +++ b/website/static/data/schemas/diffs/0.12/0.12-diff-1.24.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"program_id":{"meta":{"examples":{"left":"PACA-AU,BR-CA","right":"TEST-CA"},"notes":{"left":"This is the unique id that is assigned to your program. If you have logged into the platform, this is the Program Id that you see in the Submission area. For example, PACA-CA is a Program ID.","right":"This is the unique id that is assigned to your program. If you have logged into the platform, this is the Program Id that you see in the Program Services area. For example, TEST-CA is a Program ID."}}},"submitter_donor_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"gender":{},"submitter_specimen_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"specimen_tissue_source":{},"specimen_type":{"restrictions":{"codeList":{"left":["Normal","Normal - tissue adjacent to primary tumour","Primary tumour","Primary tumour - adjacent to normal","Primary tumour - additional new primary","Recurrent tumour","Metastatic tumour","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour - additional metastatic","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line","Cell line - derived from xenograft tumour","Cell line - derived from tumour","Cell line - derived from normal"],"right":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"],"deleted":[]}},"script":{"left":["(function validate() {\n\n const row = $row;\n let result = {valid: true, message: \"Ok\"};\n \n const designation = row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\"){\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when tumour_normal_designation is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when tumour_normal_designation is set to Tumour.\"};\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"]}}},"submitter_sample_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"sample_type":{}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased","Unknown"],"right":["Alive","Deceased"],"data":{"added":[],"deleted":["Unknown"]}}}},"cause_of_death":{"restrictions":{"codeList":{"left":["Died of cancer","Died of other reasons"],"right":["Died of cancer","Died of other reasons","Unknown"],"data":{"added":["Unknown"],"deleted":[]}},"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]}}},"survival_time":{"restrictions":{"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"primary_site":{"meta":{"notes":{"left":null,"right":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"examples":{"left":null,"right":"Breast|Ovary"}},"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva","Unknown","Not Reported"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"data":{"added":["Unknown primary site"],"deleted":["Unknown","Not Reported"]}}}},"height":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"weight":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"bmi":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"menopause_status":{"description":{"left":"Indicate the donor's menopause status at the time of primary diagnosis. (Codelist reference: NCI CDE ID: 2434914)","right":"Indicate the donor's menopause status at the time of primary diagnosis. (Reference: caDSR CDE ID 2434914)"},"restrictions":{"codeList":{"left":["Indeterminate or unknown","Not applicable","Perimenopausal","Postmenopausal","Premenopausal"],"right":["Not applicable","Perimenopausal","Postmenopausal","Premenopausal","Unknown"],"data":{"added":["Unknown"],"deleted":["Indeterminate or unknown"]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age of menarche, the first occurrence of menstruation.","right":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)"},"restrictions":{}},"number_of_pregnancies":{"description":{"left":"Indicate the number of pregnancies a donor has had.","right":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)"},"restrictions":{}},"number_of_children":{"description":{"left":"Indicate the number of children the donor has birthed.","right":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)"},"restrictions":{}}},"created":{"genetic_disorders":{"changeType":"created","description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},"hrt_type":{"changeType":"created","description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},"hrt_duration":{"changeType":"created","description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},"contraception_type":{"changeType":"created","description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},"contraception_duration":{"changeType":"created","description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},"lost_to_followup_after_clinical_event_id":{"changeType":"created","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}},"deleted":{"prior_malignancy":{"changeType":"deleted","description":"Prior malignancy affecting donor.","name":"prior_malignancy","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy","examples":"C41.1, C16.9, C00.5, D46.9"}},"cancer_type_prior_malignancy":{"changeType":"deleted","description":"The code to represent the cancer type of a prior malignancy using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","name":"cancer_type_prior_malignancy","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"valueType":"string","meta":{"displayName":"Cancer Type Prior Malignancy"}},"age_at_prior_malignancy":{"changeType":"deleted","description":"If donor has history of prior malignancy, indicate age at previous diagnosis, in years.","name":"age_at_prior_malignancy","valueType":"integer","meta":{"displayName":"Age at Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"deleted","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis.","name":"laterality_of_prior_malignancy","valueType":"string","meta":{"displayName":"Laterality at Prior Malignancy"}}}},"specimen":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"description":{"left":"Indicate the primary diagnosis event in the clinical timeline that this specimen aquisition was related to.","right":"Indicate the primary diagnosis event in the clinical timeline that this specimen acquisition was related to."},"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"pathological_tumour_staging_system":{"meta":{"validationDependency":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"deleted":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"]}}}},"pathological_t_category":{"restrictions":{}},"pathological_n_category":{"restrictions":{}},"pathological_m_category":{"restrictions":{}},"pathological_stage_group":{"description":{"left":"Specify the tumour stage, based on tumour_staging_system, used to assess the cancer at the time the tumour specimen was resected.","right":"Specify the tumour stage, based on pathological_tumour_staging_system, used to assess the cancer at the time the tumour specimen was resected."},"meta":{"notes":{"left":"This field depends on the selected pathological staging system, and is only required if the specimen is a tumour.","right":"This field depends on the selected pathological_tumour_staging_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications"}},"restrictions":{}},"specimen_acquisition_interval":{"meta":{"notes":{"left":"The associated Primary Diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."},"displayName":{"left":"Specimen Aquisition Interval","right":"Specimen Acquisition Interval"}}},"tumour_histological_type":{"description":{"left":"The code to represent the histology (morphology) of neoplasms that is usually obtained from a pathology report, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Please refer to the guidelines provided in the ICD-O-3 manual at https://apps.who.int/iris/handle/10665/42344.","right":"The code to represent the histology (morphology) of neoplasms that is usually obtained from a pathology report, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344."},"meta":{"validationDependency":{"left":null,"right":true}}},"specimen_anatomic_location":{"description":{"left":"Anatomic location of a specimen when it was collected.","right":"Indicate the ICD-O-3 topography code for the anatomic location of a specimen when it was collected. Refer to the guidelines provided in the ICD-O-3 manual at https://apps.who.int/iris/handle/10665/42344."},"meta":{"examples":{"left":null,"right":"C50.1,C18"}},"restrictions":{"codeList":{"left":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear - pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal - distal","Esophageal - mid","Esophageal - proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es) - maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"],"data":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear - pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal - distal","Esophageal - mid","Esophageal - proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es) - maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"]},"regex":{"left":null,"right":"^[C][0-9]{2}(.[0-9]{1})?$"}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"specimen_storage":{"description":{"left":"Indicate the method of specimen storage for specimens that were not extracted freshly or immediately cultured.","right":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured."},"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"tumour_grading_system":{"meta":{"validationDependency":{"left":null,"right":true}}},"tumour_grade":{"meta":{"notes":{"left":"This field depends on the selected tumour grading system, and is only required if the specimen is a tumour.","right":"This field depends on the selected tumour_grading_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Grading Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-grading-classifications"}},"restrictions":{"codeList":{"left":["Low grade","High grade","GX","G1","G2","G3","G4","Low","High","I","II","III","IV","1","2","3","4","5"],"right":["Low grade","High grade","GX","G1","G2","G3","G4","Low","High","Grade I","Grade II","Grade III","Grade IV","Grade Group 1","Grade Group 2","Grade Group 3","Grade Group 4","Grade Group 5"],"data":{"added":["Grade I","Grade II","Grade III","Grade IV","Grade Group 1","Grade Group 2","Grade Group 3","Grade Group 4","Grade Group 5"],"deleted":["I","II","III","IV","1","2","3","4","5"]}},"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'i',\n 'ii',\n 'iii',\n 'iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n '1',\n '2',\n '3',\n '4',\n '5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"percent_tumour_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of infiltration by tumour cells in a specimen.","right":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)"},"restrictions":{}},"percent_proliferating_cells":{"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_inflammatory_tissue":{"description":{"left":"Indicate a value, in decimals, that represents local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue.","right":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_stromal_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a malignant tumour specimen but are not malignant such as fibroblasts, vascular structures, etc.","right":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_necrosis":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of cell death in a malignant tumour specimen.","right":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}}},"created":{"specimen_laterality":{"changeType":"created","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"reference_pathology_confirmed":{"changeType":"created","name":"reference_pathology_confirmed","description":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)","valueType":"string","meta":{"validationDependency":true,"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Reference Pathology Confirmed"},"restrictions":{"codeList":["Yes","No","Unknown"]}},"percent_tumour_cells_measurement_method":{"changeType":"created","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}},"deleted":{"central_pathology_confirmed":{"changeType":"deleted","name":"central_pathology_confirmed","description":"Indicate whether the histologic description of tissue or cells was confirmed by a pathology review of frozen or formalin fixed slide(s) completed after the diagnostic pathology review of the tumour sample used to extract analyte(s).","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Central Pathology Confirmed"},"restrictions":{"codeList":["Yes","No","Unknown"]}}}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"age_at_diagnosis":{"description":{"left":"Age that the donor was first diagnosed with cancer, in years.","right":"Age that the donor was first diagnosed with cancer, in years. This should be based on the earliest diagnosis of cancer."},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0,"max":90}}}},"basis_of_diagnosis":{},"number_lymph_nodes_positive":{"description":{"left":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: NCI CDE ID: 6113694)","right":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: caDSR CDE ID 6113694)"},"meta":{"dependsOn":{"left":null,"right":"primary_diagnosis.lymph_nodes_examined_status"},"notes":{"left":null,"right":"This field is only required if 'lymph_nodes_examined_status' is 'Yes'."}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"]},"range":{"left":null,"right":{"min":0}}}},"number_lymph_nodes_examined":{"description":{"left":"The total number of lymph nodes tested for the presence of cancer. (Reference: NCI CDE ID: 3)","right":"The total number of lymph nodes tested for the presence of cancer. (Reference: caDSR CDE ID 3)"},"meta":{"dependsOn":{"left":null,"right":"primary_diagnosis.lymph_nodes_examined_status"},"notes":{"left":null,"right":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'."}},"restrictions":{}},"clinical_tumour_staging_system":{"meta":{"validationDependency":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"required":{"left":true,"right":null},"codeList":{"left":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"deleted":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"]}}}},"clinical_stage_group":{"description":{"left":"Stage group of the tumour, as assigned by the reporting tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.).","right":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage."},"meta":{"notes":{"left":null,"right":"This field is dependent on the selected clinical_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications"},"examples":{"left":null,"right":"Stage I, Stage IIB"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"clinical_t_category":{"restrictions":{}},"clinical_n_category":{"description":{"left":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"restrictions":{}},"clinical_m_category":{"description":{"left":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned.","right":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned."},"restrictions":{}},"presenting_symptoms":{"meta":{"notes":{"left":"To include multiple values, separate values with a comma ',' within your file.","right":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"examples":{"left":"Anemia,Bloating,Diabetes","right":"Anemia|Bloating|Diabetes"}},"restrictions":{"codeList":{"left":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Nausea","None","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Unknown","Vomiting","Weight Loss"],"right":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Loss of Appetite","Nausea","None","Not Reported","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Swelling in the Neck","Unknown","Vomiting","Weight Loss"],"data":{"added":["Loss of Appetite","Not Reported","Swelling in the Neck"],"deleted":[]}}}},"performance_status":{"description":{"left":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference source: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status).","right":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status)."},"meta":{"notes":{"left":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction \n Grade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work) \n Grade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours \n Grade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours \n Grade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair","right":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction.\nGrade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work).\nGrade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours.\nGrade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours.\nGrade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair"}},"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}}},"created":{"cancer_type_additional_information":{"changeType":"created","name":"cancer_type_additional_information","valueType":"string","description":"Additional details related to the cancer type that are not covered by the ICD-10 code provided in the cancer_type field.","meta":{"displayName":"Cancer Type Additional Information"}},"laterality":{"changeType":"created","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_status":{"changeType":"created","name":"lymph_nodes_examined_status","description":"Indicate if lymph nodes were examined for metastases.","valueType":"string","restrictions":{"required":true,"codeList":["Cannot be determined","No","No lymph nodes found in resected specimen","Not applicable","Yes"]},"meta":{"core":true,"displayName":"Lymph Nodes Examined Status"}},"lymph_nodes_examined_method":{"changeType":"created","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}},"deleted":{"stage_suffix":{"changeType":"deleted","name":"stage_suffix","description":"If necessary, use this field to add any applicable stage suffixes. Stage suffixes may apply to certain staging systems such as Ann Arbour staging system where the four stages are divided into 4 categories (A, B, X and E).","valueType":"string","meta":{"core":true,"dependsOn":"primary_diagnosis.clinical_tumour_staging_system","displayName":"Stage Suffix"}}}},"treatment":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"treatment_type":{"meta":{"notes":{"left":"Depending on the treatment_type selected, additional treament details may be required to be submitted. Depending on the treatment_type selected, additional treatment details may be required to be submitted. For example, if treatment_type includes 'Chemotherapy', the supplemental Chemotherapy treatment type file is required.","right":"Depending on the treatment_type(s) selected, additional treatment details may be required to be submitted. For example, if treatment_type includes 'Chemotherapy', the supplemental Chemotherapy treatment type file is required.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."},"examples":{"left":null,"right":"Chemotherapy|Hormonal therapy"}},"restrictions":{"codeList":{"left":["Chemotherapy","Ablation","Bone marrow transplant","Combined chemo+immunotherapy","Combined chemo+radiation therapy","Combined chemo-radiotherapy and surgery","Endoscopic therapy","Hormonal therapy","Immunotherapy","Monoclonal antibodies (for liquid tumours)","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgical resection"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":["End of life care","Surgery"],"deleted":["Combined chemo+immunotherapy","Combined chemo+radiation therapy","Combined chemo-radiotherapy and surgery","Monoclonal antibodies (for liquid tumours)","Surgical resection"]}}}},"is_primary_treatment":{"description":{"left":"Indicate if the treamtment was the primary treatment following the initial diagnosis.","right":"Indicate if the treatment was the primary treatment following the initial diagnosis."},"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Yes","No","Unknown"],"right":["Yes","No"],"data":{"added":[],"deleted":["Unknown"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_start_interval":{"description":{"left":"The interval between primary diagnosis and initiation of treatment, in days.","right":"The interval between the primary diagnosis and initiation of treatment, in days."},"meta":{"notes":{"left":"The associated Primary Diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."},"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_duration":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}}},"created":{"line_of_treatment":{"changeType":"created","name":"line_of_treatment","description":"Indicate the line of treatment if it is not the primary treatment.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Line Of treatment","dependsOn":"treatment.is_primary_treatment","examples":"2,3,4"}},"days_per_cycle":{"changeType":"created","name":"days_per_cycle","description":"Indicate the number of days in a treatment cycle.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Days Per Cycle","dependsOn":"treatment.treatment_type"}},"number_of_cycles":{"changeType":"created","name":"number_of_cycles","description":"Indicate the number of treatment cycles.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Number Of Cycles","dependsOn":"treatment.treatment_type"}},"treatment_intent":{"changeType":"created","name":"treatment_intent","description":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"]},"meta":{"core":true,"displayName":"Treatment Intent","dependsOn":"treatment.treatment_type"}},"treatment_setting":{"changeType":"created","name":"treatment_setting","description":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: NCIt C124308)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"]},"meta":{"core":true,"displayName":"Treatment Setting","dependsOn":"treatment.treatment_type"}},"response_to_treatment_criteria_method":{"changeType":"created","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},"response_to_treatment":{"changeType":"created","name":"response_to_treatment","description":"The donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"codeList":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"]},"meta":{"core":true,"displayName":"Response To Treatment","dependsOn":"treatment.response_to_treatment_criteria_method","notes":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"outcome_of_treatment":{"changeType":"created","name":"outcome_of_treatment","description":"Indicate the donor's outcome of the prescribed treatment.","valueType":"string","restrictions":{"codeList":["Treatment completed as prescribed","Treatment incomplete due to technical or organizational problems","Treatment incomplete because patient died","Patient choice (stopped or interrupted treatment)","Physician decision (stopped or interrupted treatment)","Treatment stopped due to lack of efficacy (disease progression)","Treatment stopped due to acute toxicity","Other","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Outcome Of Treatment","dependsOn":"treatment.treatment_type"}},"toxicity_type":{"changeType":"created","name":"toxicity_type","description":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity.","valueType":"string","restrictions":{"codeList":["Hematological","Non-hematological","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Toxicity Type","dependsOn":"treatment.outcome_of_treatment"}},"hematological_toxicity":{"changeType":"created","name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"non-hematological_toxicity":{"changeType":"created","name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"adverse_events":{"changeType":"created","name":"adverse_events","description":"Report any treatment related adverse events. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Adverse Events","dependsOn":"treatment.treatment_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"clinical_trials_database":{"changeType":"created","name":"clinical_trials_database","description":"If the donor is a participant in a clinical trial, indicate the clinical trial database where the clinical trial is registered.","valueType":"string","meta":{"display name":"Clinical Trials Database","notes":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added."},"restrictions":{"codeList":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"]}},"clinical_trial_number":{"changeType":"created","name":"clinical_trial_number","description":"Based on the clinical_trial_database, indicate the unique NCT or EudraCT clinical trial identifier of which the donor is a participant.","valueType":"string","meta":{"display name":"Clinical Trial Number","dependsOn":"treatment.clinical_trials_database","examples":"2016-002120-83,NCT02465060"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"]}}},"deleted":{"age_at_consent_for_treatment":{"changeType":"deleted","name":"age_at_consent_for_treatment","description":"Indicate the age of donor when consent was given for treatment.","valueType":"integer","meta":{"displayName":"Age At Consent For Treatment"}},"therapeutic_intent":{"changeType":"deleted","name":"therapeutic_intent","description":"The therapeutic intent, the reason behind the choice of a therapy, of the treatment.","valueType":"string","restrictions":{"required":true,"codeList":["Adjuvant","Concurrent","Curative","Neoadjuvant","Not applicable","Palliative","Unknown"]},"meta":{"core":true,"displayName":"Therapeutic Intent"}},"response_to_therapy":{"changeType":"deleted","name":"response_to_therapy","description":"The donors's response to the applied treatment regimen. (Source: RECIST)","valueType":"string","restrictions":{"required":true,"codeList":["Complete response","Disease progression","NED","Partial response","Stable disease"]},"meta":{"core":true,"displayName":"Response to Therapy"}}}},"chemotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses a controlled vocabulary gathered from the RxNorm database of drug names provided by the NIH (https://www.nlm.nih.gov/research/umls/rxnorm).","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"description":{"left":"Name of agent or drug administered to patient as part of the treatment regimen.","right":"Name of agent or drug administered to donor as part of the treatment regimen."},"meta":{"notes":{"left":"This field uses a controlled vocabulary gathered from the RxNorm database of drug names provided by the NIH (https://www.nlm.nih.gov/research/umls/rxnorm).","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"created","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"created","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"created","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"created","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}},"deleted":{"chemotherapy_dosage_units":{"changeType":"deleted","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate the total drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses a controlled vocabulary gathered from the RxNorm database of drug names provided by the NIH (https://www.nlm.nih.gov/research/umls/rxnorm).","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"description":{"left":"Name of agent or drug administered to patient as part of the treatment regimen.","right":"Name of agent or drug administered to donor as part of the treatment regimen."},"meta":{"notes":{"left":"This field uses a controlled vocabulary gathered from the RxNorm database of drug names provided by the NIH (https://www.nlm.nih.gov/research/umls/rxnorm).","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"created","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{"hormone_drug_dosage_units":{"changeType":"deleted","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"radiation":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"radiation_therapy_fractions":{"description":{"left":"Indicate the number of total fractions delivered as part of treatment.","right":"Indicate the total number of fractions delivered as part of treatment."},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"radiation_therapy_dosage":{"valueType":{"left":"integer","right":"number"},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"anatomical_site_irradiated":{"description":{"left":"Indicate localization site where radiation therapy was administered.","right":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)"},"restrictions":{"codeList":{"left":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"right":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"data":{"added":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"],"deleted":["Bone","Extremities","Head-Neck","Peritoneum"]}}}}},"created":{"radiation_therapy_type":{"changeType":"created","name":"radiation_therapy_type","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal"]},"meta":{"core":true,"displayName":"Type of Radiation Therapy","notes":"Internal application includes Brachytherapy."}},"radiation_boost":{"changeType":"created","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"created","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}},"deleted":{"application_form":{"changeType":"deleted","name":"application_form","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal"]},"meta":{"core":true,"displayName":"Application Form","notes":"Internal application includes Brachytherapy."}}}},"follow_up":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_follow_up_id":{"description":{"left":"Unique identifier for a follow-up event in a donors clincal record, assigned by the data provider.","right":"Unique identifier for a follow-up event in a donor's clinical record, assigned by the data provider."},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"interval_of_followup":{"meta":{"notes":{"left":"The associated Primary Diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}}},"disease_status_at_followup":{"description":{"left":"Indicate the donor's disease status at time of follow-up.","right":"Indicate the donor's disease status at time of follow-up. (Reference: RECIST)"},"restrictions":{"codeList":{"left":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Relapse","Stable"],"right":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Progression NOS","Relapse or recurrence","Stable"],"data":{"added":["Progression NOS","Relapse or recurrence"],"deleted":["Relapse"]}}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"treatment.submitter_treatment_id"}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"weight_at_followup":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"relapse_type":{"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}},"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"relapse_interval":{"description":{"left":"If the donor was clinically disease free following primary treatment and then relapse or progression (for liquid tumours) occurred afterwards, then this field will indicate the length of disease free interval, in days.","right":"If the donor was clinically disease free following primary treatment and then relapse or recurrence or progression (for liquid tumours) occurred afterwards, then this field will indicate the length of disease free interval, in days."},"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a progression or relapse value.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}},"restrictions":{"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"]}}},"method_of_progression_status":{"description":{"left":"Indicate the method(s) used to confirm the donor's progression disease status. (Codelist reference: NCI CDE ID: 6161031)","right":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Reference: caDSR CDE ID 6161031)"},"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}},"restrictions":{"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}},"restrictions":{"codeList":{"left":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"deleted":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"]}},"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_t_category":{"description":{"left":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":true,"right":null}},"restrictions":{}},"recurrence_n_category":{"description":{"left":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":true,"right":null}},"restrictions":{}},"recurrence_m_category":{"description":{"left":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":true,"right":null}},"restrictions":{}},"recurrence_stage_group":{"description":{"left":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery.","right":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) at the time of retreatment for a recurrence or disease progression."},"meta":{"core":{"left":true,"right":null},"notes":{"left":null,"right":"This field is dependent on the selected recurrence_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications"}},"restrictions":{}},"posttherapy_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"deleted":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"]}}}},"posttherapy_t_category":{"meta":{"dependsOn":{"left":"follow_up.post_therapy_tumour_staging_system","right":"follow_up.posttherapy_tumour_staging_system"}},"restrictions":{}},"posttherapy_n_category":{"description":{"left":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"dependsOn":{"left":"follow_up.post_therapy_tumour_staging_system","right":"follow_up.posttherapy_tumour_staging_system"}},"restrictions":{}},"posttherapy_m_category":{"description":{"left":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"dependsOn":{"left":"follow_up.post_therapy_tumour_staging_system","right":"follow_up.posttherapy_tumour_staging_system"}},"restrictions":{}},"posttherapy_stage_group":{"meta":{"dependsOn":{"left":"follow_up.post_therapy_tumour_staging_system","right":"follow_up.posttherapy_tumour_staging_system"},"notes":{"left":"This field is required only if the selected posttherapy_tumour_staging_system is any edition of the AJCC cancer staging system.","right":"This field is dependent on the selected posttherapy_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications"}},"restrictions":{}}},"created":{"anatomic_site_progression_or_recurrence":{"changeType":"created","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"anatomic_site_progression_or_recurrences":{"changeType":"deleted","description":"Indicate the anatomic site where disease progression or recurrence occurred. (Codelist reference: NCI CDE ID: 4742851)","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"],"codeList":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear - pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal - distal","Esophageal - mid","Esophageal - proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es) - maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"]},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","notes":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse.","displayName":"Anatomic Site Progression or Recurrences"}}}},"immunotherapy":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"immunotherapy_type":{"changeType":"created","name":"immunotherapy_type","valueType":"string","description":"Indicate the type of immunotherapy administered to donor.","meta":{"displayName":"Immunotherapy Type","core":true},"restrictions":{"required":true,"codeList":["Cell-based","Immune checkpoint inhibitors","Monoclonal antibodies other than immune checkpoint inhibitors","Other immunomodulatory substances"]}},"drug_rxnormcui":{"changeType":"created","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"created","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"created","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{}},"surgery":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"created","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"created","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"created","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"created","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"created","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"created","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"created","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"created","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"created","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"created","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"created","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"created","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"created","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"created","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}},"deleted":{}},"exposure":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"created","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"created","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"created","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"created","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"created","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"created","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"created","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"created","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"created","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"created","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"created","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"created","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"created","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}},"deleted":{}},"family_history":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"family_relative_id":{"changeType":"created","description":"Unique identifier of the relative, assigned by the data provider.","name":"family_relative_id","valueType":"string","meta":{"displayName":"Family Relative ID","primaryId":true,"notes":"This field is required to ensure that family members are identified in unique records. Ids can be as simple as an incremented numeral to ensure uniqueness."},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"relative_with_cancer_history":{"changeType":"created","description":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","name":"relative_with_cancer_history","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Relative with Cancer History"}},"relationship_type":{"changeType":"created","description":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","name":"relationship_type","restrictions":{"codeList":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"]},"valueType":"string","meta":{"displayName":"Relationship Type"}},"gender_of_relative":{"changeType":"created","description":"The self-reported gender of related individual.","name":"gender_of_relative","restrictions":{"codeList":["Female","Male","Other","Unknown"]},"valueType":"string","meta":{"displayName":"Gender of Relative"}},"age_of_relative_at_diagnosis":{"changeType":"created","description":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","name":"age_of_relative_at_diagnosis","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","displayName":"Age Of Relative At Diagnosis"}},"cancer_type_code_of_relative":{"changeType":"created","name":"cancer_type_code_of_relative","valueType":"string","description":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"examples":"C41.1,C16.9,C00.5,D46.9","dependsOn":"family_history.relative_with_cancer_history","displayName":"Cancer Type Code (ICD-10) of Relative"}},"relative_vital_status":{"changeType":"created","description":"Relative's last known state of living or deceased.","name":"relative_vital_status","restrictions":{"codeList":["Alive","Deceased","Unknown"]},"valueType":"string","meta":{"displayName":"Vital Status of Relative"}},"cause_of_death_of_relative":{"changeType":"created","description":"Indicate the cause of the death of the relative.","name":"cause_of_death_of_relative","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]},"valueType":"string","meta":{"dependsOn":"family_history.relative_vital_status","displayName":"Cause of Death of Relative"}},"relative_survival_time":{"changeType":"created","description":"Indicate how long, in days, the relative survived from the time they were diagnosed with cancer.","name":"relative_survival_time","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","units":"days","displayName":"Survival Time Of Relative"}}},"deleted":{}},"biomarker":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"created","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"created","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"created","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"created","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"created","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"created","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"created","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"created","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"created","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"created","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"created","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"created","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"created","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"created","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"created","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"created","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"created","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"created","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"created","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}},"deleted":{}},"comorbidity":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"created","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"created","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"created","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"created","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"created","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"created","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}},"deleted":{}}}} diff --git a/website/static/data/schemas/diffs/0.14/0.14-diff-1.24.json b/website/static/data/schemas/diffs/0.14/0.14-diff-1.24.json new file mode 100644 index 00000000..77e70f20 --- /dev/null +++ b/website/static/data/schemas/diffs/0.14/0.14-diff-1.24.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"program_id":{"meta":{"examples":{"left":"PACA-AU,BR-CA","right":"TEST-CA"},"notes":{"left":"This is the unique id that is assigned to your program. If you have logged into the platform, this is the Program Id that you see in the Submission area. For example, PACA-CA is a Program ID.","right":"This is the unique id that is assigned to your program. If you have logged into the platform, this is the Program Id that you see in the Program Services area. For example, TEST-CA is a Program ID."}}},"submitter_donor_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"],"deleted":[]}},"script":{"left":["(function validate() {\r\n\r\n const row = $row;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n const designation = row.tumour_normal_designation.trim().toLowerCase();\r\n const specimen_type = $field.trim().toLowerCase();\r\n \r\n if (designation === \"normal\"){\r\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\r\n if (!validTypes.includes(specimen_type)){\r\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when tumour_normal_designation is set to Normal.\"};\r\n }\r\n }\r\n else if (designation === \"tumour\") {\r\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\r\n if (invalidTypes.includes(specimen_type)){\r\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when tumour_normal_designation is set to Tumour.\"};\r\n }\r\n }\r\n return result;\r\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"]}}},"submitter_sample_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased","Unknown"],"right":["Alive","Deceased"],"data":{"added":[],"deleted":["Unknown"]}}}},"cause_of_death":{"restrictions":{"script":{"left":["(function validate() {\r\n let result = {valid: true, message: \"Ok\"};\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n const vitalStatus = $row.vital_status.trim().toLowerCase();\r\n \r\n if (!currField && vitalStatus === \"deceased\"){\r\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\r\n }\r\n else if (currField && vitalStatus != \"deceased\"){\r\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\r\n }\r\n return result;\r\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]}}},"survival_time":{"restrictions":{"script":{"left":["(function validate() {\r\n let result = {valid: true, message: \"Ok\"};\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n const vitalStatus = $row.vital_status.trim().toLowerCase();\r\n \r\n if (!currField && vitalStatus === \"deceased\"){\r\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\r\n }\r\n else if (currField && vitalStatus != \"deceased\"){\r\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\r\n }\r\n return result;\r\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"primary_site":{"meta":{"notes":{"left":null,"right":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"examples":{"left":null,"right":"Breast|Ovary"}},"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Not Reported","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva","Unknown"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"data":{"added":["Unknown primary site"],"deleted":["Not Reported","Unknown"]}}}},"height":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"weight":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"bmi":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"menopause_status":{"description":{"left":"Indicate the donor's menopause status at the time of primary diagnosis. (Codelist reference: NCI CDE ID: 2434914)","right":"Indicate the donor's menopause status at the time of primary diagnosis. (Reference: caDSR CDE ID 2434914)"},"restrictions":{"codeList":{"left":["Indeterminate or unknown","Not applicable","Perimenopausal","Postmenopausal","Premenopausal"],"right":["Not applicable","Perimenopausal","Postmenopausal","Premenopausal","Unknown"],"data":{"added":["Unknown"],"deleted":["Indeterminate or unknown"]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age of menarche, the first occurrence of menstruation.","right":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)"},"restrictions":{}},"number_of_pregnancies":{"description":{"left":"Indicate the number of pregnancies a donor has had.","right":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)"},"restrictions":{}},"number_of_children":{"description":{"left":"Indicate the number of children the donor has birthed.","right":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)"},"restrictions":{}}},"created":{"genetic_disorders":{"changeType":"created","description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},"hrt_type":{"changeType":"created","description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},"hrt_duration":{"changeType":"created","description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},"contraception_type":{"changeType":"created","description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},"contraception_duration":{"changeType":"created","description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},"lost_to_followup_after_clinical_event_id":{"changeType":"created","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}},"deleted":{"prior_malignancy":{"changeType":"deleted","description":"Prior malignancy affecting donor.","name":"prior_malignancy","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy","examples":"C41.1, C16.9, C00.5, D46.9"}},"cancer_type_prior_malignancy":{"changeType":"deleted","description":"The code to represent the cancer type of a prior malignancy using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","name":"cancer_type_prior_malignancy","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"valueType":"string","meta":{"displayName":"Cancer Type Prior Malignancy"}},"age_at_prior_malignancy":{"changeType":"deleted","description":"If donor has history of prior malignancy, indicate age at previous diagnosis, in years.","name":"age_at_prior_malignancy","valueType":"integer","meta":{"displayName":"Age at Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"deleted","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Codelist reference: NCI CDE: 4122391)","name":"laterality_of_prior_malignancy","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality at Prior Malignancy"}}}},"specimen":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"description":{"left":"Indicate the primary diagnosis event in the clinical timeline that this specimen aquisition was related to.","right":"Indicate the primary diagnosis event in the clinical timeline that this specimen acquisition was related to."},"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"pathological_tumour_staging_system":{"meta":{"validationDependency":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n /* This is not a required field, so first ensure that it exists */\r\n if ($field) {\r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"pathological_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"pathological_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"pathological_stage_group":{"description":{"left":"Specify the tumour stage, based on tumour_staging_system, used to assess the cancer at the time the tumour specimen was resected.","right":"Specify the tumour stage, based on pathological_tumour_staging_system, used to assess the cancer at the time the tumour specimen was resected."},"meta":{"notes":{"left":"This field depends on the selected pathological staging system, and is only required if the specimen is a tumour.","right":"This field depends on the selected pathological_tumour_staging_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications"}},"restrictions":{"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.pathological_tumour_staging_system && $field) {\r\n let codeList = [];\r\n switch ($row.pathological_tumour_staging_system && $row.pathological_tumour_staging_system.trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb',\r\n 'stage ive',\r\n 'stage ivs'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When 'pathological_tumour_staging_system' is set to '${\r\n $row.pathological_tumour_staging_system\r\n }', 'pathological_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"specimen_acquisition_interval":{"meta":{"notes":{"left":"The associated Primary Diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."},"displayName":{"left":"Specimen Aquisition Interval","right":"Specimen Acquisition Interval"}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"specimen_storage":{"description":{"left":"Indicate the method of specimen storage for specimens that were not extracted freshly or immediately cultured.","right":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured."},"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"reference_pathology_confirmed":{"description":{"left":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. This only applies to clinical studies.","right":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)"}},"tumour_grading_system":{"meta":{"validationDependency":{"left":null,"right":true}}},"tumour_grade":{"meta":{"notes":{"left":"This field depends on the selected tumour grading system, and is only required if the specimen is a tumour.","right":"This field depends on the selected tumour_grading_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Grading Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-grading-classifications"}},"restrictions":{"script":{"left":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.tumour_grading_system && $field) {\r\n let codeList = [];\r\n const tieredGradingList = ['gx','g1','g2','g3'];\r\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\r\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\r\n case 'two-tier grading system':\r\n codeList = [\r\n 'low grade',\r\n 'high grade',\r\n ];\r\n break;\r\n case 'three-tier grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'four-tier grading system':\r\n codeList = [\r\n 'gx',\r\n 'g1',\r\n 'g2',\r\n 'g3',\r\n 'g4',\r\n ];\r\n break;\r\n case 'grading system for gists':\r\n codeList = [\r\n 'low',\r\n 'high',\r\n ];\r\n break;\r\n case 'grading system for gnets':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'isup grading system':\r\n codeList = [\r\n 'gx',\r\n 'g1',\r\n 'g2',\r\n 'g3',\r\n 'g4',\r\n ];\r\n break;\r\n case 'who grading system for cns tumours':\r\n codeList = [\r\n 'grade i',\r\n 'grade ii',\r\n 'grade iii',\r\n 'grade iv',\r\n ];\r\n break;\r\n case 'fnclcc grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'gleason grade group system':\r\n codeList = [\r\n 'grade group 1',\r\n 'grade group 2',\r\n 'grade group 3',\r\n 'grade group 4',\r\n 'grade group 5',\r\n ];\r\n break;\r\n case 'scarff-bloom-richardson grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'nuclear grading system for dcis':\r\n codeList = tieredGradingList;\r\n break;\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase())) {\r\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\r\n $row.tumour_grading_system\r\n }', 'tumour_grade' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\r\n result.valid = false;\r\n const msg = \"'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.\";\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"percent_tumour_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of infiltration by tumour cells in a specimen.","right":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)"},"restrictions":{}},"percent_proliferating_cells":{"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_inflammatory_tissue":{"description":{"left":"Indicate a value, in decimals, that represents local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue.","right":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_stromal_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a malignant tumour specimen but are not malignant such as fibroblasts, vascular structures, etc.","right":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_necrosis":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of cell death in a malignant tumour specimen.","right":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}}},"created":{"specimen_laterality":{"changeType":"created","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"percent_tumour_cells_measurement_method":{"changeType":"created","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}},"deleted":{}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"age_at_diagnosis":{"description":{"left":"Age that the donor was first diagnosed with cancer, in years.","right":"Age that the donor was first diagnosed with cancer, in years. This should be based on the earliest diagnosis of cancer."},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0,"max":90}}}},"number_lymph_nodes_positive":{"description":{"left":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: NCI CDE ID: 6113694)","right":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: caDSR CDE ID 6113694)"},"meta":{"dependsOn":{"left":null,"right":"primary_diagnosis.lymph_nodes_examined_status"},"notes":{"left":null,"right":"This field is only required if 'lymph_nodes_examined_status' is 'Yes'."}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"]},"range":{"left":null,"right":{"min":0}}}},"number_lymph_nodes_examined":{"description":{"left":"The total number of lymph nodes tested for the presence of cancer. (Reference: NCI CDE ID: 3)","right":"The total number of lymph nodes tested for the presence of cancer. (Reference: caDSR CDE ID 3)"},"meta":{"dependsOn":{"left":null,"right":"primary_diagnosis.lymph_nodes_examined_status"},"notes":{"left":null,"right":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'."}},"restrictions":{}},"clinical_tumour_staging_system":{"meta":{"validationDependency":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n /* This is not a required field, so first ensure that it exists */\r\n if ($field) {\r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"required":{"left":true,"right":null},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"clinical_stage_group":{"description":{"left":"Stage group of the tumour, as assigned by the reporting tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.).","right":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage."},"meta":{"notes":{"left":"This field is dependent on the selected clinical_tumour_staging_system","right":"This field is dependent on the selected clinical_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications"},"examples":{"left":null,"right":"Stage I, Stage IIB"}},"restrictions":{"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.clinical_tumour_staging_system && $field) {\r\n let codeList = [];\r\n switch ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system.trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb',\r\n 'stage ive',\r\n 'stage ivs'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When 'clinical_tumour_staging_system' is set to '${\r\n $row.clinical_tumour_staging_system\r\n }', 'clinical_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"clinical_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"clinical_n_category":{"description":{"left":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"clinical_m_category":{"description":{"left":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned.","right":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned."},"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"presenting_symptoms":{"restrictions":{"codeList":{"left":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Nausea","None","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Unknown","Vomiting","Weight Loss"],"right":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Loss of Appetite","Nausea","None","Not Reported","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Swelling in the Neck","Unknown","Vomiting","Weight Loss"],"data":{"added":["Loss of Appetite","Not Reported","Swelling in the Neck"],"deleted":[]}}}},"performance_status":{"description":{"left":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference source: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status).","right":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status)."},"meta":{"notes":{"left":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction \n Grade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work) \n Grade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours \n Grade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours \n Grade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair","right":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction.\nGrade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work).\nGrade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours.\nGrade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours.\nGrade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair"}},"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}}},"created":{"cancer_type_additional_information":{"changeType":"created","name":"cancer_type_additional_information","valueType":"string","description":"Additional details related to the cancer type that are not covered by the ICD-10 code provided in the cancer_type field.","meta":{"displayName":"Cancer Type Additional Information"}},"laterality":{"changeType":"created","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_status":{"changeType":"created","name":"lymph_nodes_examined_status","description":"Indicate if lymph nodes were examined for metastases.","valueType":"string","restrictions":{"required":true,"codeList":["Cannot be determined","No","No lymph nodes found in resected specimen","Not applicable","Yes"]},"meta":{"core":true,"displayName":"Lymph Nodes Examined Status"}},"lymph_nodes_examined_method":{"changeType":"created","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}},"deleted":{}},"treatment":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"treatment_type":{"meta":{"notes":{"left":"Depending on the treatment_type selected, additional treatment details may be required to be submitted. For example, if treatment_type includes 'Chemotherapy', the supplemental Chemotherapy treatment type file is required.","right":"Depending on the treatment_type(s) selected, additional treatment details may be required to be submitted. For example, if treatment_type includes 'Chemotherapy', the supplemental Chemotherapy treatment type file is required.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."},"examples":{"left":null,"right":"Chemotherapy|Hormonal therapy"}},"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Combined chemotherapy and immunotherapy","Combined chemotherapy and radiation therapy","Combined chemotherapy, radiation therapy and surgery","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":["End of life care"],"deleted":["Combined chemotherapy and immunotherapy","Combined chemotherapy and radiation therapy","Combined chemotherapy, radiation therapy and surgery"]}}}},"is_primary_treatment":{"description":{"left":"Indicate if the treamtment was the primary treatment following the initial diagnosis.","right":"Indicate if the treatment was the primary treatment following the initial diagnosis."},"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Yes","No","Unknown"],"right":["Yes","No"],"data":{"added":[],"deleted":["Unknown"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"line_of_treatment":{"meta":{"dependsOn":{"left":null,"right":"treatment.is_primary_treatment"}},"restrictions":{}},"treatment_start_interval":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_duration":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"days_per_cycle":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{}},"number_of_cycles":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{}},"toxicity_type":{"description":{"left":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hemotological toxicity or non-hemotological toxicity.","right":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity."},"meta":{"dependsOn":{"left":null,"right":"treatment.outcome_of_treatment"}},"restrictions":{"codeList":{"left":["Hemotological","Non-hemotological"],"right":["Hematological","Non-hematological","Not applicable","Unknown"],"data":{"added":["Hematological","Non-hematological","Not applicable","Unknown"],"deleted":["Hemotological","Non-hemotological"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"]}}},"adverse_events":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"},"notes":{"left":null,"right":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"restrictions":{"codeList":{"left":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"right":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"data":{"added":["None","Unknown"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"clinical_trials_database":{"meta":{"notes":{"left":null,"right":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added."}},"restrictions":{"codeList":{"left":["NCI Clinical Trials","EU Clinical Trials Register"],"right":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"],"data":{"added":["Not applicable","Unknown"],"deleted":[]}}}},"clinical_trial_number":{"restrictions":{"script":{"left":["(function validate() {\r\n let result = {valid: true, message: \"Ok\"};\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n //regex check for clinical trial number\r\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\r\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\r\n\r\n // list of valid clinical trial databases\r\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\r\n \r\n if ($row.clinical_trials_database && $field) {\r\n const trialNumber = $field.trim();\r\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\r\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\r\n result = {valid: false, message: 'The submitted NCI clinical trial number is in incorrect format.'};\r\n }\r\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\r\n result = {valid: false, message: \"The submitted EudraCT clinical trial number is in incorrect format.\"};\r\n }\r\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\r\n result = {valid: false, message: \"The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database.\"};\r\n }\r\n }\r\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\r\n result = {valid: true, message: \"Ok\"};\r\n }\r\n else if ($row.clinical_trials_database && !$field) {\r\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\r\n result = {valid: false, message: \"'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.\"};\r\n } \r\n }\r\n return result;\r\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"]}}}},"created":{"treatment_intent":{"changeType":"created","name":"treatment_intent","description":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"]},"meta":{"core":true,"displayName":"Treatment Intent","dependsOn":"treatment.treatment_type"}},"treatment_setting":{"changeType":"created","name":"treatment_setting","description":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: NCIt C124308)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"]},"meta":{"core":true,"displayName":"Treatment Setting","dependsOn":"treatment.treatment_type"}},"response_to_treatment_criteria_method":{"changeType":"created","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},"response_to_treatment":{"changeType":"created","name":"response_to_treatment","description":"The donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"codeList":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"]},"meta":{"core":true,"displayName":"Response To Treatment","dependsOn":"treatment.response_to_treatment_criteria_method","notes":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"outcome_of_treatment":{"changeType":"created","name":"outcome_of_treatment","description":"Indicate the donor's outcome of the prescribed treatment.","valueType":"string","restrictions":{"codeList":["Treatment completed as prescribed","Treatment incomplete due to technical or organizational problems","Treatment incomplete because patient died","Patient choice (stopped or interrupted treatment)","Physician decision (stopped or interrupted treatment)","Treatment stopped due to lack of efficacy (disease progression)","Treatment stopped due to acute toxicity","Other","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Outcome Of Treatment","dependsOn":"treatment.treatment_type"}},"hematological_toxicity":{"changeType":"created","name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"non-hematological_toxicity":{"changeType":"created","name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"age_at_consent_for_treatment":{"changeType":"deleted","name":"age_at_consent_for_treatment","description":"Indicate the age of donor when consent was given for treatment.","valueType":"integer","meta":{"displayName":"Age At Consent For Treatment"}},"therapeutic_intent":{"changeType":"deleted","name":"therapeutic_intent","description":"The therapeutic intent, the reason behind the choice of a therapy, of the treatment.","valueType":"string","restrictions":{"required":true,"codeList":["Adjuvant","Concurrent","Curative","Neoadjuvant","Not applicable","Palliative","Unknown"]},"meta":{"core":true,"displayName":"Therapeutic Intent"}},"response_to_therapy":{"changeType":"deleted","name":"response_to_therapy","description":"The donors's response to the applied treatment regimen. (Source: RECIST)","valueType":"string","restrictions":{"required":true,"codeList":["Complete response","Disease progression","NED","Partial response","Stable disease"]},"meta":{"core":true,"displayName":"Response To Therapy"}},"outcome_of_therapy":{"changeType":"deleted","name":"outcome_of_therapy","description":"Indicate the donor's outcome of the prescribed treatment.","valueType":"string","restrictions":{"codeList":["Treatment completed as prescribed","Treatment incomplete due to technical or organizational problems","Treatment incomplete because patient died","Patient choice (stopped or interrupted treatment)","Physician decision (stopped or interrupted treatment)","Treatment stopped due to lack of efficacy (disease progression)","Treatment stopped due to acute toxicity","Other","Not applicable","Unknown"]},"meta":{"displayName":"Outcome Of Therapy"}},"hemotological_toxicity":{"changeType":"deleted","name":"hemotological_toxicity","description":"Indicate the hemotological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5"]},"meta":{"displayName":"Hemotological Toxicity"}}}},"chemotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"description":{"left":"Name of agent or drug administered to patient as part of the treatment regimen.","right":"Name of agent or drug administered to donor as part of the treatment regimen."},"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"created","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"created","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"created","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"created","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}},"deleted":{"chemotherapy_dosage_units":{"changeType":"deleted","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate the total drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"description":{"left":"Name of agent or drug administered to patient as part of the treatment regimen.","right":"Name of agent or drug administered to donor as part of the treatment regimen."},"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"created","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{"hormone_drug_dosage_units":{"changeType":"deleted","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"radiation":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"radiation_therapy_fractions":{"description":{"left":"Indicate the number of total fractions delivered as part of treatment.","right":"Indicate the total number of fractions delivered as part of treatment."},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"radiation_therapy_dosage":{"valueType":{"left":"integer","right":"number"},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"anatomical_site_irradiated":{"description":{"left":"Indicate localization site where radiation therapy was administered.","right":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)"},"restrictions":{"codeList":{"left":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"right":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"data":{"added":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"],"deleted":["Bone","Extremities","Head-Neck","Peritoneum"]}}}}},"created":{"radiation_therapy_type":{"changeType":"created","name":"radiation_therapy_type","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal"]},"meta":{"core":true,"displayName":"Type of Radiation Therapy","notes":"Internal application includes Brachytherapy."}},"radiation_boost":{"changeType":"created","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"created","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}},"deleted":{"radiation_treatment_type":{"changeType":"deleted","name":"radiation_treatment_type","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal"]},"meta":{"core":true,"displayName":"Application Form","notes":"Internal application includes Brachytherapy."}}}},"follow_up":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_follow_up_id":{"description":{"left":"Unique identifier for a follow-up event in a donors clincal record, assigned by the data provider.","right":"Unique identifier for a follow-up event in a donor's clinical record, assigned by the data provider."},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"interval_of_followup":{"meta":{"notes":{"left":"The associated Primary Diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}}},"disease_status_at_followup":{"description":{"left":"Indicate the donor's disease status at time of follow-up.","right":"Indicate the donor's disease status at time of follow-up. (Reference: RECIST)"},"restrictions":{"codeList":{"left":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Relapse or recurrence","Stable"],"right":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Progression NOS","Relapse or recurrence","Stable"],"data":{"added":["Progression NOS"],"deleted":[]}}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"treatment.submitter_treatment_id"}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"weight_at_followup":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"relapse_type":{"restrictions":{"script":{"left":["(function validate() {\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"relapse_interval":{"restrictions":{"script":{"left":["(function validate() {\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"]}}},"method_of_progression_status":{"description":{"left":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Codelist reference: NCI CDE ID: 6161031)","right":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Reference: caDSR CDE ID 6161031)"},"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}},"restrictions":{"script":{"left":["(function validate() {\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}},"script":{"left":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n /* This is not a required field, so first ensure that it exists */\r\n if ($field) {\r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })()","(function validate() {\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_t_category":{"description":{"left":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"recurrence_n_category":{"description":{"left":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":true,"right":null}}},"recurrence_m_category":{"description":{"left":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"recurrence_stage_group":{"description":{"left":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery.","right":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) at the time of retreatment for a recurrence or disease progression."},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is dependent on the selected recurrence_tumour_staging_system.","right":"This field is dependent on the selected recurrence_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications"}},"restrictions":{"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.recurrence_tumour_staging_system && $field) {\r\n let codeList = [];\r\n switch ($row.recurrence_tumour_staging_system && $row.recurrence_tumour_staging_system.trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb',\r\n 'stage ive',\r\n 'stage ivs'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When 'recurrence_tumour_staging_system' is set to '${\r\n $row.recurrence_tumour_staging_system\r\n }', 'recurrence_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"posttherapy_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n /* This is not a required field, so first ensure that it exists */\r\n if ($field) {\r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"posttherapy_t_category":{"meta":{"dependsOn":{"left":"follow_up.post_therapy_tumour_staging_system","right":"follow_up.posttherapy_tumour_staging_system"}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"posttherapy_n_category":{"description":{"left":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"dependsOn":{"left":"follow_up.post_therapy_tumour_staging_system","right":"follow_up.posttherapy_tumour_staging_system"}}},"posttherapy_m_category":{"description":{"left":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"dependsOn":{"left":"follow_up.post_therapy_tumour_staging_system","right":"follow_up.posttherapy_tumour_staging_system"}},"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"posttherapy_stage_group":{"meta":{"dependsOn":{"left":"follow_up.post_therapy_tumour_staging_system","right":"follow_up.posttherapy_tumour_staging_system"},"notes":{"left":"This field is dependent on the selected posttherapy_tumour_staging_system.","right":"This field is dependent on the selected posttherapy_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications"}},"restrictions":{"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.posttherapy_tumour_staging_system && $field) {\r\n let codeList = [];\r\n switch ($row.posttherapy_tumour_staging_system && $row.posttherapy_tumour_staging_system.trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb',\r\n 'stage ive',\r\n 'stage ivs'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When 'posttherapy_tumour_staging_system' is set to '${\r\n $row.posttherapy_tumour_staging_system\r\n }', 'posttherapy_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}}},"created":{"anatomic_site_progression_or_recurrence":{"changeType":"created","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"anatomic_site_progression_or_recurrences":{"changeType":"deleted","description":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate() {\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })()"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1,C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}}}},"immunotherapy":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"immunotherapy_type":{"changeType":"created","name":"immunotherapy_type","valueType":"string","description":"Indicate the type of immunotherapy administered to donor.","meta":{"displayName":"Immunotherapy Type","core":true},"restrictions":{"required":true,"codeList":["Cell-based","Immune checkpoint inhibitors","Monoclonal antibodies other than immune checkpoint inhibitors","Other immunomodulatory substances"]}},"drug_rxnormcui":{"changeType":"created","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"created","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"created","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{}},"surgery":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"created","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"created","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"created","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"created","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"created","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"created","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"created","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"created","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"created","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"created","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"created","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"created","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"created","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"created","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}},"deleted":{}},"exposure":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"created","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"created","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"created","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"created","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"created","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"created","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"created","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"created","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"created","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"created","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"created","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"created","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"created","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}},"deleted":{}},"family_history":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"family_relative_id":{"changeType":"created","description":"Unique identifier of the relative, assigned by the data provider.","name":"family_relative_id","valueType":"string","meta":{"displayName":"Family Relative ID","primaryId":true,"notes":"This field is required to ensure that family members are identified in unique records. Ids can be as simple as an incremented numeral to ensure uniqueness."},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"relative_with_cancer_history":{"changeType":"created","description":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","name":"relative_with_cancer_history","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Relative with Cancer History"}},"relationship_type":{"changeType":"created","description":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","name":"relationship_type","restrictions":{"codeList":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"]},"valueType":"string","meta":{"displayName":"Relationship Type"}},"gender_of_relative":{"changeType":"created","description":"The self-reported gender of related individual.","name":"gender_of_relative","restrictions":{"codeList":["Female","Male","Other","Unknown"]},"valueType":"string","meta":{"displayName":"Gender of Relative"}},"age_of_relative_at_diagnosis":{"changeType":"created","description":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","name":"age_of_relative_at_diagnosis","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","displayName":"Age Of Relative At Diagnosis"}},"cancer_type_code_of_relative":{"changeType":"created","name":"cancer_type_code_of_relative","valueType":"string","description":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"examples":"C41.1,C16.9,C00.5,D46.9","dependsOn":"family_history.relative_with_cancer_history","displayName":"Cancer Type Code (ICD-10) of Relative"}},"relative_vital_status":{"changeType":"created","description":"Relative's last known state of living or deceased.","name":"relative_vital_status","restrictions":{"codeList":["Alive","Deceased","Unknown"]},"valueType":"string","meta":{"displayName":"Vital Status of Relative"}},"cause_of_death_of_relative":{"changeType":"created","description":"Indicate the cause of the death of the relative.","name":"cause_of_death_of_relative","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]},"valueType":"string","meta":{"dependsOn":"family_history.relative_vital_status","displayName":"Cause of Death of Relative"}},"relative_survival_time":{"changeType":"created","description":"Indicate how long, in days, the relative survived from the time they were diagnosed with cancer.","name":"relative_survival_time","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","units":"days","displayName":"Survival Time Of Relative"}}},"deleted":{}},"biomarker":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"created","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"created","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"created","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"created","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"created","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"created","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"created","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"created","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"created","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"created","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"created","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"created","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"created","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"created","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"created","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"created","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"created","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"created","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"created","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}},"deleted":{}},"comorbidity":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"created","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"created","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"created","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"created","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"created","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"created","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}},"deleted":{}}}} diff --git a/website/static/data/schemas/diffs/0.15/0.15-diff-1.24.json b/website/static/data/schemas/diffs/0.15/0.15-diff-1.24.json new file mode 100644 index 00000000..babd29ba --- /dev/null +++ b/website/static/data/schemas/diffs/0.15/0.15-diff-1.24.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"program_id":{"meta":{"examples":{"left":"PACA-AU,BR-CA","right":"TEST-CA"},"notes":{"left":"This is the unique id that is assigned to your program. If you have logged into the platform, this is the Program Id that you see in the Submission area. For example, PACA-CA is a Program ID.","right":"This is the unique id that is assigned to your program. If you have logged into the platform, this is the Program Id that you see in the Program Services area. For example, TEST-CA is a Program ID."}}},"submitter_donor_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"],"deleted":[]}},"script":{"left":["(function validate() {\n\n const row = $row;\n let result = {valid: true, message: \"Ok\"};\n \n const designation = row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\"){\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when tumour_normal_designation is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when tumour_normal_designation is set to Tumour.\"};\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"]}}},"submitter_sample_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased","Unknown"],"right":["Alive","Deceased"],"data":{"added":[],"deleted":["Unknown"]}}}},"cause_of_death":{"restrictions":{"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]}}},"survival_time":{"restrictions":{"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"primary_site":{"meta":{"notes":{"left":null,"right":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"examples":{"left":null,"right":"Breast|Ovary"}},"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Not Reported","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva","Unknown"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"data":{"added":["Unknown primary site"],"deleted":["Not Reported","Unknown"]}}}},"height":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"weight":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"bmi":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"menopause_status":{"description":{"left":"Indicate the donor's menopause status at the time of primary diagnosis. (Codelist reference: NCI CDE ID: 2434914)","right":"Indicate the donor's menopause status at the time of primary diagnosis. (Reference: caDSR CDE ID 2434914)"},"restrictions":{"codeList":{"left":["Indeterminate or unknown","Not applicable","Perimenopausal","Postmenopausal","Premenopausal"],"right":["Not applicable","Perimenopausal","Postmenopausal","Premenopausal","Unknown"],"data":{"added":["Unknown"],"deleted":["Indeterminate or unknown"]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age of menarche, the first occurrence of menstruation.","right":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)"},"restrictions":{}},"number_of_pregnancies":{"description":{"left":"Indicate the number of pregnancies a donor has had.","right":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)"},"restrictions":{}},"number_of_children":{"description":{"left":"Indicate the number of children the donor has birthed.","right":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)"},"restrictions":{}}},"created":{"genetic_disorders":{"changeType":"created","description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},"hrt_type":{"changeType":"created","description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},"hrt_duration":{"changeType":"created","description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},"contraception_type":{"changeType":"created","description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},"contraception_duration":{"changeType":"created","description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},"lost_to_followup_after_clinical_event_id":{"changeType":"created","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}},"deleted":{"prior_malignancy":{"changeType":"deleted","description":"Prior malignancy affecting donor.","name":"prior_malignancy","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy","examples":"C41.1, C16.9, C00.5, D46.9"}},"cancer_type_prior_malignancy":{"changeType":"deleted","description":"The code to represent the cancer type of a prior malignancy using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","name":"cancer_type_prior_malignancy","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"valueType":"string","meta":{"displayName":"Cancer Type Prior Malignancy"}},"age_at_prior_malignancy":{"changeType":"deleted","description":"If donor has history of prior malignancy, indicate age at previous diagnosis, in years.","name":"age_at_prior_malignancy","valueType":"integer","meta":{"displayName":"Age at Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"deleted","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Codelist reference: NCI CDE: 4122391)","name":"laterality_of_prior_malignancy","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality at Prior Malignancy"}}}},"specimen":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"description":{"left":"Indicate the primary diagnosis event in the clinical timeline that this specimen aquisition was related to.","right":"Indicate the primary diagnosis event in the clinical timeline that this specimen acquisition was related to."},"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"pathological_tumour_staging_system":{"meta":{"validationDependency":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"pathological_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"pathological_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"pathological_stage_group":{"description":{"left":"Specify the tumour stage, based on tumour_staging_system, used to assess the cancer at the time the tumour specimen was resected.","right":"Specify the tumour stage, based on pathological_tumour_staging_system, used to assess the cancer at the time the tumour specimen was resected."},"meta":{"notes":{"left":"This field depends on the selected pathological staging system, and is only required if the specimen is a tumour.","right":"This field depends on the selected pathological_tumour_staging_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications"}},"restrictions":{"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n if ($row.pathological_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.pathological_tumour_staging_system && $row.pathological_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'pathological_tumour_staging_system' is set to '${\n $row.pathological_tumour_staging_system\n }', 'pathological_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"specimen_acquisition_interval":{"meta":{"notes":{"left":"The associated Primary Diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."},"displayName":{"left":"Specimen Aquisition Interval","right":"Specimen Acquisition Interval"}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"specimen_storage":{"description":{"left":"Indicate the method of specimen storage for specimens that were not extracted freshly or immediately cultured.","right":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured."},"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"reference_pathology_confirmed":{"description":{"left":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. This only applies to clinical studies.","right":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)"}},"tumour_grading_system":{"meta":{"validationDependency":{"left":null,"right":true}}},"tumour_grade":{"meta":{"notes":{"left":"This field depends on the selected tumour grading system, and is only required if the specimen is a tumour.","right":"This field depends on the selected tumour_grading_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Grading Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-grading-classifications"}},"restrictions":{"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = \"'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.\";\n result.message = msg;\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"percent_tumour_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of infiltration by tumour cells in a specimen.","right":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)"},"restrictions":{}},"percent_proliferating_cells":{"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_inflammatory_tissue":{"description":{"left":"Indicate a value, in decimals, that represents local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue.","right":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_stromal_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a malignant tumour specimen but are not malignant such as fibroblasts, vascular structures, etc.","right":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_necrosis":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of cell death in a malignant tumour specimen.","right":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}}},"created":{"specimen_laterality":{"changeType":"created","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"percent_tumour_cells_measurement_method":{"changeType":"created","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}},"deleted":{}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"age_at_diagnosis":{"description":{"left":"Age that the donor was first diagnosed with cancer, in years.","right":"Age that the donor was first diagnosed with cancer, in years. This should be based on the earliest diagnosis of cancer."},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0,"max":90}}}},"number_lymph_nodes_positive":{"description":{"left":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: NCI CDE ID: 6113694)","right":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: caDSR CDE ID 6113694)"},"meta":{"dependsOn":{"left":null,"right":"primary_diagnosis.lymph_nodes_examined_status"},"notes":{"left":null,"right":"This field is only required if 'lymph_nodes_examined_status' is 'Yes'."}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"]},"range":{"left":null,"right":{"min":0}}}},"number_lymph_nodes_examined":{"description":{"left":"The total number of lymph nodes tested for the presence of cancer. (Reference: NCI CDE ID: 3)","right":"The total number of lymph nodes tested for the presence of cancer. (Reference: caDSR CDE ID 3)"},"meta":{"dependsOn":{"left":null,"right":"primary_diagnosis.lymph_nodes_examined_status"},"notes":{"left":null,"right":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'."}},"restrictions":{}},"clinical_tumour_staging_system":{"meta":{"validationDependency":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"required":{"left":true,"right":null},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"clinical_stage_group":{"description":{"left":"Stage group of the tumour, as assigned by the reporting tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.).","right":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage."},"meta":{"notes":{"left":"This field is dependent on the selected clinical_tumour_staging_system","right":"This field is dependent on the selected clinical_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications"},"examples":{"left":null,"right":"Stage I, Stage IIB"}},"restrictions":{"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n if ($row.clinical_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'clinical_tumour_staging_system' is set to '${\n $row.clinical_tumour_staging_system\n }', 'clinical_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"clinical_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"clinical_n_category":{"description":{"left":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"clinical_m_category":{"description":{"left":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned.","right":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned."},"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"presenting_symptoms":{"restrictions":{"codeList":{"left":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Nausea","None","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Unknown","Vomiting","Weight Loss"],"right":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Loss of Appetite","Nausea","None","Not Reported","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Swelling in the Neck","Unknown","Vomiting","Weight Loss"],"data":{"added":["Loss of Appetite","Not Reported","Swelling in the Neck"],"deleted":[]}}}},"performance_status":{"description":{"left":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference source: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status).","right":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status)."},"meta":{"notes":{"left":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction \n Grade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work) \n Grade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours \n Grade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours \n Grade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair","right":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction.\nGrade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work).\nGrade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours.\nGrade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours.\nGrade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair"}},"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}}},"created":{"cancer_type_additional_information":{"changeType":"created","name":"cancer_type_additional_information","valueType":"string","description":"Additional details related to the cancer type that are not covered by the ICD-10 code provided in the cancer_type field.","meta":{"displayName":"Cancer Type Additional Information"}},"laterality":{"changeType":"created","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_status":{"changeType":"created","name":"lymph_nodes_examined_status","description":"Indicate if lymph nodes were examined for metastases.","valueType":"string","restrictions":{"required":true,"codeList":["Cannot be determined","No","No lymph nodes found in resected specimen","Not applicable","Yes"]},"meta":{"core":true,"displayName":"Lymph Nodes Examined Status"}},"lymph_nodes_examined_method":{"changeType":"created","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}},"deleted":{}},"treatment":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"treatment_type":{"meta":{"notes":{"left":"Depending on the treatment_type(s) selected, additional treatment details may be required to be submitted. For example, if treatment_type includes 'Chemotherapy', the supplemental Chemotherapy treatment type file is required.","right":"Depending on the treatment_type(s) selected, additional treatment details may be required to be submitted. For example, if treatment_type includes 'Chemotherapy', the supplemental Chemotherapy treatment type file is required.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."},"examples":{"left":null,"right":"Chemotherapy|Hormonal therapy"}},"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":["End of life care"],"deleted":[]}}}},"is_primary_treatment":{"description":{"left":"Indicate if the treamtment was the primary treatment following the initial diagnosis.","right":"Indicate if the treatment was the primary treatment following the initial diagnosis."},"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Yes","No","Unknown"],"right":["Yes","No"],"data":{"added":[],"deleted":["Unknown"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"line_of_treatment":{"meta":{"dependsOn":{"left":null,"right":"treatment.is_primary_treatment"}},"restrictions":{}},"treatment_start_interval":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_duration":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"days_per_cycle":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{}},"number_of_cycles":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{}},"toxicity_type":{"description":{"left":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hemotological toxicity or non-hemotological toxicity.","right":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity."},"meta":{"dependsOn":{"left":null,"right":"treatment.outcome_of_treatment"}},"restrictions":{"codeList":{"left":["Hemotological","Non-hemotological"],"right":["Hematological","Non-hematological","Not applicable","Unknown"],"data":{"added":["Hematological","Non-hematological","Not applicable","Unknown"],"deleted":["Hemotological","Non-hemotological"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"]}}},"adverse_events":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"},"notes":{"left":null,"right":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"restrictions":{"codeList":{"left":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"right":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"data":{"added":["None","Unknown"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"clinical_trials_database":{"meta":{"notes":{"left":null,"right":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added."}},"restrictions":{"codeList":{"left":["NCI Clinical Trials","EU Clinical Trials Register"],"right":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"],"data":{"added":["Not applicable","Unknown"],"deleted":[]}}}},"clinical_trial_number":{"restrictions":{"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: 'The submitted NCI clinical trial number is in incorrect format.'};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: \"The submitted EudraCT clinical trial number is in incorrect format.\"};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: \"The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database.\"};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: \"'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.\"};\n } \n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"]}}}},"created":{"treatment_intent":{"changeType":"created","name":"treatment_intent","description":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"]},"meta":{"core":true,"displayName":"Treatment Intent","dependsOn":"treatment.treatment_type"}},"treatment_setting":{"changeType":"created","name":"treatment_setting","description":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: NCIt C124308)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"]},"meta":{"core":true,"displayName":"Treatment Setting","dependsOn":"treatment.treatment_type"}},"response_to_treatment_criteria_method":{"changeType":"created","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},"response_to_treatment":{"changeType":"created","name":"response_to_treatment","description":"The donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"codeList":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"]},"meta":{"core":true,"displayName":"Response To Treatment","dependsOn":"treatment.response_to_treatment_criteria_method","notes":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"outcome_of_treatment":{"changeType":"created","name":"outcome_of_treatment","description":"Indicate the donor's outcome of the prescribed treatment.","valueType":"string","restrictions":{"codeList":["Treatment completed as prescribed","Treatment incomplete due to technical or organizational problems","Treatment incomplete because patient died","Patient choice (stopped or interrupted treatment)","Physician decision (stopped or interrupted treatment)","Treatment stopped due to lack of efficacy (disease progression)","Treatment stopped due to acute toxicity","Other","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Outcome Of Treatment","dependsOn":"treatment.treatment_type"}},"hematological_toxicity":{"changeType":"created","name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"non-hematological_toxicity":{"changeType":"created","name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"age_at_consent_for_treatment":{"changeType":"deleted","name":"age_at_consent_for_treatment","description":"Indicate the age of donor when consent was given for treatment.","valueType":"integer","meta":{"displayName":"Age At Consent For Treatment"}},"therapeutic_intent":{"changeType":"deleted","name":"therapeutic_intent","description":"The therapeutic intent, the reason behind the choice of a therapy, of the treatment.","valueType":"string","restrictions":{"required":true,"codeList":["Adjuvant","Concurrent","Curative","Neoadjuvant","Not applicable","Palliative","Unknown"]},"meta":{"core":true,"displayName":"Therapeutic Intent"}},"response_to_therapy":{"changeType":"deleted","name":"response_to_therapy","description":"The donors's response to the applied treatment regimen. (Source: RECIST)","valueType":"string","restrictions":{"required":true,"codeList":["Complete response","Disease progression","NED","Partial response","Stable disease"]},"meta":{"core":true,"displayName":"Response To Therapy"}},"outcome_of_therapy":{"changeType":"deleted","name":"outcome_of_therapy","description":"Indicate the donor's outcome of the prescribed treatment.","valueType":"string","restrictions":{"codeList":["Treatment completed as prescribed","Treatment incomplete due to technical or organizational problems","Treatment incomplete because patient died","Patient choice (stopped or interrupted treatment)","Physician decision (stopped or interrupted treatment)","Treatment stopped due to lack of efficacy (disease progression)","Treatment stopped due to acute toxicity","Other","Not applicable","Unknown"]},"meta":{"displayName":"Outcome Of Therapy"}},"hemotological_toxicity":{"changeType":"deleted","name":"hemotological_toxicity","description":"Indicate the hemotological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5"]},"meta":{"displayName":"Hemotological Toxicity"}}}},"chemotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"description":{"left":"Name of agent or drug administered to patient as part of the treatment regimen.","right":"Name of agent or drug administered to donor as part of the treatment regimen."},"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"created","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"created","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"created","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"created","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}},"deleted":{"chemotherapy_dosage_units":{"changeType":"deleted","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate the total drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"description":{"left":"Name of agent or drug administered to patient as part of the treatment regimen.","right":"Name of agent or drug administered to donor as part of the treatment regimen."},"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"created","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{"hormone_drug_dosage_units":{"changeType":"deleted","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"radiation":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"radiation_therapy_fractions":{"description":{"left":"Indicate the number of total fractions delivered as part of treatment.","right":"Indicate the total number of fractions delivered as part of treatment."},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"radiation_therapy_dosage":{"valueType":{"left":"integer","right":"number"},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"anatomical_site_irradiated":{"description":{"left":"Indicate localization site where radiation therapy was administered.","right":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)"},"restrictions":{"codeList":{"left":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"right":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"data":{"added":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"],"deleted":["Bone","Extremities","Head-Neck","Peritoneum"]}}}}},"created":{"radiation_therapy_type":{"changeType":"created","name":"radiation_therapy_type","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal"]},"meta":{"core":true,"displayName":"Type of Radiation Therapy","notes":"Internal application includes Brachytherapy."}},"radiation_boost":{"changeType":"created","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"created","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}},"deleted":{"radiation_treatment_type":{"changeType":"deleted","name":"radiation_treatment_type","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal"]},"meta":{"core":true,"displayName":"Application Form","notes":"Internal application includes Brachytherapy."}}}},"follow_up":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_follow_up_id":{"description":{"left":"Unique identifier for a follow-up event in a donors clincal record, assigned by the data provider.","right":"Unique identifier for a follow-up event in a donor's clinical record, assigned by the data provider."},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"interval_of_followup":{"meta":{"notes":{"left":"The associated Primary Diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}}},"disease_status_at_followup":{"description":{"left":"Indicate the donor's disease status at time of follow-up.","right":"Indicate the donor's disease status at time of follow-up. (Reference: RECIST)"},"restrictions":{"codeList":{"left":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Relapse or recurrence","Stable"],"right":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Progression NOS","Relapse or recurrence","Stable"],"data":{"added":["Progression NOS"],"deleted":[]}}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"treatment.submitter_treatment_id"}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"weight_at_followup":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"relapse_type":{"restrictions":{"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"relapse_interval":{"restrictions":{"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"]}}},"method_of_progression_status":{"description":{"left":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Codelist reference: NCI CDE ID: 6161031)","right":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Reference: caDSR CDE ID 6161031)"},"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}},"restrictions":{"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}},"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_t_category":{"description":{"left":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"recurrence_n_category":{"description":{"left":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":true,"right":null}}},"recurrence_m_category":{"description":{"left":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"recurrence_stage_group":{"description":{"left":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery.","right":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) at the time of retreatment for a recurrence or disease progression."},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is dependent on the selected recurrence_tumour_staging_system.","right":"This field is dependent on the selected recurrence_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications"}},"restrictions":{"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n if ($row.recurrence_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.recurrence_tumour_staging_system && $row.recurrence_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'recurrence_tumour_staging_system' is set to '${\n $row.recurrence_tumour_staging_system\n }', 'recurrence_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"posttherapy_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"posttherapy_t_category":{"meta":{"dependsOn":{"left":"follow_up.post_therapy_tumour_staging_system","right":"follow_up.posttherapy_tumour_staging_system"}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"posttherapy_n_category":{"description":{"left":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"dependsOn":{"left":"follow_up.post_therapy_tumour_staging_system","right":"follow_up.posttherapy_tumour_staging_system"}}},"posttherapy_m_category":{"description":{"left":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"dependsOn":{"left":"follow_up.post_therapy_tumour_staging_system","right":"follow_up.posttherapy_tumour_staging_system"}},"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"posttherapy_stage_group":{"meta":{"dependsOn":{"left":"follow_up.post_therapy_tumour_staging_system","right":"follow_up.posttherapy_tumour_staging_system"},"notes":{"left":"This field is dependent on the selected posttherapy_tumour_staging_system.","right":"This field is dependent on the selected posttherapy_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications"}},"restrictions":{"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n if ($row.posttherapy_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.posttherapy_tumour_staging_system && $row.posttherapy_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'posttherapy_tumour_staging_system' is set to '${\n $row.posttherapy_tumour_staging_system\n }', 'posttherapy_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}}},"created":{"anatomic_site_progression_or_recurrence":{"changeType":"created","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"anatomic_site_progression_or_recurrences":{"changeType":"deleted","description":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })()"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1,C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}}}},"immunotherapy":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"immunotherapy_type":{"changeType":"created","name":"immunotherapy_type","valueType":"string","description":"Indicate the type of immunotherapy administered to donor.","meta":{"displayName":"Immunotherapy Type","core":true},"restrictions":{"required":true,"codeList":["Cell-based","Immune checkpoint inhibitors","Monoclonal antibodies other than immune checkpoint inhibitors","Other immunomodulatory substances"]}},"drug_rxnormcui":{"changeType":"created","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"created","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"created","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{}},"surgery":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"created","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"created","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"created","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"created","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"created","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"created","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"created","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"created","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"created","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"created","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"created","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"created","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"created","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"created","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}},"deleted":{}},"exposure":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"created","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"created","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"created","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"created","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"created","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"created","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"created","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"created","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"created","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"created","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"created","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"created","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"created","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}},"deleted":{}},"family_history":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"family_relative_id":{"changeType":"created","description":"Unique identifier of the relative, assigned by the data provider.","name":"family_relative_id","valueType":"string","meta":{"displayName":"Family Relative ID","primaryId":true,"notes":"This field is required to ensure that family members are identified in unique records. Ids can be as simple as an incremented numeral to ensure uniqueness."},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"relative_with_cancer_history":{"changeType":"created","description":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","name":"relative_with_cancer_history","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Relative with Cancer History"}},"relationship_type":{"changeType":"created","description":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","name":"relationship_type","restrictions":{"codeList":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"]},"valueType":"string","meta":{"displayName":"Relationship Type"}},"gender_of_relative":{"changeType":"created","description":"The self-reported gender of related individual.","name":"gender_of_relative","restrictions":{"codeList":["Female","Male","Other","Unknown"]},"valueType":"string","meta":{"displayName":"Gender of Relative"}},"age_of_relative_at_diagnosis":{"changeType":"created","description":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","name":"age_of_relative_at_diagnosis","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","displayName":"Age Of Relative At Diagnosis"}},"cancer_type_code_of_relative":{"changeType":"created","name":"cancer_type_code_of_relative","valueType":"string","description":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"examples":"C41.1,C16.9,C00.5,D46.9","dependsOn":"family_history.relative_with_cancer_history","displayName":"Cancer Type Code (ICD-10) of Relative"}},"relative_vital_status":{"changeType":"created","description":"Relative's last known state of living or deceased.","name":"relative_vital_status","restrictions":{"codeList":["Alive","Deceased","Unknown"]},"valueType":"string","meta":{"displayName":"Vital Status of Relative"}},"cause_of_death_of_relative":{"changeType":"created","description":"Indicate the cause of the death of the relative.","name":"cause_of_death_of_relative","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]},"valueType":"string","meta":{"dependsOn":"family_history.relative_vital_status","displayName":"Cause of Death of Relative"}},"relative_survival_time":{"changeType":"created","description":"Indicate how long, in days, the relative survived from the time they were diagnosed with cancer.","name":"relative_survival_time","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","units":"days","displayName":"Survival Time Of Relative"}}},"deleted":{}},"biomarker":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"created","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"created","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"created","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"created","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"created","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"created","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"created","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"created","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"created","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"created","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"created","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"created","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"created","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"created","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"created","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"created","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"created","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"created","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"created","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}},"deleted":{}},"comorbidity":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"created","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"created","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"created","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"created","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"created","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"created","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}},"deleted":{}}}} diff --git a/website/static/data/schemas/diffs/0.5/0.5-diff-1.24.json b/website/static/data/schemas/diffs/0.5/0.5-diff-1.24.json new file mode 100644 index 00000000..89c6b98c --- /dev/null +++ b/website/static/data/schemas/diffs/0.5/0.5-diff-1.24.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"program_id":{"meta":{"examples":{"left":"PACA-AU,BR-CA","right":"TEST-CA"},"notes":{"left":null,"right":"This is the unique id that is assigned to your program. If you have logged into the platform, this is the Program Id that you see in the Program Services area. For example, TEST-CA is a Program ID."},"displayName":{"left":null,"right":"Program ID"}}},"submitter_donor_id":{"meta":{"displayName":{"left":null,"right":"Submitter Donor ID"}}},"gender":{"meta":{"displayName":{"left":null,"right":"Gender"}}},"submitter_specimen_id":{"meta":{"displayName":{"left":null,"right":"Submitter Specimen ID"}}},"specimen_tissue_source":{"meta":{"displayName":{"left":null,"right":"Specimen Tissue Source"}}},"tumour_normal_designation":{"meta":{"displayName":{"left":null,"right":"Tumour Normal Designation"}}},"specimen_type":{"meta":{"displayName":{"left":null,"right":"Specimen Type"}},"restrictions":{"codeList":{"left":["Normal","Normal - tissue adjacent to primary tumour","Primary tumour","Primary tumour - adjacent to normal","Primary tumour - additional new primary","Recurrent tumour","Metastatic tumour","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour - additional metastatic","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line","Cell line - derived from xenograft tumour","Cell line - derived from tumour","Cell line - derived from normal"],"right":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"],"deleted":[]}},"script":{"left":["(function validate() {\n\n const row = $row;\n let result = {valid: true, message: \"Ok\"};\n \n const designation = row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\"){\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when tumour_normal_designation is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when tumour_normal_designation is set to Tumour.\"};\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"]}}},"submitter_sample_id":{"meta":{"displayName":{"left":null,"right":"Submitter Sample ID"}}},"sample_type":{"meta":{"displayName":{"left":null,"right":"Sample Type"}}}},"created":{},"deleted":{}},"donor":{"updated":{"program_id":{"meta":{"displayName":{"left":null,"right":"Program ID"}}},"submitter_donor_id":{"meta":{"displayName":{"left":null,"right":"Submitter Donor ID"}}},"vital_status":{"meta":{"displayName":{"left":null,"right":"Vital Status"}},"restrictions":{"codeList":{"left":["Alive","Deceased","Unknown"],"right":["Alive","Deceased"],"data":{"added":[],"deleted":["Unknown"]}}}},"cause_of_death":{"meta":{"displayName":{"left":null,"right":"Cause of Death"}},"restrictions":{"codeList":{"left":["Died of cancer","Died of other reasons"],"right":["Died of cancer","Died of other reasons","Unknown"],"data":{"added":["Unknown"],"deleted":[]}},"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]}}},"survival_time":{"meta":{"displayName":{"left":null,"right":"Survival Time"}},"restrictions":{"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"height":{"valueType":{"left":"integer","right":"number"},"meta":{},"restrictions":{}},"weight":{"valueType":{"left":"integer","right":"number"},"meta":{},"restrictions":{}},"bmi":{"valueType":{"left":"integer","right":"number"},"meta":{},"restrictions":{}},"menopause_status":{"description":{"left":"Indicate the donor's menopause status at the time of primary diagnosis. (Codelist reference: NCI CDE ID: 2434914)","right":"Indicate the donor's menopause status at the time of primary diagnosis. (Reference: caDSR CDE ID 2434914)"},"meta":{},"restrictions":{"codeList":{"left":["Premenopausal","Perimenopausal","Postmenopausal","Indeterminate or unknown","Not applicable"],"right":["Not applicable","Perimenopausal","Postmenopausal","Premenopausal","Unknown"],"data":{"added":["Unknown"],"deleted":["Indeterminate or unknown"]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age of menarche, the first occurrence of menstruation.","right":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)"},"meta":{},"restrictions":{}},"number_of_pregnancies":{"description":{"left":"Indicate the number of pregnancies a donor has had.","right":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)"},"meta":{},"restrictions":{}},"number_of_children":{"description":{"left":"Indicate the number of children the donor has birthed.","right":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)"},"meta":{},"restrictions":{}}},"created":{"primary_site":{"changeType":"created","name":"primary_site","valueType":"string","isArray":true,"description":"The text term used to describe the primary site of disease, as categorized by the World Health Organization's (WHO) International Classification of Diseases for Oncology (ICD-O). This categorization groups cases into general categories.","meta":{"displayName":"Primary Site","core":true,"notes":"To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Breast|Ovary"},"restrictions":{"required":true,"codeList":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"]}},"genetic_disorders":{"changeType":"created","description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},"hrt_type":{"changeType":"created","description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},"hrt_duration":{"changeType":"created","description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},"contraception_type":{"changeType":"created","description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},"contraception_duration":{"changeType":"created","description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},"lost_to_followup_after_clinical_event_id":{"changeType":"created","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}},"deleted":{"prior_malignancy":{"changeType":"deleted","description":"Prior malignancy affecting donor.","name":"prior_malignancy","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string"},"cancer_type_prior_malignancy":{"changeType":"deleted","description":"ICD-10 diagnostic code for type of cancer in a prior malignancy.","name":"cancer_type_prior_malignancy","restrictions":{"regex":"[A-Z]{1}[0-9]{2}.[0-9]{0,3}[A-Z]{0,1}$"},"valueType":"string"},"age_at_prior_malignancy":{"changeType":"deleted","description":"If donor has history of prior malignancy, indicate age at previous diagnosis, in years.","name":"age_at_prior_malignancy","valueType":"integer"},"laterality_of_prior_malignancy":{"changeType":"deleted","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis.","name":"laterality_of_prior_malignancy","valueType":"string"}}},"specimen":{"updated":{"program_id":{"meta":{"displayName":{"left":null,"right":"Program ID"}}},"submitter_donor_id":{"meta":{"displayName":{"left":null,"right":"Submitter Donor ID"}}},"submitter_specimen_id":{"meta":{"displayName":{"left":null,"right":"Submitter Specimen ID"}}},"pathological_tumour_staging_system":{"meta":{"validationDependency":{"left":null,"right":true},"displayName":{"left":null,"right":"Pathological Tumour Staging System"}},"restrictions":{"script":{"left":["(function validate() {\n\n let result = {valid: true, message: \"Ok\"};\n \n /* This is not a required field, so first ensure that it exists */\n if ($field){\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name.trim().toLowerCase().split('_tumour_staging_system')[0];\n /* Perform validation only if an AJCC value was selected */\n if (/^(AJCC)\\b/i.test($field)){\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`\n ];\n const convertedRow = Object.fromEntries(Object.entries($row).map(([fieldName,fieldVal]) => [fieldName.toLowerCase(), fieldVal]));\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(field => Object.keys(convertedRow).includes(field) && (!convertedRow[field] || checkforEmpty(convertedRow[field])))\n if (emptyFields.length){\n result = {valid: false, \"message\": `The following fields are required when ${$name} is set to an AJCC option: ${emptyFields}`};\n }\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"deleted":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"]}}}},"pathological_t_category":{"meta":{"displayName":{"left":null,"right":"Pathological T Category"}},"restrictions":{}},"pathological_n_category":{"meta":{"displayName":{"left":null,"right":"Pathological N Category"}},"restrictions":{}},"pathological_m_category":{"meta":{"displayName":{"left":null,"right":"Pathological M Category"}},"restrictions":{}},"pathological_stage_group":{"description":{"left":"Specify the tumour stage, based on tumor_staging_system, used to assess the cancer at the time the tumour specimen was resected.","right":"Specify the tumour stage, based on pathological_tumour_staging_system, used to assess the cancer at the time the tumour specimen was resected."},"meta":{"notes":{"left":null,"right":"This field depends on the selected pathological_tumour_staging_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications"},"displayName":{"left":null,"right":"Pathological Stage Group"}},"restrictions":{}},"specimen_acquisition_interval":{"meta":{"notes":{"left":null,"right":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."},"displayName":{"left":null,"right":"Specimen Acquisition Interval"}}},"tumour_histological_type":{"description":{"left":"The code to represent the histology (morphology) of neoplasms that is usually obtained from a pathology report, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Please refer to the guidelines provided in the ICD-O-3 manual at https://apps.who.int/iris/handle/10665/42344.","right":"The code to represent the histology (morphology) of neoplasms that is usually obtained from a pathology report, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344."},"meta":{"validationDependency":{"left":null,"right":true},"displayName":{"left":null,"right":"Tumour Histological Type"}}},"specimen_anatomic_location":{"description":{"left":"Anatomic location of a specimen when it was collected.","right":"Indicate the ICD-O-3 topography code for the anatomic location of a specimen when it was collected. Refer to the guidelines provided in the ICD-O-3 manual at https://apps.who.int/iris/handle/10665/42344."},"meta":{"displayName":{"left":null,"right":"Specimen Anatomic Location"},"examples":{"left":null,"right":"C50.1,C18"}},"restrictions":{"codeList":{"left":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear, pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal; distal","Esophageal; mid","Esophageal; proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck, NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es), maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"],"data":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear, pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal; distal","Esophageal; mid","Esophageal; proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck, NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es), maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"]},"regex":{"left":null,"right":"^[C][0-9]{2}(.[0-9]{1})?$"}}},"specimen_processing":{"meta":{},"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation, other","Formalin fixed & paraffin embedded","Formalin fixed, buffered","Formalin fixed, unbuffered","Fresh","Other"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"data":{"added":["Cryopreservation - other","Formalin fixed - buffered","Formalin fixed - unbuffered","Unknown"],"deleted":["Cryopreservation, other","Formalin fixed, buffered","Formalin fixed, unbuffered"]}}}},"specimen_storage":{"description":{"left":"Indicate the method of specimen storage for specimens that were not extracted freshly or immediately cultured.","right":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured."},"meta":{"displayName":{"left":null,"right":"Specimen Storage"}},"restrictions":{"codeList":{"left":["Cut slide","Frozen, -70 freezer","Frozen, liquid nitrogen","Frozen, vapor phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"data":{"added":["Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Unknown"],"deleted":["Frozen, -70 freezer","Frozen, liquid nitrogen","Frozen, vapor phase"]}}}},"tumour_grading_system":{"meta":{"validationDependency":{"left":null,"right":true},"displayName":{"left":null,"right":"Tumour Grading System"}},"restrictions":{"codeList":{"left":["Default","Gleason","Nottingham","Brain cancer","ISUP","Lymphoid neoplasms"],"right":["FNCLCC grading system","Four-tier grading system","Gleason grade group system","Grading system for GISTs","Grading system for GNETs","ISUP grading system","Nuclear grading system for DCIS","Scarff-Bloom-Richardson grading system","Three-tier grading system","Two-tier grading system","WHO grading system for CNS tumours"],"data":{"added":["FNCLCC grading system","Four-tier grading system","Gleason grade group system","Grading system for GISTs","Grading system for GNETs","ISUP grading system","Nuclear grading system for DCIS","Scarff-Bloom-Richardson grading system","Three-tier grading system","Two-tier grading system","WHO grading system for CNS tumours"],"deleted":["Default","Gleason","Nottingham","Brain cancer","ISUP","Lymphoid neoplasms"]}}}},"tumour_grade":{"meta":{"notes":{"left":"This field depends on the selected tumour grading system.","right":"This field depends on the selected tumour_grading_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Grading Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-grading-classifications"},"displayName":{"left":null,"right":"Tumour Grade"}},"restrictions":{"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'default':\n codeList = [\n 'gx - cannot be assessed',\n 'g1 well differentiated/low grade',\n 'g2 moderately differentiated/intermediated grade',\n 'g3 poorly differentiated/high grade',\n 'g4 undifferentiated/high grade',\n ];\n break;\n case 'gleason':\n codeList = [\n 'gleason x: gleason score cannot be determined',\n 'gleason 2–6: the tumor tissue is well differentiated',\n 'gleason 7: the tumor tissue is moderately differentiated',\n 'gleason 8–10: the tumor tissue is poorly differentiated or undifferentiated',\n ];\n break;\n case 'nottingham':\n codeList = [\n 'g1 (low grade or well differentiated)',\n 'g2 (intermediate grade or moderately differentiated)',\n 'g3 (high grade or poorly differentiated)',\n ];\n break;\n case 'brain cancer':\n codeList = ['grade i', 'grade ii', 'grade iii', 'grade iv'];\n break;\n case 'isup for renal cell carcinoma':\n codeList = [\n 'grade 1: tumor cell nucleoli invisible or small and basophilic at 400 x magnification',\n 'grade 2: tumor cell nucleoli conspicuous at 400 x magnification but inconspicuous at 100 x magnification',\n 'grade 3: tumor cell nucleoli eosinophilic and clearly visible at 100 x magnification',\n 'grade 4: tumors showing extreme nuclear pleomorphism and/or containing tumor giant cells and/or the presence of any proportion of tumor showing sarcomatoid and/or rhabdoid dedifferentiation',\n ];\n break;\n case 'lymphoid neoplasms':\n codeList = ['low grade or indolent nhl', 'high grade or aggressive nhl'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList.join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]},"codeList":{"right":["Low grade","High grade","GX","G1","G2","G3","G4","Low","High","Grade I","Grade II","Grade III","Grade IV","Grade Group 1","Grade Group 2","Grade Group 3","Grade Group 4","Grade Group 5"],"data":["Low grade","High grade","GX","G1","G2","G3","G4","Low","High","Grade I","Grade II","Grade III","Grade IV","Grade Group 1","Grade Group 2","Grade Group 3","Grade Group 4","Grade Group 5"]}}},"percent_tumour_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of infiltration by tumour cells in a specimen.","right":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)"},"meta":{"displayName":{"left":null,"right":"Percent Tumour Cells"}},"restrictions":{}},"percent_proliferating_cells":{"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."},"displayName":{"left":null,"right":"Percent Proliferating Cells"}},"restrictions":{}},"percent_inflammatory_tissue":{"description":{"left":"Indicate a value, in decimals, that represents local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue.","right":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."},"displayName":{"left":null,"right":"Percent Inflammatory Tissue"}},"restrictions":{}},"percent_stromal_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a malignant tumour specimen but are not malignant such as fibroblasts, vascular structures, etc.","right":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."},"displayName":{"left":null,"right":"Percent Stromal Cells"}},"restrictions":{}},"percent_necrosis":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of cell death in a malignant tumour specimen.","right":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."},"displayName":{"left":null,"right":"Percent Necrosis"}},"restrictions":{}}},"created":{"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate the primary diagnosis event in the clinical timeline that this specimen acquisition was related to.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"specimen_laterality":{"changeType":"created","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"reference_pathology_confirmed":{"changeType":"created","name":"reference_pathology_confirmed","description":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)","valueType":"string","meta":{"validationDependency":true,"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Reference Pathology Confirmed"},"restrictions":{"codeList":["Yes","No","Unknown"]}},"percent_tumour_cells_measurement_method":{"changeType":"created","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}},"deleted":{"central_pathology_confirmed":{"changeType":"deleted","name":"central_pathology_confirmed","description":"Indicate whether the histologic description of tissue or cells was confirmed by a pathology review of frozen or formalin fixed slide(s) completed after the diagnostic pathology review of the tumour sample used to extract analyte(s).","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour."},"restrictions":{"codeList":["Yes","No","Unknown"]}}}},"primary_diagnosis":{"updated":{"program_id":{"meta":{"displayName":{"left":null,"right":"Program ID"}}},"submitter_donor_id":{"meta":{"displayName":{"left":null,"right":"Submitter Donor ID"}}},"age_at_diagnosis":{"description":{"left":"Age that the donor was first diagnosed with cancer, in years.","right":"Age that the donor was first diagnosed with cancer, in years. This should be based on the earliest diagnosis of cancer."},"meta":{"displayName":{"left":null,"right":"Age at Diagnosis"}},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0,"max":90}}}},"cancer_type_code":{"description":{"left":"The code to represent the cancer type using the WHO ICD-10 code (https://icd.who.int/browse10/2016/en#/) classification.","right":"The code to represent the cancer type using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification."},"meta":{"examples":{"left":null,"right":"C41.1,C16.9,C00.5,D46.9"},"displayName":{"left":null,"right":"Cancer Type Code"}},"restrictions":{"regex":{"left":"[A-Z]{1}[0-9]{2}.[0-9]{0,3}[A-Z]{0,1}$","right":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"}}},"number_lymph_nodes_positive":{"description":{"left":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: NCI CDE ID: 6113694)","right":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: caDSR CDE ID 6113694)"},"meta":{"displayName":{"left":null,"right":"Number Of Lymph Nodes Positive"},"dependsOn":{"left":null,"right":"primary_diagnosis.lymph_nodes_examined_status"},"notes":{"left":null,"right":"This field is only required if 'lymph_nodes_examined_status' is 'Yes'."}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"]},"range":{"left":null,"right":{"min":0}}}},"number_lymph_nodes_examined":{"description":{"left":"The total number of lymph nodes tested for the presence of cancer. (Reference: NCI CDE ID: 3)","right":"The total number of lymph nodes tested for the presence of cancer. (Reference: caDSR CDE ID 3)"},"meta":{},"restrictions":{}},"clinical_tumour_staging_system":{"meta":{"validationDependency":{"left":null,"right":true},"displayName":{"left":null,"right":"Clinical Tumour Staging System"}},"restrictions":{"script":{"left":["(function validate() {\n\n let result = {valid: true, message: \"Ok\"};\n \n /* This is not a required field, so first ensure that it exists */\n if ($field){\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name.trim().toLowerCase().split('_tumour_staging_system')[0];\n /* Perform validation only if an AJCC value was selected */\n if (/^(AJCC)\\b/i.test($field)){\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`\n ];\n const convertedRow = Object.fromEntries(Object.entries($row).map(([fieldName,fieldVal]) => [fieldName.toLowerCase(), fieldVal]));\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(field => Object.keys(convertedRow).includes(field) && (!convertedRow[field] || checkforEmpty(convertedRow[field])))\n if (emptyFields.length){\n result = {valid: false, \"message\": `The following fields are required when ${$name} is set to an AJCC option: ${emptyFields}`};\n }\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"required":{"left":true,"right":null},"codeList":{"left":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"deleted":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"]}}}},"clinical_stage_group":{"description":{"left":"Stage group of the tumour, as assigned by the reporting tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.).","right":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage."},"meta":{"notes":{"left":null,"right":"This field is dependent on the selected clinical_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications"},"displayName":{"left":null,"right":"Clinical Stage Group"},"examples":{"left":null,"right":"Stage I, Stage IIB"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"clinical_t_category":{"meta":{"displayName":{"left":null,"right":"Clinical T Category"}},"restrictions":{}},"clinical_n_category":{"description":{"left":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"displayName":{"left":null,"right":"Clinical N Category"}},"restrictions":{}},"clinical_m_category":{"description":{"left":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned.","right":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned."},"meta":{"displayName":{"left":null,"right":"Clinical M Category"}},"restrictions":{}},"presenting_symptoms":{"meta":{},"restrictions":{"codeList":{"left":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Nausea","None","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Unknown","Vomiting","Weight Loss"],"right":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Loss of Appetite","Nausea","None","Not Reported","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Swelling in the Neck","Unknown","Vomiting","Weight Loss"],"data":{"added":["Loss of Appetite","Not Reported","Swelling in the Neck"],"deleted":[]}}}},"performance_status":{"description":{"left":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference source: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status).","right":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status)."},"meta":{"notes":{"left":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction \n Grade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work) \n Grade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours \n Grade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours \n Grade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair","right":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction.\nGrade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work).\nGrade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours.\nGrade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours.\nGrade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair"},"displayName":{"left":null,"right":"Performance Status"}},"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}}},"created":{"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Unique identifier of the primary diagnosis event, assigned by the data provider.","meta":{"primaryId":true,"displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"cancer_type_additional_information":{"changeType":"created","name":"cancer_type_additional_information","valueType":"string","description":"Additional details related to the cancer type that are not covered by the ICD-10 code provided in the cancer_type field.","meta":{"displayName":"Cancer Type Additional Information"}},"basis_of_diagnosis":{"changeType":"created","name":"basis_of_diagnosis","description":"Indicate the most valid basis of how the primary diagnosis was identified. If more than one diagnosis technique was used, select the term that has the highest code number (see notes). (Reference: IACR Standard for Basis of Diagnosis http://www.iacr.com.fr/images/doc/basis.pdf)","restrictions":{"codeList":["Clinical investigation","Clinical","Cytology","Death certificate only","Histology of a metastasis","Histology of a primary tumour","Specific tumour markers","Unknown"]},"valueType":"string","meta":{"notes":"0: Death certificate only: Information provided is from a death certificate.\n1: Clinical: Diagnosis made before death.\n2: Clinical investigation: All diagnostic techniques, including X-ray, endoscopy, imaging, ultrasound, exploratory surgery (such as laparotomy), and autopsy, without a tissue diagnosis.\n4: Specific tumour markers: Including biochemical and/or immunologic markers that are specific for a tumour site.\n5: Cytology: Examination of cells from a primary or secondary site, including fluids aspirated by endoscopy or needle; also includes the microscopic examination of peripheral blood and bone marrow aspirates.\n6: Histology of a metastasis: Histologic examination of tissue from a metastasis, including autopsy specimens.\n7: Histology of a primary tumour: Histologic examination of tissue from primary tumour, however obtained, including all cutting techniques and bone marrow biopsies; also includes autopsy specimens of primary tumour.\n9: Unknown: No information on how the diagnosis has been made.","displayName":"Basis of Diagnosis"}},"laterality":{"changeType":"created","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_status":{"changeType":"created","name":"lymph_nodes_examined_status","description":"Indicate if lymph nodes were examined for metastases.","valueType":"string","restrictions":{"required":true,"codeList":["Cannot be determined","No","No lymph nodes found in resected specimen","Not applicable","Yes"]},"meta":{"core":true,"displayName":"Lymph Nodes Examined Status"}},"lymph_nodes_examined_method":{"changeType":"created","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}},"deleted":{"stage_suffix":{"changeType":"deleted","name":"stage_suffix","description":"If necessary, use this field to add any applicable stage suffixes. Stage suffixes may apply to certain staging systems such as Ann Arbour staging system where the four stages are divided into 4 categories (A, B, X and E).","valueType":"string","meta":{"core":true,"dependsOn":"primary_diagnosis.clinical_tumour_staging_system"}}}},"treatment":{"updated":{"program_id":{"meta":{"displayName":{"left":null,"right":"Program ID"}}},"submitter_donor_id":{"meta":{"displayName":{"left":null,"right":"Submitter Donor ID"}}},"submitter_treatment_id":{"meta":{"displayName":{"left":null,"right":"Submitter Treatment ID"}}},"treatment_type":{"meta":{"notes":{"left":"Depending on the treatment_type selected, additional treament details may be required to be submitted.","right":"Depending on the treatment_type(s) selected, additional treatment details may be required to be submitted. For example, if treatment_type includes 'Chemotherapy', the supplemental Chemotherapy treatment type file is required.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."},"displayName":{"left":null,"right":"Treatment Type"},"examples":{"left":null,"right":"Chemotherapy|Hormonal therapy"}},"restrictions":{"codeList":{"left":["Chemotherapy","Ablation","Bone marrow transplant","Combined chemo+immunotherapy","Combined chemo+radiation therapy","Combined chemo-radiotherapy and surgery","Endoscopic therapy","Hormonal therapy","Immunotherapy","Monoclonal antibodies (for liquid tumours)","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgical resection"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":["End of life care","Surgery"],"deleted":["Combined chemo+immunotherapy","Combined chemo+radiation therapy","Combined chemo-radiotherapy and surgery","Monoclonal antibodies (for liquid tumours)","Surgical resection"]}}}},"is_primary_treatment":{"description":{"left":"Indicate if the treamtment was the primary treatment following the initial diagnosis.","right":"Indicate if the treatment was the primary treatment following the initial diagnosis."},"meta":{"displayName":{"left":null,"right":"Is Primary Treatment"},"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Yes","No","Unknown"],"right":["Yes","No"],"data":{"added":[],"deleted":["Unknown"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_start_interval":{"description":{"left":"The interval between primary diagnosis and initiation of treatment, in days.","right":"The interval between the primary diagnosis and initiation of treatment, in days."},"meta":{"notes":{"left":null,"right":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."},"displayName":{"left":null,"right":"Treatment Start Interval"},"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_duration":{"description":{"left":"The duration of treatment regimen, in days","right":"The duration of treatment regimen, in days."},"meta":{"displayName":{"left":null,"right":"Treatment Duration"},"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}}},"created":{"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate the primary diagnosis event in the clinical timeline that this treatment was related to.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"line_of_treatment":{"changeType":"created","name":"line_of_treatment","description":"Indicate the line of treatment if it is not the primary treatment.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Line Of treatment","dependsOn":"treatment.is_primary_treatment","examples":"2,3,4"}},"days_per_cycle":{"changeType":"created","name":"days_per_cycle","description":"Indicate the number of days in a treatment cycle.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Days Per Cycle","dependsOn":"treatment.treatment_type"}},"number_of_cycles":{"changeType":"created","name":"number_of_cycles","description":"Indicate the number of treatment cycles.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Number Of Cycles","dependsOn":"treatment.treatment_type"}},"treatment_intent":{"changeType":"created","name":"treatment_intent","description":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"]},"meta":{"core":true,"displayName":"Treatment Intent","dependsOn":"treatment.treatment_type"}},"treatment_setting":{"changeType":"created","name":"treatment_setting","description":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: NCIt C124308)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"]},"meta":{"core":true,"displayName":"Treatment Setting","dependsOn":"treatment.treatment_type"}},"response_to_treatment_criteria_method":{"changeType":"created","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},"response_to_treatment":{"changeType":"created","name":"response_to_treatment","description":"The donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"codeList":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"]},"meta":{"core":true,"displayName":"Response To Treatment","dependsOn":"treatment.response_to_treatment_criteria_method","notes":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"outcome_of_treatment":{"changeType":"created","name":"outcome_of_treatment","description":"Indicate the donor's outcome of the prescribed treatment.","valueType":"string","restrictions":{"codeList":["Treatment completed as prescribed","Treatment incomplete due to technical or organizational problems","Treatment incomplete because patient died","Patient choice (stopped or interrupted treatment)","Physician decision (stopped or interrupted treatment)","Treatment stopped due to lack of efficacy (disease progression)","Treatment stopped due to acute toxicity","Other","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Outcome Of Treatment","dependsOn":"treatment.treatment_type"}},"toxicity_type":{"changeType":"created","name":"toxicity_type","description":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity.","valueType":"string","restrictions":{"codeList":["Hematological","Non-hematological","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Toxicity Type","dependsOn":"treatment.outcome_of_treatment"}},"hematological_toxicity":{"changeType":"created","name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"non-hematological_toxicity":{"changeType":"created","name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"adverse_events":{"changeType":"created","name":"adverse_events","description":"Report any treatment related adverse events. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Adverse Events","dependsOn":"treatment.treatment_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"clinical_trials_database":{"changeType":"created","name":"clinical_trials_database","description":"If the donor is a participant in a clinical trial, indicate the clinical trial database where the clinical trial is registered.","valueType":"string","meta":{"display name":"Clinical Trials Database","notes":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added."},"restrictions":{"codeList":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"]}},"clinical_trial_number":{"changeType":"created","name":"clinical_trial_number","description":"Based on the clinical_trial_database, indicate the unique NCT or EudraCT clinical trial identifier of which the donor is a participant.","valueType":"string","meta":{"display name":"Clinical Trial Number","dependsOn":"treatment.clinical_trials_database","examples":"2016-002120-83,NCT02465060"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"]}}},"deleted":{"age_at_consent_for_treatment":{"changeType":"deleted","name":"age_at_consent_for_treatment","description":"Indicate the age of donor when consent was given for treatment.","valueType":"integer"},"therapeutic_intent":{"changeType":"deleted","name":"therapeutic_intent","description":"The therapeutic intent, the reason behind the choice of a therapy, of the treatment.","valueType":"string","restrictions":{"required":true,"codeList":["Adjuvant","Concurrent","Curative","Neoadjuvant","Not applicable","Palliative","Unknown"]},"meta":{"core":true}},"response_to_therapy":{"changeType":"deleted","name":"response_to_therapy","description":"The donors's response to the applied treatment regimen. (Source: RECIST)","valueType":"string","restrictions":{"required":true,"codeList":["Complete response","Disease progression","NED","Partial response","Stable disease"]},"meta":{"core":true}}}},"chemotherapy":{"updated":{"program_id":{"meta":{"displayName":{"left":null,"right":"Program ID"}}},"submitter_donor_id":{"meta":{"displayName":{"left":null,"right":"Submitter Donor ID"}}},"submitter_treatment_id":{"meta":{"displayName":{"left":null,"right":"Submitter Treatment ID"}}}},"created":{"drug_rxnormcui":{"changeType":"created","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"created","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"created","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"created","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"created","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"created","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}},"deleted":{"chemotherapy_drug_name":{"changeType":"deleted","name":"chemotherapy_drug_name","description":"Name of agent or drug administered to patient as part of the chemotherapy treatment regimen.","valueType":"string","restrictions":{"required":true,"codeList":["Placeholder list 1","Need list","Still need it"]},"meta":{"validationDependency":true,"core":true,"notes":"This field uses a controlled vocabulary gathered from the DrugBank database of drug names.","examples":"Allopurinol, Dronabinol, Sucralfate, Lapatinib"}},"chemotherapy_dosage_units":{"changeType":"deleted","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m²","IU/m²","µg/m²","g/m²","kg"]},"meta":{"core":true}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate the total drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"integer","restrictions":{"required":true},"meta":{"core":true}}}},"hormone_therapy":{"updated":{"program_id":{"meta":{"displayName":{"left":null,"right":"Program ID"}}},"submitter_donor_id":{"meta":{"displayName":{"left":null,"right":"Submitter Donor ID"}}},"submitter_treatment_id":{"meta":{"displayName":{"left":null,"right":"Submitter Treatment ID"}}}},"created":{"drug_rxnormcui":{"changeType":"created","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"created","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Hormone Therapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"created","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{"hormone_therapy_drug_name":{"changeType":"deleted","name":"hormone_therapy_drug_name","description":"Name of agent or drug administered to patient as part of the hormone therapy treatment regimen.","valueType":"string","restrictions":{"required":true,"codeList":["Placeholder list 1","Need list","Still need it"]},"meta":{"validationDependency":true,"core":true,"notes":"This field uses a controlled vocabulary gathered from the DrugBank database of drug names."}},"hormone_drug_dosage_units":{"changeType":"deleted","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m²","IU/m²","µg/m²","g/m²","kg "]},"meta":{"core":true}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"integer","restrictions":{"required":true},"meta":{"core":true}}}},"radiation":{"updated":{"program_id":{"meta":{"displayName":{"left":null,"right":"Program ID"}}},"submitter_donor_id":{"meta":{"displayName":{"left":null,"right":"Submitter Donor ID"}}},"submitter_treatment_id":{"meta":{"displayName":{"left":null,"right":"Submitter Treatment ID"}}},"radiation_therapy_modality":{"meta":{"displayName":{"left":null,"right":"Radiation Therapy Modality"}}},"radiation_therapy_fractions":{"description":{"left":"Indicate the number of total fractions delivered as part of treatment.","right":"Indicate the total number of fractions delivered as part of treatment."},"meta":{"displayName":{"left":null,"right":"Radiation Therapy Fractions"}},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"radiation_therapy_dosage":{"valueType":{"left":"integer","right":"number"},"meta":{"displayName":{"left":null,"right":"Radiation Therapy Dosage"}},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"anatomical_site_irradiated":{"description":{"left":"Indicate localization site where radiation therapy was administered.","right":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)"},"meta":{"displayName":{"left":null,"right":"Anatomical Site Irradiated"}},"restrictions":{"codeList":{"left":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"right":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"data":{"added":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"],"deleted":["Bone","Extremities","Head-Neck","Peritoneum"]}}}}},"created":{"radiation_therapy_type":{"changeType":"created","name":"radiation_therapy_type","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal"]},"meta":{"core":true,"displayName":"Type of Radiation Therapy","notes":"Internal application includes Brachytherapy."}},"radiation_boost":{"changeType":"created","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"created","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}},"deleted":{"application_form":{"changeType":"deleted","name":"application_form","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal (including Brachytherapy)"]},"meta":{"core":true}}}},"follow_up":{"updated":{"program_id":{"meta":{"displayName":{"left":null,"right":"Program ID"}}},"submitter_donor_id":{"meta":{"displayName":{"left":null,"right":"Submitter Donor ID"}}},"submitter_follow_up_id":{"description":{"left":"Unique identifier for a follow-up event in a donors clincal record, assigned by the data provider.","right":"Unique identifier for a follow-up event in a donor's clinical record, assigned by the data provider."},"meta":{"displayName":{"left":null,"right":"Submitter Follow-Up ID"}}},"interval_of_followup":{"description":{"left":"Interval from the primary diagnosis date to the follow up date, in days.","right":"Interval from the primary diagnosis date to the follow-up date, in days."},"meta":{"displayName":{"left":null,"right":"Interval Of Follow-Up"},"notes":{"left":null,"right":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}}},"disease_status_at_followup":{"description":{"left":"Indicate the donor's disease status at time of follow-up.","right":"Indicate the donor's disease status at time of follow-up. (Reference: RECIST)"},"meta":{"displayName":{"left":null,"right":"Disease Status at Follow-Up"}},"restrictions":{"codeList":{"left":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Relapse","Stable"],"right":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Progression NOS","Relapse or recurrence","Stable"],"data":{"added":["Progression NOS","Relapse or recurrence"],"deleted":["Relapse"]}}}},"relapse_type":{"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."},"displayName":{"left":null,"right":"Relapse Type"}},"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"relapse_interval":{"description":{"left":"If the donor was clinically disease free following primary treatment and then relapse or progression (for liquid tumours) occurred afterwards, then this field will indicate the length of disease free interval, in days.","right":"If the donor was clinically disease free following primary treatment and then relapse or recurrence or progression (for liquid tumours) occurred afterwards, then this field will indicate the length of disease free interval, in days."},"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."},"displayName":{"left":null,"right":"Relapse Interval"}},"restrictions":{"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"]}}},"method_of_progression_status":{"description":{"left":"Indicate the method(s) used to confirm the donor's progression disease status. (Codelist reference: NCI CDE ID: 6161031)","right":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Reference: caDSR CDE ID 6161031)"},"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."},"displayName":{"left":null,"right":"Method Of Progression Status"}},"restrictions":{"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]},"codeList":{"left":["Autopsy","Biomarker in liquid biopsy (e.g. tumor marker in blood or urine)","Biopsy","Blood draw","Bone marrow aspirate","Core biopsy","Cystoscopy","Cytology","Debulking","Diagnostic imaging","Dilation and curettage procedure","Enucleation","Excisional biopsy","Fine needle aspiration","Imaging","Incisional biopsy","Laparoscopy","Laparotomy","Other","Pap Smear","Pathologic review","Physical exam","Surgical resection","Thoracentesis","Ultrasound guided biopsy"],"right":["Biomarker in liquid biopsy (e.g. tumour marker in blood or urine)","Biopsy","Blood draw","Bone marrow aspirate","Core biopsy","Cystoscopy","Cytology","Debulking","Diagnostic imaging","Dilation and curettage procedure","Enucleation","Excisional biopsy","Fine needle aspiration","Imaging","Incisional biopsy","Laparoscopy","Laparotomy","Other","Pap Smear","Pathologic review","Physical exam","Surgical resection","Thoracentesis","Ultrasound guided biopsy"],"data":{"added":["Biomarker in liquid biopsy (e.g. tumour marker in blood or urine)"],"deleted":["Autopsy","Biomarker in liquid biopsy (e.g. tumor marker in blood or urine)"]}}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."},"displayName":{"left":null,"right":"Recurrance Tumour Staging System"}},"restrictions":{"codeList":{"left":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"deleted":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"]}},"script":{"left":["(function validate() {\n\n let result = {valid: true, message: \"Ok\"};\n \n /* This is not a required field, so first ensure that it exists */\n if ($field){\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name.trim().toLowerCase().split('_tumour_staging_system')[0];\n /* Perform validation only if an AJCC value was selected */\n if (/^(AJCC)\\b/i.test($field)){\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`\n ];\n const convertedRow = Object.fromEntries(Object.entries($row).map(([fieldName,fieldVal]) => [fieldName.toLowerCase(), fieldVal]));\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(field => Object.keys(convertedRow).includes(field) && (!convertedRow[field] || checkforEmpty(convertedRow[field])))\n if (emptyFields.length){\n result = {valid: false, \"message\": `The following fields are required when ${$name} is set to an AJCC option: ${emptyFields}`};\n }\n }\n }\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_t_category":{"description":{"left":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":true,"right":null},"displayName":{"left":null,"right":"Recurrence T Category"}},"restrictions":{}},"recurrence_n_category":{"description":{"left":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":true,"right":null},"displayName":{"left":null,"right":"Recurrence N Category"}},"restrictions":{}},"recurrence_m_category":{"description":{"left":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":true,"right":null},"displayName":{"left":null,"right":"Recurrence M Category"}},"restrictions":{}},"recurrence_stage_group":{"description":{"left":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery.","right":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) at the time of retreatment for a recurrence or disease progression."},"meta":{"core":{"left":true,"right":null},"notes":{"left":null,"right":"This field is dependent on the selected recurrence_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications"},"displayName":{"left":null,"right":"Recurrence Stage Group"}},"restrictions":{}},"posttherapy_tumour_staging_system":{"meta":{},"restrictions":{"script":{"left":["(function validate() {\n\n let result = {valid: true, message: \"Ok\"};\n \n /* This is not a required field, so first ensure that it exists */\n if ($field){\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name.trim().toLowerCase().split('_tumour_staging_system')[0];\n /* Perform validation only if an AJCC value was selected */\n if (/^(AJCC)\\b/i.test($field)){\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`\n ];\n const convertedRow = Object.fromEntries(Object.entries($row).map(([fieldName,fieldVal]) => [fieldName.toLowerCase(), fieldVal]));\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(field => Object.keys(convertedRow).includes(field) && (!convertedRow[field] || checkforEmpty(convertedRow[field])))\n if (emptyFields.length){\n result = {valid: false, \"message\": `The following fields are required when ${$name} is set to an AJCC option: ${emptyFields}`};\n }\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"deleted":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"]}}}},"posttherapy_t_category":{"meta":{"dependsOn":{"left":"follow_up.post_therapy_tumour_staging_system","right":"follow_up.posttherapy_tumour_staging_system"},"displayName":{"left":null,"right":"Post-therapy T Category"}},"restrictions":{}},"posttherapy_n_category":{"description":{"left":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"dependsOn":{"left":"follow_up.post_therapy_tumour_staging_system","right":"follow_up.posttherapy_tumour_staging_system"},"displayName":{"left":null,"right":"Post-therapy N Category"}},"restrictions":{}},"posttherapy_m_category":{"description":{"left":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"dependsOn":{"left":"follow_up.post_therapy_tumour_staging_system","right":"follow_up.posttherapy_tumour_staging_system"},"displayName":{"left":null,"right":"Post-therapy M Category"}},"restrictions":{}},"posttherapy_stage_group":{"meta":{"dependsOn":{"left":"follow_up.post_therapy_tumour_staging_system","right":"follow_up.posttherapy_tumour_staging_system"},"notes":{"left":"This field value is dependent on the selected posttherapy_tumour_staging_system.","right":"This field is dependent on the selected posttherapy_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications"},"displayName":{"left":null,"right":"Post-therapy Stage Group"}},"restrictions":{}}},"created":{"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate if the follow-up is related to a specific primary diagnosis event in the clinical timeline.","meta":{"validationDependency":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID","primaryId":true},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"Indicate if the follow-up is related to a specific treatment event in the clinical timeline.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"weight_at_followup":{"changeType":"created","description":"Indicate the donor's weight, in kilograms (kg), at the time of follow-up.","name":"weight_at_followup","valueType":"number","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Weight at Follow-Up"}},"anatomic_site_progression_or_recurrence":{"changeType":"created","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"anatomic_site_progression_or_recurrences":{"changeType":"deleted","description":"Indicate the anatomic site where disease progression or recurrence occurred. (Codelist reference: NCI CDE ID: 4742851)","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"],"codeList":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear, pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal; distal","Esophageal; mid","Esophageal; proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck, NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es), maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"]},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","notes":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse."}}}},"immunotherapy":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"immunotherapy_type":{"changeType":"created","name":"immunotherapy_type","valueType":"string","description":"Indicate the type of immunotherapy administered to donor.","meta":{"displayName":"Immunotherapy Type","core":true},"restrictions":{"required":true,"codeList":["Cell-based","Immune checkpoint inhibitors","Monoclonal antibodies other than immune checkpoint inhibitors","Other immunomodulatory substances"]}},"drug_rxnormcui":{"changeType":"created","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"created","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"created","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{}},"surgery":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"created","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"created","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"created","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"created","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"created","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"created","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"created","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"created","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"created","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"created","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"created","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"created","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"created","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"created","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}},"deleted":{}},"exposure":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"created","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"created","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"created","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"created","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"created","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"created","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"created","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"created","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"created","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"created","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"created","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"created","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"created","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}},"deleted":{}},"family_history":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"family_relative_id":{"changeType":"created","description":"Unique identifier of the relative, assigned by the data provider.","name":"family_relative_id","valueType":"string","meta":{"displayName":"Family Relative ID","primaryId":true,"notes":"This field is required to ensure that family members are identified in unique records. Ids can be as simple as an incremented numeral to ensure uniqueness."},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"relative_with_cancer_history":{"changeType":"created","description":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","name":"relative_with_cancer_history","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Relative with Cancer History"}},"relationship_type":{"changeType":"created","description":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","name":"relationship_type","restrictions":{"codeList":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"]},"valueType":"string","meta":{"displayName":"Relationship Type"}},"gender_of_relative":{"changeType":"created","description":"The self-reported gender of related individual.","name":"gender_of_relative","restrictions":{"codeList":["Female","Male","Other","Unknown"]},"valueType":"string","meta":{"displayName":"Gender of Relative"}},"age_of_relative_at_diagnosis":{"changeType":"created","description":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","name":"age_of_relative_at_diagnosis","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","displayName":"Age Of Relative At Diagnosis"}},"cancer_type_code_of_relative":{"changeType":"created","name":"cancer_type_code_of_relative","valueType":"string","description":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"examples":"C41.1,C16.9,C00.5,D46.9","dependsOn":"family_history.relative_with_cancer_history","displayName":"Cancer Type Code (ICD-10) of Relative"}},"relative_vital_status":{"changeType":"created","description":"Relative's last known state of living or deceased.","name":"relative_vital_status","restrictions":{"codeList":["Alive","Deceased","Unknown"]},"valueType":"string","meta":{"displayName":"Vital Status of Relative"}},"cause_of_death_of_relative":{"changeType":"created","description":"Indicate the cause of the death of the relative.","name":"cause_of_death_of_relative","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]},"valueType":"string","meta":{"dependsOn":"family_history.relative_vital_status","displayName":"Cause of Death of Relative"}},"relative_survival_time":{"changeType":"created","description":"Indicate how long, in days, the relative survived from the time they were diagnosed with cancer.","name":"relative_survival_time","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","units":"days","displayName":"Survival Time Of Relative"}}},"deleted":{}},"biomarker":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"created","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"created","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"created","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"created","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"created","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"created","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"created","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"created","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"created","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"created","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"created","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"created","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"created","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"created","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"created","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"created","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"created","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"created","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"created","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}},"deleted":{}},"comorbidity":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"created","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"created","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"created","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"created","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"created","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"created","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}},"deleted":{}}}} diff --git a/website/static/data/schemas/diffs/0.6/0.6-diff-1.24.json b/website/static/data/schemas/diffs/0.6/0.6-diff-1.24.json new file mode 100644 index 00000000..96dea50b --- /dev/null +++ b/website/static/data/schemas/diffs/0.6/0.6-diff-1.24.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"program_id":{"meta":{"examples":{"left":"PACA-AU,BR-CA","right":"TEST-CA"},"notes":{"left":null,"right":"This is the unique id that is assigned to your program. If you have logged into the platform, this is the Program Id that you see in the Program Services area. For example, TEST-CA is a Program ID."},"displayName":{"left":null,"right":"Program ID"}}},"submitter_donor_id":{"meta":{"displayName":{"left":null,"right":"Submitter Donor ID"}}},"gender":{"meta":{"displayName":{"left":null,"right":"Gender"}}},"submitter_specimen_id":{"meta":{"displayName":{"left":null,"right":"Submitter Specimen ID"}}},"specimen_tissue_source":{"meta":{"displayName":{"left":null,"right":"Specimen Tissue Source"}}},"tumour_normal_designation":{"meta":{"displayName":{"left":null,"right":"Tumour Normal Designation"}}},"specimen_type":{"meta":{"displayName":{"left":null,"right":"Specimen Type"}},"restrictions":{"codeList":{"left":["Normal","Normal - tissue adjacent to primary tumour","Primary tumour","Primary tumour - adjacent to normal","Primary tumour - additional new primary","Recurrent tumour","Metastatic tumour","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour - additional metastatic","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line","Cell line - derived from xenograft tumour","Cell line - derived from tumour","Cell line - derived from normal"],"right":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"],"deleted":[]}},"script":{"left":["(function validate() {\n\n const row = $row;\n let result = {valid: true, message: \"Ok\"};\n \n const designation = row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\"){\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when tumour_normal_designation is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when tumour_normal_designation is set to Tumour.\"};\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"]}}},"submitter_sample_id":{"meta":{"displayName":{"left":null,"right":"Submitter Sample ID"}}},"sample_type":{"meta":{"displayName":{"left":null,"right":"Sample Type"}}}},"created":{},"deleted":{}},"donor":{"updated":{"program_id":{"meta":{"displayName":{"left":null,"right":"Program ID"}}},"submitter_donor_id":{"meta":{"displayName":{"left":null,"right":"Submitter Donor ID"}}},"vital_status":{"meta":{"displayName":{"left":null,"right":"Vital Status"}},"restrictions":{"codeList":{"left":["Alive","Deceased","Unknown"],"right":["Alive","Deceased"],"data":{"added":[],"deleted":["Unknown"]}}}},"cause_of_death":{"meta":{"displayName":{"left":null,"right":"Cause of Death"}},"restrictions":{"codeList":{"left":["Died of cancer","Died of other reasons"],"right":["Died of cancer","Died of other reasons","Unknown"],"data":{"added":["Unknown"],"deleted":[]}},"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]}}},"survival_time":{"meta":{"displayName":{"left":null,"right":"Survival Time"}},"restrictions":{"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"height":{"valueType":{"left":"integer","right":"number"},"meta":{},"restrictions":{}},"weight":{"valueType":{"left":"integer","right":"number"},"meta":{},"restrictions":{}},"bmi":{"valueType":{"left":"integer","right":"number"},"meta":{},"restrictions":{}},"menopause_status":{"description":{"left":"Indicate the donor's menopause status at the time of primary diagnosis. (Codelist reference: NCI CDE ID: 2434914)","right":"Indicate the donor's menopause status at the time of primary diagnosis. (Reference: caDSR CDE ID 2434914)"},"meta":{},"restrictions":{"codeList":{"left":["Premenopausal","Perimenopausal","Postmenopausal","Indeterminate or unknown","Not applicable"],"right":["Not applicable","Perimenopausal","Postmenopausal","Premenopausal","Unknown"],"data":{"added":["Unknown"],"deleted":["Indeterminate or unknown"]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age of menarche, the first occurrence of menstruation.","right":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)"},"meta":{},"restrictions":{}},"number_of_pregnancies":{"description":{"left":"Indicate the number of pregnancies a donor has had.","right":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)"},"meta":{},"restrictions":{}},"number_of_children":{"description":{"left":"Indicate the number of children the donor has birthed.","right":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)"},"meta":{},"restrictions":{}}},"created":{"primary_site":{"changeType":"created","name":"primary_site","valueType":"string","isArray":true,"description":"The text term used to describe the primary site of disease, as categorized by the World Health Organization's (WHO) International Classification of Diseases for Oncology (ICD-O). This categorization groups cases into general categories.","meta":{"displayName":"Primary Site","core":true,"notes":"To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Breast|Ovary"},"restrictions":{"required":true,"codeList":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"]}},"genetic_disorders":{"changeType":"created","description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},"hrt_type":{"changeType":"created","description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},"hrt_duration":{"changeType":"created","description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},"contraception_type":{"changeType":"created","description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},"contraception_duration":{"changeType":"created","description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},"lost_to_followup_after_clinical_event_id":{"changeType":"created","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}},"deleted":{"prior_malignancy":{"changeType":"deleted","description":"Prior malignancy affecting donor.","name":"prior_malignancy","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string"},"cancer_type_prior_malignancy":{"changeType":"deleted","description":"ICD-10 diagnostic code for type of cancer in a prior malignancy.","name":"cancer_type_prior_malignancy","restrictions":{"regex":"[A-Z]{1}[0-9]{2}.[0-9]{0,3}[A-Z]{0,1}$"},"valueType":"string"},"age_at_prior_malignancy":{"changeType":"deleted","description":"If donor has history of prior malignancy, indicate age at previous diagnosis, in years.","name":"age_at_prior_malignancy","valueType":"integer"},"laterality_of_prior_malignancy":{"changeType":"deleted","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis.","name":"laterality_of_prior_malignancy","valueType":"string"}}},"specimen":{"updated":{"program_id":{"meta":{"displayName":{"left":null,"right":"Program ID"}}},"submitter_donor_id":{"meta":{"displayName":{"left":null,"right":"Submitter Donor ID"}}},"submitter_specimen_id":{"meta":{"displayName":{"left":null,"right":"Submitter Specimen ID"}}},"pathological_tumour_staging_system":{"meta":{"validationDependency":{"left":null,"right":true},"displayName":{"left":null,"right":"Pathological Tumour Staging System"}},"restrictions":{"script":{"left":["(function validate() {\n\n let result = {valid: true, message: \"Ok\"};\n \n /* This is not a required field, so first ensure that it exists */\n if ($field){\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name.trim().toLowerCase().split('_tumour_staging_system')[0];\n /* Perform validation only if an AJCC value was selected */\n if (/^(AJCC)\\b/i.test($field)){\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`\n ];\n const convertedRow = Object.fromEntries(Object.entries($row).map(([fieldName,fieldVal]) => [fieldName.toLowerCase(), fieldVal]));\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(field => Object.keys(convertedRow).includes(field) && (!convertedRow[field] || checkforEmpty(convertedRow[field])))\n if (emptyFields.length){\n result = {valid: false, \"message\": `The following fields are required when ${$name} is set to an AJCC option: ${emptyFields}`};\n }\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"deleted":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"]}}}},"pathological_t_category":{"meta":{"displayName":{"left":null,"right":"Pathological T Category"}},"restrictions":{}},"pathological_n_category":{"meta":{"displayName":{"left":null,"right":"Pathological N Category"}},"restrictions":{}},"pathological_m_category":{"meta":{"displayName":{"left":null,"right":"Pathological M Category"}},"restrictions":{}},"pathological_stage_group":{"description":{"left":"Specify the tumour stage, based on tumor_staging_system, used to assess the cancer at the time the tumour specimen was resected.","right":"Specify the tumour stage, based on pathological_tumour_staging_system, used to assess the cancer at the time the tumour specimen was resected."},"meta":{"notes":{"left":"This field depends on the selected pathological staging system, and is only required if the specimen is a tumour.","right":"This field depends on the selected pathological_tumour_staging_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications"},"displayName":{"left":null,"right":"Pathological Stage Group"}},"restrictions":{}},"specimen_acquisition_interval":{"meta":{"notes":{"left":null,"right":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."},"displayName":{"left":null,"right":"Specimen Acquisition Interval"}}},"tumour_histological_type":{"description":{"left":"The code to represent the histology (morphology) of neoplasms that is usually obtained from a pathology report, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Please refer to the guidelines provided in the ICD-O-3 manual at https://apps.who.int/iris/handle/10665/42344.","right":"The code to represent the histology (morphology) of neoplasms that is usually obtained from a pathology report, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344."},"meta":{"validationDependency":{"left":null,"right":true},"displayName":{"left":null,"right":"Tumour Histological Type"}}},"specimen_anatomic_location":{"description":{"left":"Anatomic location of a specimen when it was collected.","right":"Indicate the ICD-O-3 topography code for the anatomic location of a specimen when it was collected. Refer to the guidelines provided in the ICD-O-3 manual at https://apps.who.int/iris/handle/10665/42344."},"meta":{"displayName":{"left":null,"right":"Specimen Anatomic Location"},"examples":{"left":null,"right":"C50.1,C18"}},"restrictions":{"codeList":{"left":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear, pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal; distal","Esophageal; mid","Esophageal; proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck, NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es), maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"],"data":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear, pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal; distal","Esophageal; mid","Esophageal; proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck, NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es), maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"]},"regex":{"left":null,"right":"^[C][0-9]{2}(.[0-9]{1})?$"}}},"specimen_processing":{"meta":{},"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation, other","Formalin fixed & paraffin embedded","Formalin fixed, buffered","Formalin fixed, unbuffered","Fresh","Other"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"data":{"added":["Cryopreservation - other","Formalin fixed - buffered","Formalin fixed - unbuffered","Unknown"],"deleted":["Cryopreservation, other","Formalin fixed, buffered","Formalin fixed, unbuffered"]}}}},"specimen_storage":{"description":{"left":"Indicate the method of specimen storage for specimens that were not extracted freshly or immediately cultured.","right":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured."},"meta":{"displayName":{"left":null,"right":"Specimen Storage"}},"restrictions":{"codeList":{"left":["Cut slide","Frozen, -70 freezer","Frozen, liquid nitrogen","Frozen, vapor phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"data":{"added":["Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Unknown"],"deleted":["Frozen, -70 freezer","Frozen, liquid nitrogen","Frozen, vapor phase"]}}}},"tumour_grading_system":{"meta":{"validationDependency":{"left":null,"right":true},"displayName":{"left":null,"right":"Tumour Grading System"}},"restrictions":{"codeList":{"left":["Default","Gleason","Nottingham","Brain cancer","ISUP","Lymphoid neoplasms"],"right":["FNCLCC grading system","Four-tier grading system","Gleason grade group system","Grading system for GISTs","Grading system for GNETs","ISUP grading system","Nuclear grading system for DCIS","Scarff-Bloom-Richardson grading system","Three-tier grading system","Two-tier grading system","WHO grading system for CNS tumours"],"data":{"added":["FNCLCC grading system","Four-tier grading system","Gleason grade group system","Grading system for GISTs","Grading system for GNETs","ISUP grading system","Nuclear grading system for DCIS","Scarff-Bloom-Richardson grading system","Three-tier grading system","Two-tier grading system","WHO grading system for CNS tumours"],"deleted":["Default","Gleason","Nottingham","Brain cancer","ISUP","Lymphoid neoplasms"]}}}},"tumour_grade":{"meta":{"notes":{"left":"This field depends on the selected tumour grading system, and is only required if the specimen is a tumour.","right":"This field depends on the selected tumour_grading_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Grading Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-grading-classifications"},"displayName":{"left":null,"right":"Tumour Grade"}},"restrictions":{"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'default':\n codeList = [\n 'gx - cannot be assessed',\n 'g1 well differentiated/low grade',\n 'g2 moderately differentiated/intermediated grade',\n 'g3 poorly differentiated/high grade',\n 'g4 undifferentiated/high grade',\n ];\n break;\n case 'gleason':\n codeList = [\n 'gleason x: gleason score cannot be determined',\n 'gleason 2–6: the tumor tissue is well differentiated',\n 'gleason 7: the tumor tissue is moderately differentiated',\n 'gleason 8–10: the tumor tissue is poorly differentiated or undifferentiated',\n ];\n break;\n case 'nottingham':\n codeList = [\n 'g1 (low grade or well differentiated)',\n 'g2 (intermediate grade or moderately differentiated)',\n 'g3 (high grade or poorly differentiated)',\n ];\n break;\n case 'brain cancer':\n codeList = ['grade i', 'grade ii', 'grade iii', 'grade iv'];\n break;\n case 'isup for renal cell carcinoma':\n codeList = [\n 'grade 1: tumor cell nucleoli invisible or small and basophilic at 400 x magnification',\n 'grade 2: tumor cell nucleoli conspicuous at 400 x magnification but inconspicuous at 100 x magnification',\n 'grade 3: tumor cell nucleoli eosinophilic and clearly visible at 100 x magnification',\n 'grade 4: tumors showing extreme nuclear pleomorphism and/or containing tumor giant cells and/or the presence of any proportion of tumor showing sarcomatoid and/or rhabdoid dedifferentiation',\n ];\n break;\n case 'lymphoid neoplasms':\n codeList = ['low grade or indolent nhl', 'high grade or aggressive nhl'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]},"codeList":{"right":["Low grade","High grade","GX","G1","G2","G3","G4","Low","High","Grade I","Grade II","Grade III","Grade IV","Grade Group 1","Grade Group 2","Grade Group 3","Grade Group 4","Grade Group 5"],"data":["Low grade","High grade","GX","G1","G2","G3","G4","Low","High","Grade I","Grade II","Grade III","Grade IV","Grade Group 1","Grade Group 2","Grade Group 3","Grade Group 4","Grade Group 5"]}}},"percent_tumour_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of infiltration by tumour cells in a specimen.","right":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)"},"meta":{"displayName":{"left":null,"right":"Percent Tumour Cells"}},"restrictions":{}},"percent_proliferating_cells":{"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."},"displayName":{"left":null,"right":"Percent Proliferating Cells"}},"restrictions":{}},"percent_inflammatory_tissue":{"description":{"left":"Indicate a value, in decimals, that represents local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue.","right":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."},"displayName":{"left":null,"right":"Percent Inflammatory Tissue"}},"restrictions":{}},"percent_stromal_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a malignant tumour specimen but are not malignant such as fibroblasts, vascular structures, etc.","right":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."},"displayName":{"left":null,"right":"Percent Stromal Cells"}},"restrictions":{}},"percent_necrosis":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of cell death in a malignant tumour specimen.","right":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."},"displayName":{"left":null,"right":"Percent Necrosis"}},"restrictions":{}}},"created":{"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate the primary diagnosis event in the clinical timeline that this specimen acquisition was related to.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"specimen_laterality":{"changeType":"created","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"reference_pathology_confirmed":{"changeType":"created","name":"reference_pathology_confirmed","description":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)","valueType":"string","meta":{"validationDependency":true,"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Reference Pathology Confirmed"},"restrictions":{"codeList":["Yes","No","Unknown"]}},"percent_tumour_cells_measurement_method":{"changeType":"created","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}},"deleted":{"central_pathology_confirmed":{"changeType":"deleted","name":"central_pathology_confirmed","description":"Indicate whether the histologic description of tissue or cells was confirmed by a pathology review of frozen or formalin fixed slide(s) completed after the diagnostic pathology review of the tumour sample used to extract analyte(s).","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour."},"restrictions":{"codeList":["Yes","No","Unknown"]}}}},"primary_diagnosis":{"updated":{"program_id":{"meta":{"displayName":{"left":null,"right":"Program ID"}}},"submitter_donor_id":{"meta":{"displayName":{"left":null,"right":"Submitter Donor ID"}}},"age_at_diagnosis":{"description":{"left":"Age that the donor was first diagnosed with cancer, in years.","right":"Age that the donor was first diagnosed with cancer, in years. This should be based on the earliest diagnosis of cancer."},"meta":{"displayName":{"left":null,"right":"Age at Diagnosis"}},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0,"max":90}}}},"cancer_type_code":{"description":{"left":"The code to represent the cancer type using the WHO ICD-10 code (https://icd.who.int/browse10/2016/en#/) classification.","right":"The code to represent the cancer type using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification."},"meta":{"examples":{"left":"C41.1,C16.9,C00.543A","right":"C41.1,C16.9,C00.5,D46.9"},"displayName":{"left":null,"right":"Cancer Type Code"}},"restrictions":{"regex":{"left":"^C[0-9]{2}.[0-9]{0,3}[A-Z]{0,1}$","right":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"}}},"number_lymph_nodes_positive":{"description":{"left":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: NCI CDE ID: 6113694)","right":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: caDSR CDE ID 6113694)"},"meta":{"displayName":{"left":null,"right":"Number Of Lymph Nodes Positive"},"dependsOn":{"left":null,"right":"primary_diagnosis.lymph_nodes_examined_status"},"notes":{"left":null,"right":"This field is only required if 'lymph_nodes_examined_status' is 'Yes'."}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"]},"range":{"left":null,"right":{"min":0}}}},"number_lymph_nodes_examined":{"description":{"left":"The total number of lymph nodes tested for the presence of cancer. (Reference: NCI CDE ID: 3)","right":"The total number of lymph nodes tested for the presence of cancer. (Reference: caDSR CDE ID 3)"},"meta":{},"restrictions":{}},"clinical_tumour_staging_system":{"meta":{"validationDependency":{"left":null,"right":true},"displayName":{"left":null,"right":"Clinical Tumour Staging System"}},"restrictions":{"script":{"left":["(function validate() {\n\n let result = {valid: true, message: \"Ok\"};\n \n /* This is not a required field, so first ensure that it exists */\n if ($field){\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name.trim().toLowerCase().split('_tumour_staging_system')[0];\n /* Perform validation only if an AJCC value was selected */\n if (/^(AJCC)\\b/i.test($field)){\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`\n ];\n const convertedRow = Object.fromEntries(Object.entries($row).map(([fieldName,fieldVal]) => [fieldName.toLowerCase(), fieldVal]));\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(field => Object.keys(convertedRow).includes(field) && (!convertedRow[field] || checkforEmpty(convertedRow[field])))\n if (emptyFields.length){\n result = {valid: false, \"message\": `The following fields are required when ${$name} is set to an AJCC option: ${emptyFields}`};\n }\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"required":{"left":true,"right":null},"codeList":{"left":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"deleted":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"]}}}},"clinical_stage_group":{"description":{"left":"Stage group of the tumour, as assigned by the reporting tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.).","right":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage."},"meta":{"notes":{"left":null,"right":"This field is dependent on the selected clinical_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications"},"displayName":{"left":null,"right":"Clinical Stage Group"},"examples":{"left":null,"right":"Stage I, Stage IIB"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"clinical_t_category":{"meta":{"displayName":{"left":null,"right":"Clinical T Category"}},"restrictions":{}},"clinical_n_category":{"description":{"left":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"displayName":{"left":null,"right":"Clinical N Category"}},"restrictions":{}},"clinical_m_category":{"description":{"left":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned.","right":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned."},"meta":{"displayName":{"left":null,"right":"Clinical M Category"}},"restrictions":{}},"presenting_symptoms":{"meta":{},"restrictions":{"codeList":{"left":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Nausea","None","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Unknown","Vomiting","Weight Loss"],"right":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Loss of Appetite","Nausea","None","Not Reported","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Swelling in the Neck","Unknown","Vomiting","Weight Loss"],"data":{"added":["Loss of Appetite","Not Reported","Swelling in the Neck"],"deleted":[]}}}},"performance_status":{"description":{"left":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference source: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status).","right":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status)."},"meta":{"notes":{"left":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction \n Grade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work) \n Grade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours \n Grade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours \n Grade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair","right":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction.\nGrade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work).\nGrade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours.\nGrade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours.\nGrade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair"},"displayName":{"left":null,"right":"Performance Status"}},"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}}},"created":{"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Unique identifier of the primary diagnosis event, assigned by the data provider.","meta":{"primaryId":true,"displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"cancer_type_additional_information":{"changeType":"created","name":"cancer_type_additional_information","valueType":"string","description":"Additional details related to the cancer type that are not covered by the ICD-10 code provided in the cancer_type field.","meta":{"displayName":"Cancer Type Additional Information"}},"basis_of_diagnosis":{"changeType":"created","name":"basis_of_diagnosis","description":"Indicate the most valid basis of how the primary diagnosis was identified. If more than one diagnosis technique was used, select the term that has the highest code number (see notes). (Reference: IACR Standard for Basis of Diagnosis http://www.iacr.com.fr/images/doc/basis.pdf)","restrictions":{"codeList":["Clinical investigation","Clinical","Cytology","Death certificate only","Histology of a metastasis","Histology of a primary tumour","Specific tumour markers","Unknown"]},"valueType":"string","meta":{"notes":"0: Death certificate only: Information provided is from a death certificate.\n1: Clinical: Diagnosis made before death.\n2: Clinical investigation: All diagnostic techniques, including X-ray, endoscopy, imaging, ultrasound, exploratory surgery (such as laparotomy), and autopsy, without a tissue diagnosis.\n4: Specific tumour markers: Including biochemical and/or immunologic markers that are specific for a tumour site.\n5: Cytology: Examination of cells from a primary or secondary site, including fluids aspirated by endoscopy or needle; also includes the microscopic examination of peripheral blood and bone marrow aspirates.\n6: Histology of a metastasis: Histologic examination of tissue from a metastasis, including autopsy specimens.\n7: Histology of a primary tumour: Histologic examination of tissue from primary tumour, however obtained, including all cutting techniques and bone marrow biopsies; also includes autopsy specimens of primary tumour.\n9: Unknown: No information on how the diagnosis has been made.","displayName":"Basis of Diagnosis"}},"laterality":{"changeType":"created","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_status":{"changeType":"created","name":"lymph_nodes_examined_status","description":"Indicate if lymph nodes were examined for metastases.","valueType":"string","restrictions":{"required":true,"codeList":["Cannot be determined","No","No lymph nodes found in resected specimen","Not applicable","Yes"]},"meta":{"core":true,"displayName":"Lymph Nodes Examined Status"}},"lymph_nodes_examined_method":{"changeType":"created","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}},"deleted":{"stage_suffix":{"changeType":"deleted","name":"stage_suffix","description":"If necessary, use this field to add any applicable stage suffixes. Stage suffixes may apply to certain staging systems such as Ann Arbour staging system where the four stages are divided into 4 categories (A, B, X and E).","valueType":"string","meta":{"core":true,"dependsOn":"primary_diagnosis.clinical_tumour_staging_system"}}}},"treatment":{"updated":{"program_id":{"meta":{"displayName":{"left":null,"right":"Program ID"}}},"submitter_donor_id":{"meta":{"displayName":{"left":null,"right":"Submitter Donor ID"}}},"submitter_treatment_id":{"meta":{"displayName":{"left":null,"right":"Submitter Treatment ID"}}},"treatment_type":{"meta":{"notes":{"left":"Depending on the treatment_type selected, additional treament details may be required to be submitted.","right":"Depending on the treatment_type(s) selected, additional treatment details may be required to be submitted. For example, if treatment_type includes 'Chemotherapy', the supplemental Chemotherapy treatment type file is required.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."},"displayName":{"left":null,"right":"Treatment Type"},"examples":{"left":null,"right":"Chemotherapy|Hormonal therapy"}},"restrictions":{"codeList":{"left":["Chemotherapy","Ablation","Bone marrow transplant","Combined chemo+immunotherapy","Combined chemo+radiation therapy","Combined chemo-radiotherapy and surgery","Endoscopic therapy","Hormonal therapy","Immunotherapy","Monoclonal antibodies (for liquid tumours)","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgical resection"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":["End of life care","Surgery"],"deleted":["Combined chemo+immunotherapy","Combined chemo+radiation therapy","Combined chemo-radiotherapy and surgery","Monoclonal antibodies (for liquid tumours)","Surgical resection"]}}}},"is_primary_treatment":{"description":{"left":"Indicate if the treamtment was the primary treatment following the initial diagnosis.","right":"Indicate if the treatment was the primary treatment following the initial diagnosis."},"meta":{"displayName":{"left":null,"right":"Is Primary Treatment"},"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Yes","No","Unknown"],"right":["Yes","No"],"data":{"added":[],"deleted":["Unknown"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_start_interval":{"description":{"left":"The interval between primary diagnosis and initiation of treatment, in days.","right":"The interval between the primary diagnosis and initiation of treatment, in days."},"meta":{"notes":{"left":null,"right":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."},"displayName":{"left":null,"right":"Treatment Start Interval"},"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_duration":{"description":{"left":"The duration of treatment regimen, in days","right":"The duration of treatment regimen, in days."},"meta":{"displayName":{"left":null,"right":"Treatment Duration"},"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}}},"created":{"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate the primary diagnosis event in the clinical timeline that this treatment was related to.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"line_of_treatment":{"changeType":"created","name":"line_of_treatment","description":"Indicate the line of treatment if it is not the primary treatment.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Line Of treatment","dependsOn":"treatment.is_primary_treatment","examples":"2,3,4"}},"days_per_cycle":{"changeType":"created","name":"days_per_cycle","description":"Indicate the number of days in a treatment cycle.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Days Per Cycle","dependsOn":"treatment.treatment_type"}},"number_of_cycles":{"changeType":"created","name":"number_of_cycles","description":"Indicate the number of treatment cycles.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Number Of Cycles","dependsOn":"treatment.treatment_type"}},"treatment_intent":{"changeType":"created","name":"treatment_intent","description":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"]},"meta":{"core":true,"displayName":"Treatment Intent","dependsOn":"treatment.treatment_type"}},"treatment_setting":{"changeType":"created","name":"treatment_setting","description":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: NCIt C124308)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"]},"meta":{"core":true,"displayName":"Treatment Setting","dependsOn":"treatment.treatment_type"}},"response_to_treatment_criteria_method":{"changeType":"created","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},"response_to_treatment":{"changeType":"created","name":"response_to_treatment","description":"The donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"codeList":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"]},"meta":{"core":true,"displayName":"Response To Treatment","dependsOn":"treatment.response_to_treatment_criteria_method","notes":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"outcome_of_treatment":{"changeType":"created","name":"outcome_of_treatment","description":"Indicate the donor's outcome of the prescribed treatment.","valueType":"string","restrictions":{"codeList":["Treatment completed as prescribed","Treatment incomplete due to technical or organizational problems","Treatment incomplete because patient died","Patient choice (stopped or interrupted treatment)","Physician decision (stopped or interrupted treatment)","Treatment stopped due to lack of efficacy (disease progression)","Treatment stopped due to acute toxicity","Other","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Outcome Of Treatment","dependsOn":"treatment.treatment_type"}},"toxicity_type":{"changeType":"created","name":"toxicity_type","description":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity.","valueType":"string","restrictions":{"codeList":["Hematological","Non-hematological","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Toxicity Type","dependsOn":"treatment.outcome_of_treatment"}},"hematological_toxicity":{"changeType":"created","name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"non-hematological_toxicity":{"changeType":"created","name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"adverse_events":{"changeType":"created","name":"adverse_events","description":"Report any treatment related adverse events. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Adverse Events","dependsOn":"treatment.treatment_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"clinical_trials_database":{"changeType":"created","name":"clinical_trials_database","description":"If the donor is a participant in a clinical trial, indicate the clinical trial database where the clinical trial is registered.","valueType":"string","meta":{"display name":"Clinical Trials Database","notes":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added."},"restrictions":{"codeList":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"]}},"clinical_trial_number":{"changeType":"created","name":"clinical_trial_number","description":"Based on the clinical_trial_database, indicate the unique NCT or EudraCT clinical trial identifier of which the donor is a participant.","valueType":"string","meta":{"display name":"Clinical Trial Number","dependsOn":"treatment.clinical_trials_database","examples":"2016-002120-83,NCT02465060"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"]}}},"deleted":{"age_at_consent_for_treatment":{"changeType":"deleted","name":"age_at_consent_for_treatment","description":"Indicate the age of donor when consent was given for treatment.","valueType":"integer"},"therapeutic_intent":{"changeType":"deleted","name":"therapeutic_intent","description":"The therapeutic intent, the reason behind the choice of a therapy, of the treatment.","valueType":"string","restrictions":{"required":true,"codeList":["Adjuvant","Concurrent","Curative","Neoadjuvant","Not applicable","Palliative","Unknown"]},"meta":{"core":true}},"response_to_therapy":{"changeType":"deleted","name":"response_to_therapy","description":"The donors's response to the applied treatment regimen. (Source: RECIST)","valueType":"string","restrictions":{"required":true,"codeList":["Complete response","Disease progression","NED","Partial response","Stable disease"]},"meta":{"core":true}}}},"chemotherapy":{"updated":{"program_id":{"meta":{"displayName":{"left":null,"right":"Program ID"}}},"submitter_donor_id":{"meta":{"displayName":{"left":null,"right":"Submitter Donor ID"}}},"submitter_treatment_id":{"meta":{"displayName":{"left":null,"right":"Submitter Treatment ID"}}}},"created":{"drug_rxnormcui":{"changeType":"created","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"created","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"created","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"created","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"created","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"created","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}},"deleted":{"chemotherapy_drug_name":{"changeType":"deleted","name":"chemotherapy_drug_name","description":"Name of agent or drug administered to patient as part of the chemotherapy treatment regimen.","valueType":"string","restrictions":{"required":true,"codeList":["Placeholder list 1","Need list","Still need it"]},"meta":{"validationDependency":true,"core":true,"notes":"This field uses a controlled vocabulary gathered from the DrugBank database of drug names.","examples":"Allopurinol, Dronabinol, Sucralfate, Lapatinib"}},"chemotherapy_dosage_units":{"changeType":"deleted","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m²","IU/m²","µg/m²","g/m²","mg/kg"]},"meta":{"core":true}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate the total drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"integer","restrictions":{"required":true},"meta":{"core":true}}}},"hormone_therapy":{"updated":{"program_id":{"meta":{"displayName":{"left":null,"right":"Program ID"}}},"submitter_donor_id":{"meta":{"displayName":{"left":null,"right":"Submitter Donor ID"}}},"submitter_treatment_id":{"meta":{"displayName":{"left":null,"right":"Submitter Treatment ID"}}}},"created":{"drug_rxnormcui":{"changeType":"created","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"created","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Hormone Therapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"created","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{"hormone_therapy_drug_name":{"changeType":"deleted","name":"hormone_therapy_drug_name","description":"Name of agent or drug administered to patient as part of the hormone therapy treatment regimen.","valueType":"string","restrictions":{"required":true,"codeList":["Placeholder list 1","Need list","Still need it"]},"meta":{"validationDependency":true,"core":true,"notes":"This field uses a controlled vocabulary gathered from the DrugBank database of drug names."}},"hormone_drug_dosage_units":{"changeType":"deleted","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m²","IU/m²","µg/m²","g/m²","mg/kg"]},"meta":{"core":true}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"integer","restrictions":{"required":true},"meta":{"core":true}}}},"radiation":{"updated":{"program_id":{"meta":{"displayName":{"left":null,"right":"Program ID"}}},"submitter_donor_id":{"meta":{"displayName":{"left":null,"right":"Submitter Donor ID"}}},"submitter_treatment_id":{"meta":{"displayName":{"left":null,"right":"Submitter Treatment ID"}}},"radiation_therapy_modality":{"meta":{"displayName":{"left":null,"right":"Radiation Therapy Modality"}}},"radiation_therapy_fractions":{"description":{"left":"Indicate the number of total fractions delivered as part of treatment.","right":"Indicate the total number of fractions delivered as part of treatment."},"meta":{"displayName":{"left":null,"right":"Radiation Therapy Fractions"}},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"radiation_therapy_dosage":{"valueType":{"left":"integer","right":"number"},"meta":{"displayName":{"left":null,"right":"Radiation Therapy Dosage"}},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"anatomical_site_irradiated":{"description":{"left":"Indicate localization site where radiation therapy was administered.","right":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)"},"meta":{"displayName":{"left":null,"right":"Anatomical Site Irradiated"}},"restrictions":{"codeList":{"left":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"right":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"data":{"added":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"],"deleted":["Bone","Extremities","Head-Neck","Peritoneum"]}}}}},"created":{"radiation_therapy_type":{"changeType":"created","name":"radiation_therapy_type","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal"]},"meta":{"core":true,"displayName":"Type of Radiation Therapy","notes":"Internal application includes Brachytherapy."}},"radiation_boost":{"changeType":"created","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"created","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}},"deleted":{"application_form":{"changeType":"deleted","name":"application_form","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal (including Brachytherapy)"]},"meta":{"core":true}}}},"follow_up":{"updated":{"program_id":{"meta":{"displayName":{"left":null,"right":"Program ID"}}},"submitter_donor_id":{"meta":{"displayName":{"left":null,"right":"Submitter Donor ID"}}},"submitter_follow_up_id":{"description":{"left":"Unique identifier for a follow-up event in a donors clincal record, assigned by the data provider.","right":"Unique identifier for a follow-up event in a donor's clinical record, assigned by the data provider."},"meta":{"displayName":{"left":null,"right":"Submitter Follow-Up ID"}}},"interval_of_followup":{"description":{"left":"Interval from the primary diagnosis date to the follow up date, in days.","right":"Interval from the primary diagnosis date to the follow-up date, in days."},"meta":{"displayName":{"left":null,"right":"Interval Of Follow-Up"},"notes":{"left":null,"right":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}}},"disease_status_at_followup":{"description":{"left":"Indicate the donor's disease status at time of follow-up.","right":"Indicate the donor's disease status at time of follow-up. (Reference: RECIST)"},"meta":{"displayName":{"left":null,"right":"Disease Status at Follow-Up"}},"restrictions":{"codeList":{"left":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Relapse","Stable"],"right":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Progression NOS","Relapse or recurrence","Stable"],"data":{"added":["Progression NOS","Relapse or recurrence"],"deleted":["Relapse"]}}}},"relapse_type":{"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."},"displayName":{"left":null,"right":"Relapse Type"}},"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"relapse_interval":{"description":{"left":"If the donor was clinically disease free following primary treatment and then relapse or progression (for liquid tumours) occurred afterwards, then this field will indicate the length of disease free interval, in days.","right":"If the donor was clinically disease free following primary treatment and then relapse or recurrence or progression (for liquid tumours) occurred afterwards, then this field will indicate the length of disease free interval, in days."},"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."},"displayName":{"left":null,"right":"Relapse Interval"}},"restrictions":{"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"]}}},"method_of_progression_status":{"description":{"left":"Indicate the method(s) used to confirm the donor's progression disease status. (Codelist reference: NCI CDE ID: 6161031)","right":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Reference: caDSR CDE ID 6161031)"},"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."},"displayName":{"left":null,"right":"Method Of Progression Status"}},"restrictions":{"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]},"codeList":{"left":["Autopsy","Biomarker in liquid biopsy (e.g. tumor marker in blood or urine)","Biopsy","Blood draw","Bone marrow aspirate","Core biopsy","Cystoscopy","Cytology","Debulking","Diagnostic imaging","Dilation and curettage procedure","Enucleation","Excisional biopsy","Fine needle aspiration","Imaging","Incisional biopsy","Laparoscopy","Laparotomy","Other","Pap Smear","Pathologic review","Physical exam","Surgical resection","Thoracentesis","Ultrasound guided biopsy"],"right":["Biomarker in liquid biopsy (e.g. tumour marker in blood or urine)","Biopsy","Blood draw","Bone marrow aspirate","Core biopsy","Cystoscopy","Cytology","Debulking","Diagnostic imaging","Dilation and curettage procedure","Enucleation","Excisional biopsy","Fine needle aspiration","Imaging","Incisional biopsy","Laparoscopy","Laparotomy","Other","Pap Smear","Pathologic review","Physical exam","Surgical resection","Thoracentesis","Ultrasound guided biopsy"],"data":{"added":["Biomarker in liquid biopsy (e.g. tumour marker in blood or urine)"],"deleted":["Autopsy","Biomarker in liquid biopsy (e.g. tumor marker in blood or urine)"]}}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."},"displayName":{"left":null,"right":"Recurrance Tumour Staging System"}},"restrictions":{"codeList":{"left":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"deleted":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"]}},"script":{"left":["(function validate() {\n\n let result = {valid: true, message: \"Ok\"};\n \n /* This is not a required field, so first ensure that it exists */\n if ($field){\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name.trim().toLowerCase().split('_tumour_staging_system')[0];\n /* Perform validation only if an AJCC value was selected */\n if (/^(AJCC)\\b/i.test($field)){\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`\n ];\n const convertedRow = Object.fromEntries(Object.entries($row).map(([fieldName,fieldVal]) => [fieldName.toLowerCase(), fieldVal]));\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(field => Object.keys(convertedRow).includes(field) && (!convertedRow[field] || checkforEmpty(convertedRow[field])))\n if (emptyFields.length){\n result = {valid: false, \"message\": `The following fields are required when ${$name} is set to an AJCC option: ${emptyFields}`};\n }\n }\n }\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_t_category":{"description":{"left":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":true,"right":null},"displayName":{"left":null,"right":"Recurrence T Category"}},"restrictions":{}},"recurrence_n_category":{"description":{"left":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":true,"right":null},"displayName":{"left":null,"right":"Recurrence N Category"}},"restrictions":{}},"recurrence_m_category":{"description":{"left":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":true,"right":null},"displayName":{"left":null,"right":"Recurrence M Category"}},"restrictions":{}},"recurrence_stage_group":{"description":{"left":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery.","right":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) at the time of retreatment for a recurrence or disease progression."},"meta":{"core":{"left":true,"right":null},"notes":{"left":null,"right":"This field is dependent on the selected recurrence_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications"},"displayName":{"left":null,"right":"Recurrence Stage Group"}},"restrictions":{}},"posttherapy_tumour_staging_system":{"meta":{},"restrictions":{"script":{"left":["(function validate() {\n\n let result = {valid: true, message: \"Ok\"};\n \n /* This is not a required field, so first ensure that it exists */\n if ($field){\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name.trim().toLowerCase().split('_tumour_staging_system')[0];\n /* Perform validation only if an AJCC value was selected */\n if (/^(AJCC)\\b/i.test($field)){\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`\n ];\n const convertedRow = Object.fromEntries(Object.entries($row).map(([fieldName,fieldVal]) => [fieldName.toLowerCase(), fieldVal]));\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(field => Object.keys(convertedRow).includes(field) && (!convertedRow[field] || checkforEmpty(convertedRow[field])))\n if (emptyFields.length){\n result = {valid: false, \"message\": `The following fields are required when ${$name} is set to an AJCC option: ${emptyFields}`};\n }\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"deleted":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"]}}}},"posttherapy_t_category":{"meta":{"dependsOn":{"left":"follow_up.post_therapy_tumour_staging_system","right":"follow_up.posttherapy_tumour_staging_system"},"displayName":{"left":null,"right":"Post-therapy T Category"}},"restrictions":{}},"posttherapy_n_category":{"description":{"left":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"dependsOn":{"left":"follow_up.post_therapy_tumour_staging_system","right":"follow_up.posttherapy_tumour_staging_system"},"displayName":{"left":null,"right":"Post-therapy N Category"}},"restrictions":{}},"posttherapy_m_category":{"description":{"left":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"dependsOn":{"left":"follow_up.post_therapy_tumour_staging_system","right":"follow_up.posttherapy_tumour_staging_system"},"displayName":{"left":null,"right":"Post-therapy M Category"}},"restrictions":{}},"posttherapy_stage_group":{"meta":{"dependsOn":{"left":"follow_up.post_therapy_tumour_staging_system","right":"follow_up.posttherapy_tumour_staging_system"},"notes":{"left":"This field value is dependent on the selected posttherapy_tumour_staging_system.","right":"This field is dependent on the selected posttherapy_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications"},"displayName":{"left":null,"right":"Post-therapy Stage Group"}},"restrictions":{}}},"created":{"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate if the follow-up is related to a specific primary diagnosis event in the clinical timeline.","meta":{"validationDependency":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID","primaryId":true},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"Indicate if the follow-up is related to a specific treatment event in the clinical timeline.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"weight_at_followup":{"changeType":"created","description":"Indicate the donor's weight, in kilograms (kg), at the time of follow-up.","name":"weight_at_followup","valueType":"number","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Weight at Follow-Up"}},"anatomic_site_progression_or_recurrence":{"changeType":"created","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"anatomic_site_progression_or_recurrences":{"changeType":"deleted","description":"Indicate the anatomic site where disease progression or recurrence occurred. (Codelist reference: NCI CDE ID: 4742851)","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"],"codeList":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear, pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal; distal","Esophageal; mid","Esophageal; proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck, NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es), maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"]},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","notes":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse."}}}},"immunotherapy":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"immunotherapy_type":{"changeType":"created","name":"immunotherapy_type","valueType":"string","description":"Indicate the type of immunotherapy administered to donor.","meta":{"displayName":"Immunotherapy Type","core":true},"restrictions":{"required":true,"codeList":["Cell-based","Immune checkpoint inhibitors","Monoclonal antibodies other than immune checkpoint inhibitors","Other immunomodulatory substances"]}},"drug_rxnormcui":{"changeType":"created","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"created","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"created","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{}},"surgery":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"created","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"created","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"created","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"created","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"created","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"created","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"created","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"created","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"created","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"created","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"created","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"created","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"created","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"created","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}},"deleted":{}},"exposure":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"created","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"created","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"created","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"created","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"created","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"created","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"created","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"created","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"created","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"created","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"created","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"created","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"created","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}},"deleted":{}},"family_history":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"family_relative_id":{"changeType":"created","description":"Unique identifier of the relative, assigned by the data provider.","name":"family_relative_id","valueType":"string","meta":{"displayName":"Family Relative ID","primaryId":true,"notes":"This field is required to ensure that family members are identified in unique records. Ids can be as simple as an incremented numeral to ensure uniqueness."},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"relative_with_cancer_history":{"changeType":"created","description":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","name":"relative_with_cancer_history","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Relative with Cancer History"}},"relationship_type":{"changeType":"created","description":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","name":"relationship_type","restrictions":{"codeList":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"]},"valueType":"string","meta":{"displayName":"Relationship Type"}},"gender_of_relative":{"changeType":"created","description":"The self-reported gender of related individual.","name":"gender_of_relative","restrictions":{"codeList":["Female","Male","Other","Unknown"]},"valueType":"string","meta":{"displayName":"Gender of Relative"}},"age_of_relative_at_diagnosis":{"changeType":"created","description":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","name":"age_of_relative_at_diagnosis","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","displayName":"Age Of Relative At Diagnosis"}},"cancer_type_code_of_relative":{"changeType":"created","name":"cancer_type_code_of_relative","valueType":"string","description":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"examples":"C41.1,C16.9,C00.5,D46.9","dependsOn":"family_history.relative_with_cancer_history","displayName":"Cancer Type Code (ICD-10) of Relative"}},"relative_vital_status":{"changeType":"created","description":"Relative's last known state of living or deceased.","name":"relative_vital_status","restrictions":{"codeList":["Alive","Deceased","Unknown"]},"valueType":"string","meta":{"displayName":"Vital Status of Relative"}},"cause_of_death_of_relative":{"changeType":"created","description":"Indicate the cause of the death of the relative.","name":"cause_of_death_of_relative","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]},"valueType":"string","meta":{"dependsOn":"family_history.relative_vital_status","displayName":"Cause of Death of Relative"}},"relative_survival_time":{"changeType":"created","description":"Indicate how long, in days, the relative survived from the time they were diagnosed with cancer.","name":"relative_survival_time","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","units":"days","displayName":"Survival Time Of Relative"}}},"deleted":{}},"biomarker":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"created","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"created","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"created","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"created","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"created","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"created","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"created","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"created","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"created","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"created","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"created","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"created","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"created","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"created","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"created","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"created","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"created","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"created","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"created","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}},"deleted":{}},"comorbidity":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"created","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"created","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"created","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"created","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"created","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"created","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}},"deleted":{}}}} diff --git a/website/static/data/schemas/diffs/0.7/0.7-diff-1.24.json b/website/static/data/schemas/diffs/0.7/0.7-diff-1.24.json new file mode 100644 index 00000000..ef7ec304 --- /dev/null +++ b/website/static/data/schemas/diffs/0.7/0.7-diff-1.24.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"program_id":{"meta":{"examples":{"left":"PACA-AU,BR-CA","right":"TEST-CA"},"notes":{"left":null,"right":"This is the unique id that is assigned to your program. If you have logged into the platform, this is the Program Id that you see in the Program Services area. For example, TEST-CA is a Program ID."},"displayName":{"left":null,"right":"Program ID"}}},"submitter_donor_id":{"meta":{"displayName":{"left":null,"right":"Submitter Donor ID"}}},"gender":{"meta":{"displayName":{"left":null,"right":"Gender"}}},"submitter_specimen_id":{"meta":{"displayName":{"left":null,"right":"Submitter Specimen ID"}}},"specimen_tissue_source":{"meta":{"displayName":{"left":null,"right":"Specimen Tissue Source"}}},"tumour_normal_designation":{"meta":{"displayName":{"left":null,"right":"Tumour Normal Designation"}}},"specimen_type":{"meta":{"displayName":{"left":null,"right":"Specimen Type"}},"restrictions":{"codeList":{"left":["Normal","Normal - tissue adjacent to primary tumour","Primary tumour","Primary tumour - adjacent to normal","Primary tumour - additional new primary","Recurrent tumour","Metastatic tumour","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour - additional metastatic","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line","Cell line - derived from xenograft tumour","Cell line - derived from tumour","Cell line - derived from normal"],"right":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"],"deleted":[]}},"script":{"left":["(function validate() {\n\n const row = $row;\n let result = {valid: true, message: \"Ok\"};\n \n const designation = row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\"){\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when tumour_normal_designation is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when tumour_normal_designation is set to Tumour.\"};\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"]}}},"submitter_sample_id":{"meta":{"displayName":{"left":null,"right":"Submitter Sample ID"}}},"sample_type":{"meta":{"displayName":{"left":null,"right":"Sample Type"}}}},"created":{},"deleted":{}},"donor":{"updated":{"program_id":{"meta":{"displayName":{"left":null,"right":"Program ID"}}},"submitter_donor_id":{"meta":{"displayName":{"left":null,"right":"Submitter Donor ID"}}},"vital_status":{"meta":{"displayName":{"left":null,"right":"Vital Status"}},"restrictions":{"codeList":{"left":["Alive","Deceased","Unknown"],"right":["Alive","Deceased"],"data":{"added":[],"deleted":["Unknown"]}}}},"cause_of_death":{"meta":{"displayName":{"left":null,"right":"Cause of Death"}},"restrictions":{"codeList":{"left":["Died of cancer","Died of other reasons"],"right":["Died of cancer","Died of other reasons","Unknown"],"data":{"added":["Unknown"],"deleted":[]}},"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]}}},"survival_time":{"meta":{"displayName":{"left":null,"right":"Survival Time"}},"restrictions":{"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"height":{"valueType":{"left":"integer","right":"number"},"meta":{},"restrictions":{}},"weight":{"valueType":{"left":"integer","right":"number"},"meta":{},"restrictions":{}},"bmi":{"valueType":{"left":"integer","right":"number"},"meta":{},"restrictions":{}},"menopause_status":{"description":{"left":"Indicate the donor's menopause status at the time of primary diagnosis. (Codelist reference: NCI CDE ID: 2434914)","right":"Indicate the donor's menopause status at the time of primary diagnosis. (Reference: caDSR CDE ID 2434914)"},"meta":{},"restrictions":{"codeList":{"left":["Premenopausal","Perimenopausal","Postmenopausal","Indeterminate or unknown","Not applicable"],"right":["Not applicable","Perimenopausal","Postmenopausal","Premenopausal","Unknown"],"data":{"added":["Unknown"],"deleted":["Indeterminate or unknown"]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age of menarche, the first occurrence of menstruation.","right":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)"},"meta":{},"restrictions":{}},"number_of_pregnancies":{"description":{"left":"Indicate the number of pregnancies a donor has had.","right":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)"},"meta":{},"restrictions":{}},"number_of_children":{"description":{"left":"Indicate the number of children the donor has birthed.","right":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)"},"meta":{},"restrictions":{}}},"created":{"primary_site":{"changeType":"created","name":"primary_site","valueType":"string","isArray":true,"description":"The text term used to describe the primary site of disease, as categorized by the World Health Organization's (WHO) International Classification of Diseases for Oncology (ICD-O). This categorization groups cases into general categories.","meta":{"displayName":"Primary Site","core":true,"notes":"To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Breast|Ovary"},"restrictions":{"required":true,"codeList":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"]}},"genetic_disorders":{"changeType":"created","description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},"hrt_type":{"changeType":"created","description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},"hrt_duration":{"changeType":"created","description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},"contraception_type":{"changeType":"created","description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},"contraception_duration":{"changeType":"created","description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},"lost_to_followup_after_clinical_event_id":{"changeType":"created","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}},"deleted":{"prior_malignancy":{"changeType":"deleted","description":"Prior malignancy affecting donor.","name":"prior_malignancy","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string"},"cancer_type_prior_malignancy":{"changeType":"deleted","description":"ICD-10 diagnostic code for type of cancer in a prior malignancy.","name":"cancer_type_prior_malignancy","restrictions":{"regex":"[A-Z]{1}[0-9]{2}.[0-9]{0,3}[A-Z]{0,1}$"},"valueType":"string"},"age_at_prior_malignancy":{"changeType":"deleted","description":"If donor has history of prior malignancy, indicate age at previous diagnosis, in years.","name":"age_at_prior_malignancy","valueType":"integer"},"laterality_of_prior_malignancy":{"changeType":"deleted","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis.","name":"laterality_of_prior_malignancy","valueType":"string"}}},"specimen":{"updated":{"program_id":{"meta":{"displayName":{"left":null,"right":"Program ID"}}},"submitter_donor_id":{"meta":{"displayName":{"left":null,"right":"Submitter Donor ID"}}},"submitter_specimen_id":{"meta":{"displayName":{"left":null,"right":"Submitter Specimen ID"}}},"pathological_tumour_staging_system":{"meta":{"validationDependency":{"left":null,"right":true},"displayName":{"left":null,"right":"Pathological Tumour Staging System"}},"restrictions":{"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(\n field =>\n Object.keys(convertedRow).includes(field) &&\n (!convertedRow[field] || checkforEmpty(convertedRow[field])),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"deleted":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"]}}}},"pathological_t_category":{"meta":{"displayName":{"left":null,"right":"Pathological T Category"}},"restrictions":{}},"pathological_n_category":{"meta":{"displayName":{"left":null,"right":"Pathological N Category"}},"restrictions":{}},"pathological_m_category":{"meta":{"displayName":{"left":null,"right":"Pathological M Category"}},"restrictions":{}},"pathological_stage_group":{"description":{"left":"Specify the tumour stage, based on tumor_staging_system, used to assess the cancer at the time the tumour specimen was resected.","right":"Specify the tumour stage, based on pathological_tumour_staging_system, used to assess the cancer at the time the tumour specimen was resected."},"meta":{"notes":{"left":"This field depends on the selected pathological staging system, and is only required if the specimen is a tumour.","right":"This field depends on the selected pathological_tumour_staging_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications"},"displayName":{"left":null,"right":"Pathological Stage Group"}},"restrictions":{}},"specimen_acquisition_interval":{"meta":{"notes":{"left":null,"right":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."},"displayName":{"left":null,"right":"Specimen Acquisition Interval"}}},"tumour_histological_type":{"description":{"left":"The code to represent the histology (morphology) of neoplasms that is usually obtained from a pathology report, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Please refer to the guidelines provided in the ICD-O-3 manual at https://apps.who.int/iris/handle/10665/42344.","right":"The code to represent the histology (morphology) of neoplasms that is usually obtained from a pathology report, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344."},"meta":{"validationDependency":{"left":null,"right":true},"displayName":{"left":null,"right":"Tumour Histological Type"}}},"specimen_anatomic_location":{"description":{"left":"Anatomic location of a specimen when it was collected.","right":"Indicate the ICD-O-3 topography code for the anatomic location of a specimen when it was collected. Refer to the guidelines provided in the ICD-O-3 manual at https://apps.who.int/iris/handle/10665/42344."},"meta":{"displayName":{"left":null,"right":"Specimen Anatomic Location"},"examples":{"left":null,"right":"C50.1,C18"}},"restrictions":{"codeList":{"left":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear, pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal; distal","Esophageal; mid","Esophageal; proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck, NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es), maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"],"data":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear, pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal; distal","Esophageal; mid","Esophageal; proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck, NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es), maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"]},"regex":{"left":null,"right":"^[C][0-9]{2}(.[0-9]{1})?$"}}},"specimen_processing":{"meta":{},"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation, other","Formalin fixed & paraffin embedded","Formalin fixed, buffered","Formalin fixed, unbuffered","Fresh","Other"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"data":{"added":["Cryopreservation - other","Formalin fixed - buffered","Formalin fixed - unbuffered","Unknown"],"deleted":["Cryopreservation, other","Formalin fixed, buffered","Formalin fixed, unbuffered"]}}}},"specimen_storage":{"description":{"left":"Indicate the method of specimen storage for specimens that were not extracted freshly or immediately cultured.","right":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured."},"meta":{"displayName":{"left":null,"right":"Specimen Storage"}},"restrictions":{"codeList":{"left":["Cut slide","Frozen, -70 freezer","Frozen, liquid nitrogen","Frozen, vapor phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"data":{"added":["Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Unknown"],"deleted":["Frozen, -70 freezer","Frozen, liquid nitrogen","Frozen, vapor phase"]}}}},"tumour_grading_system":{"meta":{"validationDependency":{"left":null,"right":true},"displayName":{"left":null,"right":"Tumour Grading System"}},"restrictions":{"codeList":{"left":["Default","Gleason","Nottingham","Brain cancer","ISUP","Lymphoid neoplasms"],"right":["FNCLCC grading system","Four-tier grading system","Gleason grade group system","Grading system for GISTs","Grading system for GNETs","ISUP grading system","Nuclear grading system for DCIS","Scarff-Bloom-Richardson grading system","Three-tier grading system","Two-tier grading system","WHO grading system for CNS tumours"],"data":{"added":["FNCLCC grading system","Four-tier grading system","Gleason grade group system","Grading system for GISTs","Grading system for GNETs","ISUP grading system","Nuclear grading system for DCIS","Scarff-Bloom-Richardson grading system","Three-tier grading system","Two-tier grading system","WHO grading system for CNS tumours"],"deleted":["Default","Gleason","Nottingham","Brain cancer","ISUP","Lymphoid neoplasms"]}}}},"tumour_grade":{"meta":{"notes":{"left":"This field depends on the selected tumour grading system, and is only required if the specimen is a tumour.","right":"This field depends on the selected tumour_grading_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Grading Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-grading-classifications"},"displayName":{"left":null,"right":"Tumour Grade"}},"restrictions":{"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'default':\n codeList = [\n 'gx - cannot be assessed',\n 'g1 well differentiated/low grade',\n 'g2 moderately differentiated/intermediated grade',\n 'g3 poorly differentiated/high grade',\n 'g4 undifferentiated/high grade',\n ];\n break;\n case 'gleason':\n codeList = [\n 'gleason x: gleason score cannot be determined',\n 'gleason 2–6: the tumor tissue is well differentiated',\n 'gleason 7: the tumor tissue is moderately differentiated',\n 'gleason 8–10: the tumor tissue is poorly differentiated or undifferentiated',\n ];\n break;\n case 'nottingham':\n codeList = [\n 'g1 (low grade or well differentiated)',\n 'g2 (intermediate grade or moderately differentiated)',\n 'g3 (high grade or poorly differentiated)',\n ];\n break;\n case 'brain cancer':\n codeList = ['grade i', 'grade ii', 'grade iii', 'grade iv'];\n break;\n case 'isup for renal cell carcinoma':\n codeList = [\n 'grade 1: tumor cell nucleoli invisible or small and basophilic at 400 x magnification',\n 'grade 2: tumor cell nucleoli conspicuous at 400 x magnification but inconspicuous at 100 x magnification',\n 'grade 3: tumor cell nucleoli eosinophilic and clearly visible at 100 x magnification',\n 'grade 4: tumors showing extreme nuclear pleomorphism and/or containing tumor giant cells and/or the presence of any proportion of tumor showing sarcomatoid and/or rhabdoid dedifferentiation',\n ];\n break;\n case 'lymphoid neoplasms':\n codeList = ['low grade or indolent nhl', 'high grade or aggressive nhl'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]},"codeList":{"right":["Low grade","High grade","GX","G1","G2","G3","G4","Low","High","Grade I","Grade II","Grade III","Grade IV","Grade Group 1","Grade Group 2","Grade Group 3","Grade Group 4","Grade Group 5"],"data":["Low grade","High grade","GX","G1","G2","G3","G4","Low","High","Grade I","Grade II","Grade III","Grade IV","Grade Group 1","Grade Group 2","Grade Group 3","Grade Group 4","Grade Group 5"]}}},"percent_tumour_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of infiltration by tumour cells in a specimen.","right":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)"},"meta":{"displayName":{"left":null,"right":"Percent Tumour Cells"}},"restrictions":{}},"percent_proliferating_cells":{"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."},"displayName":{"left":null,"right":"Percent Proliferating Cells"}},"restrictions":{}},"percent_inflammatory_tissue":{"description":{"left":"Indicate a value, in decimals, that represents local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue.","right":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."},"displayName":{"left":null,"right":"Percent Inflammatory Tissue"}},"restrictions":{}},"percent_stromal_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a malignant tumour specimen but are not malignant such as fibroblasts, vascular structures, etc.","right":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."},"displayName":{"left":null,"right":"Percent Stromal Cells"}},"restrictions":{}},"percent_necrosis":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of cell death in a malignant tumour specimen.","right":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."},"displayName":{"left":null,"right":"Percent Necrosis"}},"restrictions":{}}},"created":{"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate the primary diagnosis event in the clinical timeline that this specimen acquisition was related to.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"specimen_laterality":{"changeType":"created","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"reference_pathology_confirmed":{"changeType":"created","name":"reference_pathology_confirmed","description":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)","valueType":"string","meta":{"validationDependency":true,"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Reference Pathology Confirmed"},"restrictions":{"codeList":["Yes","No","Unknown"]}},"percent_tumour_cells_measurement_method":{"changeType":"created","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}},"deleted":{"central_pathology_confirmed":{"changeType":"deleted","name":"central_pathology_confirmed","description":"Indicate whether the histologic description of tissue or cells was confirmed by a pathology review of frozen or formalin fixed slide(s) completed after the diagnostic pathology review of the tumour sample used to extract analyte(s).","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour."},"restrictions":{"codeList":["Yes","No","Unknown"]}}}},"primary_diagnosis":{"updated":{"program_id":{"meta":{"displayName":{"left":null,"right":"Program ID"}}},"submitter_donor_id":{"meta":{"displayName":{"left":null,"right":"Submitter Donor ID"}}},"age_at_diagnosis":{"description":{"left":"Age that the donor was first diagnosed with cancer, in years.","right":"Age that the donor was first diagnosed with cancer, in years. This should be based on the earliest diagnosis of cancer."},"meta":{"displayName":{"left":null,"right":"Age at Diagnosis"}},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0,"max":90}}}},"cancer_type_code":{"description":{"left":"The code to represent the cancer type using the WHO ICD-10 code (https://icd.who.int/browse10/2016/en#/) classification.","right":"The code to represent the cancer type using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification."},"meta":{"examples":{"left":"C41.1,C16.9,C00.543A","right":"C41.1,C16.9,C00.5,D46.9"},"displayName":{"left":null,"right":"Cancer Type Code"}},"restrictions":{"regex":{"left":"^C[0-9]{2}.[0-9]{0,3}[A-Z]{0,1}$","right":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"}}},"basis_of_diagnosis":{"meta":{"displayName":{"left":null,"right":"Basis of Diagnosis"}}},"number_lymph_nodes_positive":{"description":{"left":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: NCI CDE ID: 6113694)","right":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: caDSR CDE ID 6113694)"},"meta":{"displayName":{"left":null,"right":"Number Of Lymph Nodes Positive"},"dependsOn":{"left":null,"right":"primary_diagnosis.lymph_nodes_examined_status"},"notes":{"left":null,"right":"This field is only required if 'lymph_nodes_examined_status' is 'Yes'."}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"]},"range":{"left":null,"right":{"min":0}}}},"number_lymph_nodes_examined":{"description":{"left":"The total number of lymph nodes tested for the presence of cancer. (Reference: NCI CDE ID: 3)","right":"The total number of lymph nodes tested for the presence of cancer. (Reference: caDSR CDE ID 3)"},"meta":{},"restrictions":{}},"clinical_tumour_staging_system":{"meta":{"validationDependency":{"left":null,"right":true},"displayName":{"left":null,"right":"Clinical Tumour Staging System"}},"restrictions":{"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(\n field =>\n Object.keys(convertedRow).includes(field) &&\n (!convertedRow[field] || checkforEmpty(convertedRow[field])),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"required":{"left":true,"right":null},"codeList":{"left":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"deleted":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"]}}}},"clinical_stage_group":{"description":{"left":"Stage group of the tumour, as assigned by the reporting tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.).","right":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage."},"meta":{"notes":{"left":null,"right":"This field is dependent on the selected clinical_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications"},"displayName":{"left":null,"right":"Clinical Stage Group"},"examples":{"left":null,"right":"Stage I, Stage IIB"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"clinical_t_category":{"meta":{"displayName":{"left":null,"right":"Clinical T Category"}},"restrictions":{}},"clinical_n_category":{"description":{"left":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"displayName":{"left":null,"right":"Clinical N Category"}},"restrictions":{}},"clinical_m_category":{"description":{"left":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned.","right":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned."},"meta":{"displayName":{"left":null,"right":"Clinical M Category"}},"restrictions":{}},"presenting_symptoms":{"meta":{},"restrictions":{"codeList":{"left":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Nausea","None","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Unknown","Vomiting","Weight Loss"],"right":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Loss of Appetite","Nausea","None","Not Reported","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Swelling in the Neck","Unknown","Vomiting","Weight Loss"],"data":{"added":["Loss of Appetite","Not Reported","Swelling in the Neck"],"deleted":[]}}}},"performance_status":{"description":{"left":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference source: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status).","right":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status)."},"meta":{"notes":{"left":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction \n Grade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work) \n Grade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours \n Grade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours \n Grade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair","right":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction.\nGrade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work).\nGrade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours.\nGrade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours.\nGrade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair"},"displayName":{"left":null,"right":"Performance Status"}},"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}}},"created":{"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Unique identifier of the primary diagnosis event, assigned by the data provider.","meta":{"primaryId":true,"displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"cancer_type_additional_information":{"changeType":"created","name":"cancer_type_additional_information","valueType":"string","description":"Additional details related to the cancer type that are not covered by the ICD-10 code provided in the cancer_type field.","meta":{"displayName":"Cancer Type Additional Information"}},"laterality":{"changeType":"created","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_status":{"changeType":"created","name":"lymph_nodes_examined_status","description":"Indicate if lymph nodes were examined for metastases.","valueType":"string","restrictions":{"required":true,"codeList":["Cannot be determined","No","No lymph nodes found in resected specimen","Not applicable","Yes"]},"meta":{"core":true,"displayName":"Lymph Nodes Examined Status"}},"lymph_nodes_examined_method":{"changeType":"created","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}},"deleted":{"stage_suffix":{"changeType":"deleted","name":"stage_suffix","description":"If necessary, use this field to add any applicable stage suffixes. Stage suffixes may apply to certain staging systems such as Ann Arbour staging system where the four stages are divided into 4 categories (A, B, X and E).","valueType":"string","meta":{"core":true,"dependsOn":"primary_diagnosis.clinical_tumour_staging_system"}}}},"treatment":{"updated":{"program_id":{"meta":{"displayName":{"left":null,"right":"Program ID"}}},"submitter_donor_id":{"meta":{"displayName":{"left":null,"right":"Submitter Donor ID"}}},"submitter_treatment_id":{"meta":{"displayName":{"left":null,"right":"Submitter Treatment ID"}}},"treatment_type":{"meta":{"notes":{"left":"Depending on the treatment_type selected, additional treament details may be required to be submitted.","right":"Depending on the treatment_type(s) selected, additional treatment details may be required to be submitted. For example, if treatment_type includes 'Chemotherapy', the supplemental Chemotherapy treatment type file is required.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."},"displayName":{"left":null,"right":"Treatment Type"},"examples":{"left":null,"right":"Chemotherapy|Hormonal therapy"}},"restrictions":{"codeList":{"left":["Chemotherapy","Ablation","Bone marrow transplant","Combined chemo+immunotherapy","Combined chemo+radiation therapy","Combined chemo-radiotherapy and surgery","Endoscopic therapy","Hormonal therapy","Immunotherapy","Monoclonal antibodies (for liquid tumours)","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgical resection"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":["End of life care","Surgery"],"deleted":["Combined chemo+immunotherapy","Combined chemo+radiation therapy","Combined chemo-radiotherapy and surgery","Monoclonal antibodies (for liquid tumours)","Surgical resection"]}}}},"is_primary_treatment":{"description":{"left":"Indicate if the treamtment was the primary treatment following the initial diagnosis.","right":"Indicate if the treatment was the primary treatment following the initial diagnosis."},"meta":{"displayName":{"left":null,"right":"Is Primary Treatment"},"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Yes","No","Unknown"],"right":["Yes","No"],"data":{"added":[],"deleted":["Unknown"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_start_interval":{"description":{"left":"The interval between primary diagnosis and initiation of treatment, in days.","right":"The interval between the primary diagnosis and initiation of treatment, in days."},"meta":{"notes":{"left":null,"right":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."},"displayName":{"left":null,"right":"Treatment Start Interval"},"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_duration":{"description":{"left":"The duration of treatment regimen, in days","right":"The duration of treatment regimen, in days."},"meta":{"displayName":{"left":null,"right":"Treatment Duration"},"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}}},"created":{"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate the primary diagnosis event in the clinical timeline that this treatment was related to.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"line_of_treatment":{"changeType":"created","name":"line_of_treatment","description":"Indicate the line of treatment if it is not the primary treatment.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Line Of treatment","dependsOn":"treatment.is_primary_treatment","examples":"2,3,4"}},"days_per_cycle":{"changeType":"created","name":"days_per_cycle","description":"Indicate the number of days in a treatment cycle.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Days Per Cycle","dependsOn":"treatment.treatment_type"}},"number_of_cycles":{"changeType":"created","name":"number_of_cycles","description":"Indicate the number of treatment cycles.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Number Of Cycles","dependsOn":"treatment.treatment_type"}},"treatment_intent":{"changeType":"created","name":"treatment_intent","description":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"]},"meta":{"core":true,"displayName":"Treatment Intent","dependsOn":"treatment.treatment_type"}},"treatment_setting":{"changeType":"created","name":"treatment_setting","description":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: NCIt C124308)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"]},"meta":{"core":true,"displayName":"Treatment Setting","dependsOn":"treatment.treatment_type"}},"response_to_treatment_criteria_method":{"changeType":"created","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},"response_to_treatment":{"changeType":"created","name":"response_to_treatment","description":"The donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"codeList":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"]},"meta":{"core":true,"displayName":"Response To Treatment","dependsOn":"treatment.response_to_treatment_criteria_method","notes":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"outcome_of_treatment":{"changeType":"created","name":"outcome_of_treatment","description":"Indicate the donor's outcome of the prescribed treatment.","valueType":"string","restrictions":{"codeList":["Treatment completed as prescribed","Treatment incomplete due to technical or organizational problems","Treatment incomplete because patient died","Patient choice (stopped or interrupted treatment)","Physician decision (stopped or interrupted treatment)","Treatment stopped due to lack of efficacy (disease progression)","Treatment stopped due to acute toxicity","Other","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Outcome Of Treatment","dependsOn":"treatment.treatment_type"}},"toxicity_type":{"changeType":"created","name":"toxicity_type","description":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity.","valueType":"string","restrictions":{"codeList":["Hematological","Non-hematological","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Toxicity Type","dependsOn":"treatment.outcome_of_treatment"}},"hematological_toxicity":{"changeType":"created","name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"non-hematological_toxicity":{"changeType":"created","name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"adverse_events":{"changeType":"created","name":"adverse_events","description":"Report any treatment related adverse events. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Adverse Events","dependsOn":"treatment.treatment_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"clinical_trials_database":{"changeType":"created","name":"clinical_trials_database","description":"If the donor is a participant in a clinical trial, indicate the clinical trial database where the clinical trial is registered.","valueType":"string","meta":{"display name":"Clinical Trials Database","notes":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added."},"restrictions":{"codeList":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"]}},"clinical_trial_number":{"changeType":"created","name":"clinical_trial_number","description":"Based on the clinical_trial_database, indicate the unique NCT or EudraCT clinical trial identifier of which the donor is a participant.","valueType":"string","meta":{"display name":"Clinical Trial Number","dependsOn":"treatment.clinical_trials_database","examples":"2016-002120-83,NCT02465060"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"]}}},"deleted":{"age_at_consent_for_treatment":{"changeType":"deleted","name":"age_at_consent_for_treatment","description":"Indicate the age of donor when consent was given for treatment.","valueType":"integer"},"therapeutic_intent":{"changeType":"deleted","name":"therapeutic_intent","description":"The therapeutic intent, the reason behind the choice of a therapy, of the treatment.","valueType":"string","restrictions":{"required":true,"codeList":["Adjuvant","Concurrent","Curative","Neoadjuvant","Not applicable","Palliative","Unknown"]},"meta":{"core":true}},"response_to_therapy":{"changeType":"deleted","name":"response_to_therapy","description":"The donors's response to the applied treatment regimen. (Source: RECIST)","valueType":"string","restrictions":{"required":true,"codeList":["Complete response","Disease progression","NED","Partial response","Stable disease"]},"meta":{"core":true}}}},"chemotherapy":{"updated":{"program_id":{"meta":{"displayName":{"left":null,"right":"Program ID"}}},"submitter_donor_id":{"meta":{"displayName":{"left":null,"right":"Submitter Donor ID"}}},"submitter_treatment_id":{"meta":{"displayName":{"left":null,"right":"Submitter Treatment ID"}}}},"created":{"drug_rxnormcui":{"changeType":"created","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"created","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"created","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"created","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"created","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"created","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}},"deleted":{"chemotherapy_drug_name":{"changeType":"deleted","name":"chemotherapy_drug_name","description":"Name of agent or drug administered to patient as part of the chemotherapy treatment regimen.","valueType":"string","restrictions":{"required":true,"codeList":["Placeholder list 1","Need list","Still need it"]},"meta":{"validationDependency":true,"core":true,"notes":"This field uses a controlled vocabulary gathered from the DrugBank database of drug names.","examples":"Allopurinol, Dronabinol, Sucralfate, Lapatinib"}},"chemotherapy_dosage_units":{"changeType":"deleted","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m²","IU/m²","µg/m²","g/m²","mg/kg"]},"meta":{"core":true}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate the total drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"integer","restrictions":{"required":true},"meta":{"core":true}}}},"hormone_therapy":{"updated":{"program_id":{"meta":{"displayName":{"left":null,"right":"Program ID"}}},"submitter_donor_id":{"meta":{"displayName":{"left":null,"right":"Submitter Donor ID"}}},"submitter_treatment_id":{"meta":{"displayName":{"left":null,"right":"Submitter Treatment ID"}}}},"created":{"drug_rxnormcui":{"changeType":"created","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"created","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Hormone Therapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"created","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{"hormone_therapy_drug_name":{"changeType":"deleted","name":"hormone_therapy_drug_name","description":"Name of agent or drug administered to patient as part of the hormone therapy treatment regimen.","valueType":"string","restrictions":{"required":true,"codeList":["Placeholder list 1","Need list","Still need it"]},"meta":{"validationDependency":true,"core":true,"notes":"This field uses a controlled vocabulary gathered from the DrugBank database of drug names."}},"hormone_drug_dosage_units":{"changeType":"deleted","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m²","IU/m²","µg/m²","g/m²","mg/kg"]},"meta":{"core":true}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"integer","restrictions":{"required":true},"meta":{"core":true}}}},"radiation":{"updated":{"program_id":{"meta":{"displayName":{"left":null,"right":"Program ID"}}},"submitter_donor_id":{"meta":{"displayName":{"left":null,"right":"Submitter Donor ID"}}},"submitter_treatment_id":{"meta":{"displayName":{"left":null,"right":"Submitter Treatment ID"}}},"radiation_therapy_modality":{"meta":{"displayName":{"left":null,"right":"Radiation Therapy Modality"}}},"radiation_therapy_fractions":{"description":{"left":"Indicate the number of total fractions delivered as part of treatment.","right":"Indicate the total number of fractions delivered as part of treatment."},"meta":{"displayName":{"left":null,"right":"Radiation Therapy Fractions"}},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"radiation_therapy_dosage":{"valueType":{"left":"integer","right":"number"},"meta":{"displayName":{"left":null,"right":"Radiation Therapy Dosage"}},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"anatomical_site_irradiated":{"description":{"left":"Indicate localization site where radiation therapy was administered.","right":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)"},"meta":{"displayName":{"left":null,"right":"Anatomical Site Irradiated"}},"restrictions":{"codeList":{"left":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"right":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"data":{"added":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"],"deleted":["Bone","Extremities","Head-Neck","Peritoneum"]}}}}},"created":{"radiation_therapy_type":{"changeType":"created","name":"radiation_therapy_type","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal"]},"meta":{"core":true,"displayName":"Type of Radiation Therapy","notes":"Internal application includes Brachytherapy."}},"radiation_boost":{"changeType":"created","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"created","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}},"deleted":{"application_form":{"changeType":"deleted","name":"application_form","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal (including Brachytherapy)"]},"meta":{"core":true}}}},"follow_up":{"updated":{"program_id":{"meta":{"displayName":{"left":null,"right":"Program ID"}}},"submitter_donor_id":{"meta":{"displayName":{"left":null,"right":"Submitter Donor ID"}}},"submitter_follow_up_id":{"description":{"left":"Unique identifier for a follow-up event in a donors clincal record, assigned by the data provider.","right":"Unique identifier for a follow-up event in a donor's clinical record, assigned by the data provider."},"meta":{"displayName":{"left":null,"right":"Submitter Follow-Up ID"}}},"interval_of_followup":{"description":{"left":"Interval from the primary diagnosis date to the follow up date, in days.","right":"Interval from the primary diagnosis date to the follow-up date, in days."},"meta":{"displayName":{"left":null,"right":"Interval Of Follow-Up"},"notes":{"left":null,"right":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}}},"disease_status_at_followup":{"description":{"left":"Indicate the donor's disease status at time of follow-up.","right":"Indicate the donor's disease status at time of follow-up. (Reference: RECIST)"},"meta":{"displayName":{"left":null,"right":"Disease Status at Follow-Up"}},"restrictions":{"codeList":{"left":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Relapse","Stable"],"right":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Progression NOS","Relapse or recurrence","Stable"],"data":{"added":["Progression NOS","Relapse or recurrence"],"deleted":["Relapse"]}}}},"relapse_type":{"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."},"displayName":{"left":null,"right":"Relapse Type"}},"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"relapse_interval":{"description":{"left":"If the donor was clinically disease free following primary treatment and then relapse or progression (for liquid tumours) occurred afterwards, then this field will indicate the length of disease free interval, in days.","right":"If the donor was clinically disease free following primary treatment and then relapse or recurrence or progression (for liquid tumours) occurred afterwards, then this field will indicate the length of disease free interval, in days."},"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."},"displayName":{"left":null,"right":"Relapse Interval"}},"restrictions":{"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"]}}},"method_of_progression_status":{"description":{"left":"Indicate the method(s) used to confirm the donor's progression disease status. (Codelist reference: NCI CDE ID: 6161031)","right":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Reference: caDSR CDE ID 6161031)"},"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."},"displayName":{"left":null,"right":"Method Of Progression Status"}},"restrictions":{"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]},"codeList":{"left":["Autopsy","Biomarker in liquid biopsy (e.g. tumor marker in blood or urine)","Biopsy","Blood draw","Bone marrow aspirate","Core biopsy","Cystoscopy","Cytology","Debulking","Diagnostic imaging","Dilation and curettage procedure","Enucleation","Excisional biopsy","Fine needle aspiration","Imaging","Incisional biopsy","Laparoscopy","Laparotomy","Other","Pap Smear","Pathologic review","Physical exam","Surgical resection","Thoracentesis","Ultrasound guided biopsy"],"right":["Biomarker in liquid biopsy (e.g. tumour marker in blood or urine)","Biopsy","Blood draw","Bone marrow aspirate","Core biopsy","Cystoscopy","Cytology","Debulking","Diagnostic imaging","Dilation and curettage procedure","Enucleation","Excisional biopsy","Fine needle aspiration","Imaging","Incisional biopsy","Laparoscopy","Laparotomy","Other","Pap Smear","Pathologic review","Physical exam","Surgical resection","Thoracentesis","Ultrasound guided biopsy"],"data":{"added":["Biomarker in liquid biopsy (e.g. tumour marker in blood or urine)"],"deleted":["Autopsy","Biomarker in liquid biopsy (e.g. tumor marker in blood or urine)"]}}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."},"displayName":{"left":null,"right":"Recurrance Tumour Staging System"}},"restrictions":{"codeList":{"left":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"deleted":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"]}},"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(\n field =>\n Object.keys(convertedRow).includes(field) &&\n (!convertedRow[field] || checkforEmpty(convertedRow[field])),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_t_category":{"description":{"left":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":true,"right":null},"displayName":{"left":null,"right":"Recurrence T Category"}},"restrictions":{}},"recurrence_n_category":{"description":{"left":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":true,"right":null},"displayName":{"left":null,"right":"Recurrence N Category"}},"restrictions":{}},"recurrence_m_category":{"description":{"left":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":true,"right":null},"displayName":{"left":null,"right":"Recurrence M Category"}},"restrictions":{}},"recurrence_stage_group":{"description":{"left":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery.","right":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) at the time of retreatment for a recurrence or disease progression."},"meta":{"core":{"left":true,"right":null},"notes":{"left":null,"right":"This field is dependent on the selected recurrence_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications"},"displayName":{"left":null,"right":"Recurrence Stage Group"}},"restrictions":{}},"posttherapy_tumour_staging_system":{"meta":{},"restrictions":{"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(\n field =>\n Object.keys(convertedRow).includes(field) &&\n (!convertedRow[field] || checkforEmpty(convertedRow[field])),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"deleted":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"]}}}},"posttherapy_t_category":{"meta":{"dependsOn":{"left":"follow_up.post_therapy_tumour_staging_system","right":"follow_up.posttherapy_tumour_staging_system"},"displayName":{"left":null,"right":"Post-therapy T Category"}},"restrictions":{}},"posttherapy_n_category":{"description":{"left":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"dependsOn":{"left":"follow_up.post_therapy_tumour_staging_system","right":"follow_up.posttherapy_tumour_staging_system"},"displayName":{"left":null,"right":"Post-therapy N Category"}},"restrictions":{}},"posttherapy_m_category":{"description":{"left":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"dependsOn":{"left":"follow_up.post_therapy_tumour_staging_system","right":"follow_up.posttherapy_tumour_staging_system"},"displayName":{"left":null,"right":"Post-therapy M Category"}},"restrictions":{}},"posttherapy_stage_group":{"meta":{"dependsOn":{"left":"follow_up.post_therapy_tumour_staging_system","right":"follow_up.posttherapy_tumour_staging_system"},"notes":{"left":"This field value is dependent on the selected posttherapy_tumour_staging_system.","right":"This field is dependent on the selected posttherapy_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications"},"displayName":{"left":null,"right":"Post-therapy Stage Group"}},"restrictions":{}}},"created":{"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate if the follow-up is related to a specific primary diagnosis event in the clinical timeline.","meta":{"validationDependency":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID","primaryId":true},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"Indicate if the follow-up is related to a specific treatment event in the clinical timeline.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"weight_at_followup":{"changeType":"created","description":"Indicate the donor's weight, in kilograms (kg), at the time of follow-up.","name":"weight_at_followup","valueType":"number","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Weight at Follow-Up"}},"anatomic_site_progression_or_recurrence":{"changeType":"created","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"anatomic_site_progression_or_recurrences":{"changeType":"deleted","description":"Indicate the anatomic site where disease progression or recurrence occurred. (Codelist reference: NCI CDE ID: 4742851)","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"],"codeList":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear, pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal; distal","Esophageal; mid","Esophageal; proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck, NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es), maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"]},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","notes":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse."}}}},"immunotherapy":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"immunotherapy_type":{"changeType":"created","name":"immunotherapy_type","valueType":"string","description":"Indicate the type of immunotherapy administered to donor.","meta":{"displayName":"Immunotherapy Type","core":true},"restrictions":{"required":true,"codeList":["Cell-based","Immune checkpoint inhibitors","Monoclonal antibodies other than immune checkpoint inhibitors","Other immunomodulatory substances"]}},"drug_rxnormcui":{"changeType":"created","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"created","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"created","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{}},"surgery":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"created","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"created","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"created","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"created","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"created","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"created","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"created","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"created","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"created","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"created","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"created","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"created","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"created","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"created","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}},"deleted":{}},"exposure":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"created","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"created","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"created","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"created","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"created","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"created","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"created","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"created","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"created","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"created","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"created","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"created","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"created","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}},"deleted":{}},"family_history":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"family_relative_id":{"changeType":"created","description":"Unique identifier of the relative, assigned by the data provider.","name":"family_relative_id","valueType":"string","meta":{"displayName":"Family Relative ID","primaryId":true,"notes":"This field is required to ensure that family members are identified in unique records. Ids can be as simple as an incremented numeral to ensure uniqueness."},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"relative_with_cancer_history":{"changeType":"created","description":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","name":"relative_with_cancer_history","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Relative with Cancer History"}},"relationship_type":{"changeType":"created","description":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","name":"relationship_type","restrictions":{"codeList":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"]},"valueType":"string","meta":{"displayName":"Relationship Type"}},"gender_of_relative":{"changeType":"created","description":"The self-reported gender of related individual.","name":"gender_of_relative","restrictions":{"codeList":["Female","Male","Other","Unknown"]},"valueType":"string","meta":{"displayName":"Gender of Relative"}},"age_of_relative_at_diagnosis":{"changeType":"created","description":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","name":"age_of_relative_at_diagnosis","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","displayName":"Age Of Relative At Diagnosis"}},"cancer_type_code_of_relative":{"changeType":"created","name":"cancer_type_code_of_relative","valueType":"string","description":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"examples":"C41.1,C16.9,C00.5,D46.9","dependsOn":"family_history.relative_with_cancer_history","displayName":"Cancer Type Code (ICD-10) of Relative"}},"relative_vital_status":{"changeType":"created","description":"Relative's last known state of living or deceased.","name":"relative_vital_status","restrictions":{"codeList":["Alive","Deceased","Unknown"]},"valueType":"string","meta":{"displayName":"Vital Status of Relative"}},"cause_of_death_of_relative":{"changeType":"created","description":"Indicate the cause of the death of the relative.","name":"cause_of_death_of_relative","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]},"valueType":"string","meta":{"dependsOn":"family_history.relative_vital_status","displayName":"Cause of Death of Relative"}},"relative_survival_time":{"changeType":"created","description":"Indicate how long, in days, the relative survived from the time they were diagnosed with cancer.","name":"relative_survival_time","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","units":"days","displayName":"Survival Time Of Relative"}}},"deleted":{}},"biomarker":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"created","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"created","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"created","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"created","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"created","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"created","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"created","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"created","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"created","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"created","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"created","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"created","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"created","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"created","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"created","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"created","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"created","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"created","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"created","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}},"deleted":{}},"comorbidity":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"created","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"created","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"created","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"created","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"created","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"created","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}},"deleted":{}}}} diff --git a/website/static/data/schemas/diffs/1.0/1.0-diff-1.24.json b/website/static/data/schemas/diffs/1.0/1.0-diff-1.24.json new file mode 100644 index 00000000..41924dbf --- /dev/null +++ b/website/static/data/schemas/diffs/1.0/1.0-diff-1.24.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"],"deleted":[]}},"script":{"left":["(function validate() {\r\n\r\n const row = $row;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n const designation = row.tumour_normal_designation.trim().toLowerCase();\r\n const specimen_type = $field.trim().toLowerCase();\r\n \r\n if (designation === \"normal\"){\r\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\r\n if (!validTypes.includes(specimen_type)){\r\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when tumour_normal_designation is set to Normal.\"};\r\n }\r\n }\r\n else if (designation === \"tumour\") {\r\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\r\n if (invalidTypes.includes(specimen_type)){\r\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when tumour_normal_designation is set to Tumour.\"};\r\n }\r\n }\r\n return result;\r\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"]}}},"submitter_sample_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased","Unknown"],"right":["Alive","Deceased"],"data":{"added":[],"deleted":["Unknown"]}}}},"cause_of_death":{"restrictions":{"script":{"left":["(function validate() {\r\n let result = {valid: true, message: \"Ok\"};\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n const vitalStatus = $row.vital_status.trim().toLowerCase();\r\n \r\n if (!currField && vitalStatus === \"deceased\"){\r\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\r\n }\r\n else if (currField && vitalStatus != \"deceased\"){\r\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\r\n }\r\n return result;\r\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]}}},"survival_time":{"restrictions":{"script":{"left":["(function validate() {\r\n let result = {valid: true, message: \"Ok\"};\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n const vitalStatus = $row.vital_status.trim().toLowerCase();\r\n \r\n if (!currField && vitalStatus === \"deceased\"){\r\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\r\n }\r\n else if (currField && vitalStatus != \"deceased\"){\r\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\r\n }\r\n return result;\r\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"primary_site":{"meta":{"notes":{"left":null,"right":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"examples":{"left":null,"right":"Breast|Ovary"}},"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Not Reported","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva","Unknown"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"data":{"added":["Unknown primary site"],"deleted":["Not Reported","Unknown"]}}}},"height":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"weight":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"bmi":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"menopause_status":{"description":{"left":"Indicate the donor's menopause status at the time of primary diagnosis. (Codelist reference: NCI CDE ID: 2434914)","right":"Indicate the donor's menopause status at the time of primary diagnosis. (Reference: caDSR CDE ID 2434914)"},"restrictions":{"codeList":{"left":["Indeterminate or unknown","Not applicable","Perimenopausal","Postmenopausal","Premenopausal"],"right":["Not applicable","Perimenopausal","Postmenopausal","Premenopausal","Unknown"],"data":{"added":["Unknown"],"deleted":["Indeterminate or unknown"]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age of menarche, the first occurrence of menstruation.","right":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)"},"restrictions":{}},"number_of_pregnancies":{"description":{"left":"Indicate the number of pregnancies a donor has had.","right":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)"},"restrictions":{}},"number_of_children":{"description":{"left":"Indicate the number of children the donor has birthed.","right":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)"},"restrictions":{}}},"created":{"genetic_disorders":{"changeType":"created","description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},"hrt_type":{"changeType":"created","description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},"hrt_duration":{"changeType":"created","description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},"contraception_type":{"changeType":"created","description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},"contraception_duration":{"changeType":"created","description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},"lost_to_followup_after_clinical_event_id":{"changeType":"created","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}},"deleted":{"prior_malignancy":{"changeType":"deleted","description":"Prior malignancy affecting donor.","name":"prior_malignancy","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy","examples":"C41.1, C16.9, C00.5, D46.9"}},"cancer_type_prior_malignancy":{"changeType":"deleted","description":"The code to represent the cancer type of a prior malignancy using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","name":"cancer_type_prior_malignancy","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"valueType":"string","meta":{"displayName":"Cancer Type Prior Malignancy"}},"age_at_prior_malignancy":{"changeType":"deleted","description":"If donor has history of prior malignancy, indicate age at previous diagnosis, in years.","name":"age_at_prior_malignancy","valueType":"integer","meta":{"displayName":"Age at Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"deleted","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Codelist reference: NCI CDE: 4122391)","name":"laterality_of_prior_malignancy","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality at Prior Malignancy"}}}},"specimen":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null},"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"pathological_tumour_staging_system":{"meta":{"validationDependency":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n /* This is not a required field, so first ensure that it exists */\r\n if ($field) {\r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"pathological_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"pathological_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"pathological_stage_group":{"restrictions":{"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.pathological_tumour_staging_system && $field) {\r\n let codeList = [];\r\n switch ($row.pathological_tumour_staging_system && $row.pathological_tumour_staging_system.trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb',\r\n 'stage ive',\r\n 'stage ivs'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When 'pathological_tumour_staging_system' is set to '${\r\n $row.pathological_tumour_staging_system\r\n }', 'pathological_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"specimen_storage":{"description":{"left":"Indicate the method of specimen storage for specimens that were not extracted freshly or immediately cultured.","right":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured."},"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"reference_pathology_confirmed":{"description":{"left":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist.","right":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)"}},"tumour_grading_system":{"meta":{"validationDependency":{"left":null,"right":true}}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.tumour_grading_system && $field) {\r\n let codeList = [];\r\n const tieredGradingList = ['gx','g1','g2','g3'];\r\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\r\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\r\n case 'two-tier grading system':\r\n codeList = [\r\n 'low grade',\r\n 'high grade',\r\n ];\r\n break;\r\n case 'three-tier grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'four-tier grading system':\r\n codeList = [\r\n 'gx',\r\n 'g1',\r\n 'g2',\r\n 'g3',\r\n 'g4',\r\n ];\r\n break;\r\n case 'grading system for gists':\r\n codeList = [\r\n 'low',\r\n 'high',\r\n ];\r\n break;\r\n case 'grading system for gnets':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'isup grading system':\r\n codeList = [\r\n 'gx',\r\n 'g1',\r\n 'g2',\r\n 'g3',\r\n 'g4',\r\n ];\r\n break;\r\n case 'who grading system for cns tumours':\r\n codeList = [\r\n 'grade i',\r\n 'grade ii',\r\n 'grade iii',\r\n 'grade iv',\r\n ];\r\n break;\r\n case 'fnclcc grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'gleason grade group system':\r\n codeList = [\r\n 'grade group 1',\r\n 'grade group 2',\r\n 'grade group 3',\r\n 'grade group 4',\r\n 'grade group 5',\r\n ];\r\n break;\r\n case 'scarff-bloom-richardson grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'nuclear grading system for dcis':\r\n codeList = tieredGradingList;\r\n break;\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase())) {\r\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\r\n $row.tumour_grading_system\r\n }', 'tumour_grade' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\r\n result.valid = false;\r\n const msg = \"'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.\";\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"percent_tumour_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of infiltration by tumour cells in a specimen.","right":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)"},"restrictions":{}},"percent_proliferating_cells":{"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_inflammatory_tissue":{"description":{"left":"Indicate a value, in decimals, that represents local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue.","right":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_stromal_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a malignant tumour specimen but are not malignant such as fibroblasts, vascular structures, etc.","right":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_necrosis":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of cell death in a malignant tumour specimen.","right":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}}},"created":{"specimen_laterality":{"changeType":"created","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"percent_tumour_cells_measurement_method":{"changeType":"created","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}},"deleted":{}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"age_at_diagnosis":{"description":{"left":"Age that the donor was first diagnosed with cancer, in years.","right":"Age that the donor was first diagnosed with cancer, in years. This should be based on the earliest diagnosis of cancer."},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0,"max":90}}}},"number_lymph_nodes_positive":{"description":{"left":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: NCI CDE ID: 6113694)","right":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: caDSR CDE ID 6113694)"},"meta":{"dependsOn":{"left":null,"right":"primary_diagnosis.lymph_nodes_examined_status"},"notes":{"left":null,"right":"This field is only required if 'lymph_nodes_examined_status' is 'Yes'."}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"]},"range":{"left":null,"right":{"min":0}}}},"number_lymph_nodes_examined":{"description":{"left":"The total number of lymph nodes tested for the presence of cancer. (Reference: NCI CDE ID: 3)","right":"The total number of lymph nodes tested for the presence of cancer. (Reference: caDSR CDE ID 3)"},"meta":{"dependsOn":{"left":null,"right":"primary_diagnosis.lymph_nodes_examined_status"},"notes":{"left":null,"right":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'."}},"restrictions":{}},"clinical_tumour_staging_system":{"meta":{"validationDependency":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n /* This is not a required field, so first ensure that it exists */\r\n if ($field) {\r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"required":{"left":true,"right":null},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"clinical_stage_group":{"description":{"left":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.).","right":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage."},"meta":{"examples":{"left":null,"right":"Stage I, Stage IIB"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.clinical_tumour_staging_system && $field) {\r\n let codeList = [];\r\n switch ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system.trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb',\r\n 'stage ive',\r\n 'stage ivs'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When 'clinical_tumour_staging_system' is set to '${\r\n $row.clinical_tumour_staging_system\r\n }', 'clinical_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"clinical_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"clinical_n_category":{"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"clinical_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"presenting_symptoms":{"restrictions":{"codeList":{"left":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Loss of Appetite","Nausea","None","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Unknown","Vomiting","Weight Loss"],"right":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Loss of Appetite","Nausea","None","Not Reported","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Swelling in the Neck","Unknown","Vomiting","Weight Loss"],"data":{"added":["Not Reported","Swelling in the Neck"],"deleted":[]}}}},"performance_status":{"description":{"left":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference source: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status).","right":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status)."},"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}}},"created":{"laterality":{"changeType":"created","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_status":{"changeType":"created","name":"lymph_nodes_examined_status","description":"Indicate if lymph nodes were examined for metastases.","valueType":"string","restrictions":{"required":true,"codeList":["Cannot be determined","No","No lymph nodes found in resected specimen","Not applicable","Yes"]},"meta":{"core":true,"displayName":"Lymph Nodes Examined Status"}},"lymph_nodes_examined_method":{"changeType":"created","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}},"deleted":{}},"treatment":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null},"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":["End of life care"],"deleted":[]}}}},"is_primary_treatment":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Yes","No","Unknown"],"right":["Yes","No"],"data":{"added":[],"deleted":["Unknown"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"line_of_treatment":{"meta":{"dependsOn":{"left":null,"right":"treatment.is_primary_treatment"}},"restrictions":{}},"treatment_start_interval":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_duration":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"days_per_cycle":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{}},"number_of_cycles":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{}},"toxicity_type":{"description":{"left":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hemotological toxicity or non-hemotological toxicity.","right":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity."},"meta":{"dependsOn":{"left":null,"right":"treatment.outcome_of_treatment"}},"restrictions":{"codeList":{"left":["Hemotological","Non-hemotological"],"right":["Hematological","Non-hematological","Not applicable","Unknown"],"data":{"added":["Hematological","Non-hematological","Not applicable","Unknown"],"deleted":["Hemotological","Non-hemotological"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"]}}},"adverse_events":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"codeList":{"left":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"right":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"data":{"added":["None","Unknown"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"clinical_trials_database":{"meta":{"notes":{"left":null,"right":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added."}},"restrictions":{"codeList":{"left":["NCI Clinical Trials","EU Clinical Trials Register"],"right":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"],"data":{"added":["Not applicable","Unknown"],"deleted":[]}}}},"clinical_trial_number":{"restrictions":{"script":{"left":["(function validate() {\r\n let result = {valid: true, message: \"Ok\"};\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n //regex check for clinical trial number\r\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\r\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\r\n\r\n // list of valid clinical trial databases\r\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\r\n \r\n if ($row.clinical_trials_database && $field) {\r\n const trialNumber = $field.trim();\r\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\r\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\r\n result = {valid: false, message: 'The submitted NCI clinical trial number is in incorrect format.'};\r\n }\r\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\r\n result = {valid: false, message: \"The submitted EudraCT clinical trial number is in incorrect format.\"};\r\n }\r\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\r\n result = {valid: false, message: \"The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database.\"};\r\n }\r\n }\r\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\r\n result = {valid: true, message: \"Ok\"};\r\n }\r\n else if ($row.clinical_trials_database && !$field) {\r\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\r\n result = {valid: false, message: \"'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.\"};\r\n } \r\n }\r\n return result;\r\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"]}}}},"created":{"treatment_intent":{"changeType":"created","name":"treatment_intent","description":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"]},"meta":{"core":true,"displayName":"Treatment Intent","dependsOn":"treatment.treatment_type"}},"treatment_setting":{"changeType":"created","name":"treatment_setting","description":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: NCIt C124308)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"]},"meta":{"core":true,"displayName":"Treatment Setting","dependsOn":"treatment.treatment_type"}},"response_to_treatment_criteria_method":{"changeType":"created","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},"response_to_treatment":{"changeType":"created","name":"response_to_treatment","description":"The donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"codeList":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"]},"meta":{"core":true,"displayName":"Response To Treatment","dependsOn":"treatment.response_to_treatment_criteria_method","notes":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"outcome_of_treatment":{"changeType":"created","name":"outcome_of_treatment","description":"Indicate the donor's outcome of the prescribed treatment.","valueType":"string","restrictions":{"codeList":["Treatment completed as prescribed","Treatment incomplete due to technical or organizational problems","Treatment incomplete because patient died","Patient choice (stopped or interrupted treatment)","Physician decision (stopped or interrupted treatment)","Treatment stopped due to lack of efficacy (disease progression)","Treatment stopped due to acute toxicity","Other","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Outcome Of Treatment","dependsOn":"treatment.treatment_type"}},"hematological_toxicity":{"changeType":"created","name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"non-hematological_toxicity":{"changeType":"created","name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"age_at_consent_for_treatment":{"changeType":"deleted","name":"age_at_consent_for_treatment","description":"Indicate the age of donor when consent was given for treatment.","valueType":"integer","meta":{"displayName":"Age At Consent For Treatment"}},"therapeutic_intent":{"changeType":"deleted","name":"therapeutic_intent","description":"The therapeutic intent, the reason behind the choice of a therapy, of the treatment.","valueType":"string","restrictions":{"required":true,"codeList":["Adjuvant","Concurrent","Curative","Neoadjuvant","Not applicable","Palliative","Unknown"]},"meta":{"core":true,"displayName":"Therapeutic Intent"}},"response_to_therapy":{"changeType":"deleted","name":"response_to_therapy","description":"The donor's response to the applied treatment regimen. (Source: RECIST)","valueType":"string","restrictions":{"required":true,"codeList":["Complete response","Disease progression","NED","Partial response","Stable disease"]},"meta":{"core":true,"displayName":"Response To Therapy"}},"outcome_of_therapy":{"changeType":"deleted","name":"outcome_of_therapy","description":"Indicate the donor's outcome of the prescribed treatment.","valueType":"string","restrictions":{"codeList":["Treatment completed as prescribed","Treatment incomplete due to technical or organizational problems","Treatment incomplete because patient died","Patient choice (stopped or interrupted treatment)","Physician decision (stopped or interrupted treatment)","Treatment stopped due to lack of efficacy (disease progression)","Treatment stopped due to acute toxicity","Other","Not applicable","Unknown"]},"meta":{"displayName":"Outcome Of Therapy"}},"hemotological_toxicity":{"changeType":"deleted","name":"hemotological_toxicity","description":"Indicate the hemotological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5"]},"meta":{"displayName":"Hemotological Toxicity","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"chemotherapy":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"description":{"left":"Name of agent or drug administered to patient as part of the treatment regimen.","right":"Name of agent or drug administered to donor as part of the treatment regimen."},"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"created","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"created","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"created","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"created","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}},"deleted":{"chemotherapy_dosage_units":{"changeType":"deleted","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate the total drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"description":{"left":"Name of agent or drug administered to patient as part of the treatment regimen.","right":"Name of agent or drug administered to donor as part of the treatment regimen."},"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"created","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{"hormone_drug_dosage_units":{"changeType":"deleted","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"radiation":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"radiation_therapy_fractions":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"radiation_therapy_dosage":{"valueType":{"left":"integer","right":"number"},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"anatomical_site_irradiated":{"description":{"left":"Indicate localization site where radiation therapy was administered.","right":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)"},"restrictions":{"codeList":{"left":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"right":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"data":{"added":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"],"deleted":["Bone","Extremities","Head-Neck","Peritoneum"]}}}}},"created":{"radiation_boost":{"changeType":"created","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"created","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}},"deleted":{}},"follow_up":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_follow_up_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"disease_status_at_followup":{"description":{"left":"Indicate the donor's disease status at time of follow-up.","right":"Indicate the donor's disease status at time of follow-up. (Reference: RECIST)"},"restrictions":{"codeList":{"left":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Relapse or recurrence","Stable"],"right":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Progression NOS","Relapse or recurrence","Stable"],"data":{"added":["Progression NOS"],"deleted":[]}}}},"submitter_primary_diagnosis_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null},"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null},"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"treatment.submitter_treatment_id"}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"weight_at_followup":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"relapse_type":{"restrictions":{"script":{"left":["(function validate() {\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"relapse_interval":{"restrictions":{"script":{"left":["(function validate() {\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const intervalOfFollowup = parseInt($row.interval_of_followup);\r\n\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n relapseInterval = parseInt($field);\r\n if (relapseInterval > intervalOfFollowup) {\r\n result = {valid: false, message: `'${$name}' cannot be greater than the 'interval_of_followup'.` }\r\n }\r\n }\r\n return result;\r\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"]}}},"method_of_progression_status":{"description":{"left":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Codelist reference: NCI CDE ID: 6161031)","right":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Reference: caDSR CDE ID 6161031)"},"restrictions":{"script":{"left":["(function validate() {\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}},"script":{"left":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n /* This is not a required field, so first ensure that it exists */\r\n if ($field) {\r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })()","(function validate() {\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_t_category":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"recurrence_n_category":{"meta":{"core":{"left":true,"right":null}}},"recurrence_m_category":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"recurrence_stage_group":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.recurrence_tumour_staging_system && $field) {\r\n let codeList = [];\r\n switch ($row.recurrence_tumour_staging_system && $row.recurrence_tumour_staging_system.trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb',\r\n 'stage ive',\r\n 'stage ivs'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When 'recurrence_tumour_staging_system' is set to '${\r\n $row.recurrence_tumour_staging_system\r\n }', 'recurrence_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"posttherapy_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n /* This is not a required field, so first ensure that it exists */\r\n if ($field) {\r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"posttherapy_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"posttherapy_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"posttherapy_stage_group":{"restrictions":{"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.posttherapy_tumour_staging_system && $field) {\r\n let codeList = [];\r\n switch ($row.posttherapy_tumour_staging_system && $row.posttherapy_tumour_staging_system.trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb',\r\n 'stage ive',\r\n 'stage ivs'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When 'posttherapy_tumour_staging_system' is set to '${\r\n $row.posttherapy_tumour_staging_system\r\n }', 'posttherapy_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}}},"created":{"anatomic_site_progression_or_recurrence":{"changeType":"created","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"anatomic_site_progression_or_recurrences":{"changeType":"deleted","description":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate() {\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })()"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1,C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}}}},"immunotherapy":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"immunotherapy_type":{"changeType":"created","name":"immunotherapy_type","valueType":"string","description":"Indicate the type of immunotherapy administered to donor.","meta":{"displayName":"Immunotherapy Type","core":true},"restrictions":{"required":true,"codeList":["Cell-based","Immune checkpoint inhibitors","Monoclonal antibodies other than immune checkpoint inhibitors","Other immunomodulatory substances"]}},"drug_rxnormcui":{"changeType":"created","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"created","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"created","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{}},"surgery":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"created","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"created","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"created","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"created","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"created","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"created","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"created","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"created","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"created","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"created","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"created","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"created","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"created","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"created","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}},"deleted":{}},"exposure":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"created","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"created","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"created","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"created","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"created","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"created","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"created","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"created","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"created","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"created","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"created","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"created","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"created","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}},"deleted":{}},"family_history":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"family_relative_id":{"changeType":"created","description":"Unique identifier of the relative, assigned by the data provider.","name":"family_relative_id","valueType":"string","meta":{"displayName":"Family Relative ID","primaryId":true,"notes":"This field is required to ensure that family members are identified in unique records. Ids can be as simple as an incremented numeral to ensure uniqueness."},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"relative_with_cancer_history":{"changeType":"created","description":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","name":"relative_with_cancer_history","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Relative with Cancer History"}},"relationship_type":{"changeType":"created","description":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","name":"relationship_type","restrictions":{"codeList":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"]},"valueType":"string","meta":{"displayName":"Relationship Type"}},"gender_of_relative":{"changeType":"created","description":"The self-reported gender of related individual.","name":"gender_of_relative","restrictions":{"codeList":["Female","Male","Other","Unknown"]},"valueType":"string","meta":{"displayName":"Gender of Relative"}},"age_of_relative_at_diagnosis":{"changeType":"created","description":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","name":"age_of_relative_at_diagnosis","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","displayName":"Age Of Relative At Diagnosis"}},"cancer_type_code_of_relative":{"changeType":"created","name":"cancer_type_code_of_relative","valueType":"string","description":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"examples":"C41.1,C16.9,C00.5,D46.9","dependsOn":"family_history.relative_with_cancer_history","displayName":"Cancer Type Code (ICD-10) of Relative"}},"relative_vital_status":{"changeType":"created","description":"Relative's last known state of living or deceased.","name":"relative_vital_status","restrictions":{"codeList":["Alive","Deceased","Unknown"]},"valueType":"string","meta":{"displayName":"Vital Status of Relative"}},"cause_of_death_of_relative":{"changeType":"created","description":"Indicate the cause of the death of the relative.","name":"cause_of_death_of_relative","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]},"valueType":"string","meta":{"dependsOn":"family_history.relative_vital_status","displayName":"Cause of Death of Relative"}},"relative_survival_time":{"changeType":"created","description":"Indicate how long, in days, the relative survived from the time they were diagnosed with cancer.","name":"relative_survival_time","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","units":"days","displayName":"Survival Time Of Relative"}}},"deleted":{}},"biomarker":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"created","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"created","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"created","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"created","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"created","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"created","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"created","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"created","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"created","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"created","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"created","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"created","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"created","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"created","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"created","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"created","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"created","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"created","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"created","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}},"deleted":{}},"comorbidity":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"created","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"created","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"created","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"created","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"created","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"created","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}},"deleted":{}}}} diff --git a/website/static/data/schemas/diffs/1.1/1.1-diff-1.24.json b/website/static/data/schemas/diffs/1.1/1.1-diff-1.24.json new file mode 100644 index 00000000..ad276aa5 --- /dev/null +++ b/website/static/data/schemas/diffs/1.1/1.1-diff-1.24.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"],"deleted":[]}},"script":{"left":["(function validate() {\n\n const row = $row;\n let result = {valid: true, message: \"Ok\"};\n \n const designation = row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\"){\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when tumour_normal_designation is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when tumour_normal_designation is set to Tumour.\"};\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"]}}},"submitter_sample_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased","Unknown"],"right":["Alive","Deceased"],"data":{"added":[],"deleted":["Unknown"]}}}},"cause_of_death":{"restrictions":{"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]}}},"survival_time":{"restrictions":{"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"primary_site":{"meta":{"notes":{"left":null,"right":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"examples":{"left":null,"right":"Breast|Ovary"}},"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Not Reported","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva","Unknown"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"data":{"added":["Unknown primary site"],"deleted":["Not Reported","Unknown"]}}}},"height":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"weight":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"bmi":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"menopause_status":{"description":{"left":"Indicate the donor's menopause status at the time of primary diagnosis. (Codelist reference: NCI CDE ID: 2434914)","right":"Indicate the donor's menopause status at the time of primary diagnosis. (Reference: caDSR CDE ID 2434914)"},"restrictions":{"codeList":{"left":["Indeterminate or unknown","Not applicable","Perimenopausal","Postmenopausal","Premenopausal"],"right":["Not applicable","Perimenopausal","Postmenopausal","Premenopausal","Unknown"],"data":{"added":["Unknown"],"deleted":["Indeterminate or unknown"]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age of menarche, the first occurrence of menstruation.","right":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)"},"restrictions":{}},"number_of_pregnancies":{"description":{"left":"Indicate the number of pregnancies a donor has had.","right":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)"},"restrictions":{}},"number_of_children":{"description":{"left":"Indicate the number of children the donor has birthed.","right":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)"},"restrictions":{}}},"created":{"genetic_disorders":{"changeType":"created","description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},"hrt_type":{"changeType":"created","description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},"hrt_duration":{"changeType":"created","description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},"contraception_type":{"changeType":"created","description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},"contraception_duration":{"changeType":"created","description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},"lost_to_followup_after_clinical_event_id":{"changeType":"created","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}},"deleted":{"prior_malignancy":{"changeType":"deleted","description":"Prior malignancy affecting donor.","name":"prior_malignancy","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy","examples":"C41.1, C16.9, C00.5, D46.9"}},"cancer_type_prior_malignancy":{"changeType":"deleted","description":"The code to represent the cancer type of a prior malignancy using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","name":"cancer_type_prior_malignancy","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"valueType":"string","meta":{"displayName":"Cancer Type Prior Malignancy"}},"age_at_prior_malignancy":{"changeType":"deleted","description":"If donor has history of prior malignancy, indicate age at previous diagnosis, in years.","name":"age_at_prior_malignancy","valueType":"integer","meta":{"displayName":"Age at Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"deleted","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Codelist reference: NCI CDE: 4122391)","name":"laterality_of_prior_malignancy","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality at Prior Malignancy"}}}},"specimen":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null},"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"pathological_tumour_staging_system":{"meta":{"validationDependency":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"pathological_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"pathological_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"pathological_stage_group":{"restrictions":{"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n if ($row.pathological_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.pathological_tumour_staging_system && $row.pathological_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'pathological_tumour_staging_system' is set to '${\n $row.pathological_tumour_staging_system\n }', 'pathological_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"specimen_storage":{"description":{"left":"Indicate the method of specimen storage for specimens that were not extracted freshly or immediately cultured.","right":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured."},"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"reference_pathology_confirmed":{"description":{"left":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist.","right":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)"}},"tumour_grading_system":{"meta":{"validationDependency":{"left":null,"right":true}}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = \"'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.\";\n result.message = msg;\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"percent_tumour_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of infiltration by tumour cells in a specimen.","right":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)"},"restrictions":{}},"percent_proliferating_cells":{"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_inflammatory_tissue":{"description":{"left":"Indicate a value, in decimals, that represents local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue.","right":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_stromal_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a malignant tumour specimen but are not malignant such as fibroblasts, vascular structures, etc.","right":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_necrosis":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of cell death in a malignant tumour specimen.","right":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}}},"created":{"specimen_laterality":{"changeType":"created","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"percent_tumour_cells_measurement_method":{"changeType":"created","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}},"deleted":{}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"age_at_diagnosis":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0,"max":90}}}},"number_lymph_nodes_positive":{"description":{"left":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: NCI CDE ID: 6113694)","right":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: caDSR CDE ID 6113694)"},"meta":{"dependsOn":{"left":null,"right":"primary_diagnosis.lymph_nodes_examined_status"},"notes":{"left":null,"right":"This field is only required if 'lymph_nodes_examined_status' is 'Yes'."}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"]},"range":{"left":null,"right":{"min":0}}}},"number_lymph_nodes_examined":{"description":{"left":"The total number of lymph nodes tested for the presence of cancer. (Reference: NCI CDE ID: 3)","right":"The total number of lymph nodes tested for the presence of cancer. (Reference: caDSR CDE ID 3)"},"meta":{"dependsOn":{"left":null,"right":"primary_diagnosis.lymph_nodes_examined_status"},"notes":{"left":null,"right":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'."}},"restrictions":{}},"clinical_tumour_staging_system":{"meta":{"validationDependency":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"required":{"left":true,"right":null},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"clinical_stage_group":{"description":{"left":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.).","right":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage."},"meta":{"examples":{"left":null,"right":"Stage I, Stage IIB"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n if ($row.clinical_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'clinical_tumour_staging_system' is set to '${\n $row.clinical_tumour_staging_system\n }', 'clinical_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"clinical_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"clinical_n_category":{"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"clinical_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"presenting_symptoms":{"restrictions":{"codeList":{"left":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Loss of Appetite","Nausea","None","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Unknown","Vomiting","Weight Loss"],"right":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Loss of Appetite","Nausea","None","Not Reported","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Swelling in the Neck","Unknown","Vomiting","Weight Loss"],"data":{"added":["Not Reported","Swelling in the Neck"],"deleted":[]}}}},"performance_status":{"description":{"left":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference source: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status).","right":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status)."},"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}}},"created":{"laterality":{"changeType":"created","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_status":{"changeType":"created","name":"lymph_nodes_examined_status","description":"Indicate if lymph nodes were examined for metastases.","valueType":"string","restrictions":{"required":true,"codeList":["Cannot be determined","No","No lymph nodes found in resected specimen","Not applicable","Yes"]},"meta":{"core":true,"displayName":"Lymph Nodes Examined Status"}},"lymph_nodes_examined_method":{"changeType":"created","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}},"deleted":{}},"treatment":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null},"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":["End of life care"],"deleted":[]}}}},"is_primary_treatment":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Yes","No","Unknown"],"right":["Yes","No"],"data":{"added":[],"deleted":["Unknown"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"line_of_treatment":{"meta":{"dependsOn":{"left":null,"right":"treatment.is_primary_treatment"}},"restrictions":{}},"treatment_start_interval":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_duration":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"days_per_cycle":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{}},"number_of_cycles":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{}},"toxicity_type":{"description":{"left":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hemotological toxicity or non-hemotological toxicity.","right":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity."},"meta":{"dependsOn":{"left":null,"right":"treatment.outcome_of_treatment"}},"restrictions":{"codeList":{"left":["Hemotological","Non-hemotological"],"right":["Hematological","Non-hematological","Not applicable","Unknown"],"data":{"added":["Hematological","Non-hematological","Not applicable","Unknown"],"deleted":["Hemotological","Non-hemotological"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"]}}},"adverse_events":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"codeList":{"left":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"right":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"data":{"added":["None","Unknown"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"clinical_trials_database":{"meta":{"notes":{"left":null,"right":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added."}},"restrictions":{"codeList":{"left":["NCI Clinical Trials","EU Clinical Trials Register"],"right":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"],"data":{"added":["Not applicable","Unknown"],"deleted":[]}}}},"clinical_trial_number":{"restrictions":{"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: 'The submitted NCI clinical trial number is in incorrect format.'};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: \"The submitted EudraCT clinical trial number is in incorrect format.\"};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: \"The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database.\"};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: \"'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.\"};\n } \n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"]}}}},"created":{"treatment_intent":{"changeType":"created","name":"treatment_intent","description":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"]},"meta":{"core":true,"displayName":"Treatment Intent","dependsOn":"treatment.treatment_type"}},"treatment_setting":{"changeType":"created","name":"treatment_setting","description":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: NCIt C124308)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"]},"meta":{"core":true,"displayName":"Treatment Setting","dependsOn":"treatment.treatment_type"}},"response_to_treatment_criteria_method":{"changeType":"created","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},"response_to_treatment":{"changeType":"created","name":"response_to_treatment","description":"The donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"codeList":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"]},"meta":{"core":true,"displayName":"Response To Treatment","dependsOn":"treatment.response_to_treatment_criteria_method","notes":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"outcome_of_treatment":{"changeType":"created","name":"outcome_of_treatment","description":"Indicate the donor's outcome of the prescribed treatment.","valueType":"string","restrictions":{"codeList":["Treatment completed as prescribed","Treatment incomplete due to technical or organizational problems","Treatment incomplete because patient died","Patient choice (stopped or interrupted treatment)","Physician decision (stopped or interrupted treatment)","Treatment stopped due to lack of efficacy (disease progression)","Treatment stopped due to acute toxicity","Other","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Outcome Of Treatment","dependsOn":"treatment.treatment_type"}},"hematological_toxicity":{"changeType":"created","name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"non-hematological_toxicity":{"changeType":"created","name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"age_at_consent_for_treatment":{"changeType":"deleted","name":"age_at_consent_for_treatment","description":"Indicate the age of donor when consent was given for treatment.","valueType":"integer","meta":{"displayName":"Age At Consent For Treatment"}},"therapeutic_intent":{"changeType":"deleted","name":"therapeutic_intent","description":"The therapeutic intent, the reason behind the choice of a therapy, of the treatment.","valueType":"string","restrictions":{"required":true,"codeList":["Adjuvant","Concurrent","Curative","Neoadjuvant","Not applicable","Palliative","Unknown"]},"meta":{"core":true,"displayName":"Therapeutic Intent"}},"response_to_therapy":{"changeType":"deleted","name":"response_to_therapy","description":"The donor's response to the applied treatment regimen. (Source: RECIST)","valueType":"string","restrictions":{"required":true,"codeList":["Complete response","Disease progression","NED","Partial response","Stable disease"]},"meta":{"core":true,"displayName":"Response To Therapy"}},"outcome_of_therapy":{"changeType":"deleted","name":"outcome_of_therapy","description":"Indicate the donor's outcome of the prescribed treatment.","valueType":"string","restrictions":{"codeList":["Treatment completed as prescribed","Treatment incomplete due to technical or organizational problems","Treatment incomplete because patient died","Patient choice (stopped or interrupted treatment)","Physician decision (stopped or interrupted treatment)","Treatment stopped due to lack of efficacy (disease progression)","Treatment stopped due to acute toxicity","Other","Not applicable","Unknown"]},"meta":{"displayName":"Outcome Of Therapy"}},"hemotological_toxicity":{"changeType":"deleted","name":"hemotological_toxicity","description":"Indicate the hemotological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5"]},"meta":{"displayName":"Hemotological Toxicity","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"chemotherapy":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"description":{"left":"Name of agent or drug administered to patient as part of the treatment regimen.","right":"Name of agent or drug administered to donor as part of the treatment regimen."},"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"created","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"created","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"created","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"created","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}},"deleted":{"chemotherapy_dosage_units":{"changeType":"deleted","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate the total drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"description":{"left":"Name of agent or drug administered to patient as part of the treatment regimen.","right":"Name of agent or drug administered to donor as part of the treatment regimen."},"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"created","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{"hormone_drug_dosage_units":{"changeType":"deleted","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"radiation":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"radiation_therapy_fractions":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"radiation_therapy_dosage":{"valueType":{"left":"integer","right":"number"},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"anatomical_site_irradiated":{"description":{"left":"Indicate localization site where radiation therapy was administered.","right":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)"},"restrictions":{"codeList":{"left":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"right":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"data":{"added":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"],"deleted":["Bone","Extremities","Head-Neck","Peritoneum"]}}}}},"created":{"radiation_boost":{"changeType":"created","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"created","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}},"deleted":{}},"follow_up":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_follow_up_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null},"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null},"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"treatment.submitter_treatment_id"}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"weight_at_followup":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"relapse_type":{"restrictions":{"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"relapse_interval":{"restrictions":{"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `'${$name}' cannot be greater than the 'interval_of_followup'.` }\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"]}}},"method_of_progression_status":{"description":{"left":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Codelist reference: NCI CDE ID: 6161031)","right":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Reference: caDSR CDE ID 6161031)"},"restrictions":{"script":{"left":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}},"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_t_category":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"recurrence_n_category":{"meta":{"core":{"left":true,"right":null}}},"recurrence_m_category":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"recurrence_stage_group":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n if ($row.recurrence_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.recurrence_tumour_staging_system && $row.recurrence_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'recurrence_tumour_staging_system' is set to '${\n $row.recurrence_tumour_staging_system\n }', 'recurrence_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"posttherapy_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"posttherapy_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"posttherapy_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"posttherapy_stage_group":{"restrictions":{"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n if ($row.posttherapy_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.posttherapy_tumour_staging_system && $row.posttherapy_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'posttherapy_tumour_staging_system' is set to '${\n $row.posttherapy_tumour_staging_system\n }', 'posttherapy_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })()"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}}},"created":{"anatomic_site_progression_or_recurrence":{"changeType":"created","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"anatomic_site_progression_or_recurrences":{"changeType":"deleted","description":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })()"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1,C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}}}},"immunotherapy":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"immunotherapy_type":{"changeType":"created","name":"immunotherapy_type","valueType":"string","description":"Indicate the type of immunotherapy administered to donor.","meta":{"displayName":"Immunotherapy Type","core":true},"restrictions":{"required":true,"codeList":["Cell-based","Immune checkpoint inhibitors","Monoclonal antibodies other than immune checkpoint inhibitors","Other immunomodulatory substances"]}},"drug_rxnormcui":{"changeType":"created","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"created","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"created","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{}},"surgery":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"created","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"created","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"created","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"created","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"created","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"created","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"created","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"created","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"created","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"created","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"created","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"created","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"created","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"created","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}},"deleted":{}},"exposure":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"created","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"created","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"created","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"created","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"created","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"created","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"created","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"created","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"created","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"created","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"created","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"created","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"created","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}},"deleted":{}},"family_history":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"family_relative_id":{"changeType":"created","description":"Unique identifier of the relative, assigned by the data provider.","name":"family_relative_id","valueType":"string","meta":{"displayName":"Family Relative ID","primaryId":true,"notes":"This field is required to ensure that family members are identified in unique records. Ids can be as simple as an incremented numeral to ensure uniqueness."},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"relative_with_cancer_history":{"changeType":"created","description":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","name":"relative_with_cancer_history","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Relative with Cancer History"}},"relationship_type":{"changeType":"created","description":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","name":"relationship_type","restrictions":{"codeList":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"]},"valueType":"string","meta":{"displayName":"Relationship Type"}},"gender_of_relative":{"changeType":"created","description":"The self-reported gender of related individual.","name":"gender_of_relative","restrictions":{"codeList":["Female","Male","Other","Unknown"]},"valueType":"string","meta":{"displayName":"Gender of Relative"}},"age_of_relative_at_diagnosis":{"changeType":"created","description":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","name":"age_of_relative_at_diagnosis","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","displayName":"Age Of Relative At Diagnosis"}},"cancer_type_code_of_relative":{"changeType":"created","name":"cancer_type_code_of_relative","valueType":"string","description":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"examples":"C41.1,C16.9,C00.5,D46.9","dependsOn":"family_history.relative_with_cancer_history","displayName":"Cancer Type Code (ICD-10) of Relative"}},"relative_vital_status":{"changeType":"created","description":"Relative's last known state of living or deceased.","name":"relative_vital_status","restrictions":{"codeList":["Alive","Deceased","Unknown"]},"valueType":"string","meta":{"displayName":"Vital Status of Relative"}},"cause_of_death_of_relative":{"changeType":"created","description":"Indicate the cause of the death of the relative.","name":"cause_of_death_of_relative","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]},"valueType":"string","meta":{"dependsOn":"family_history.relative_vital_status","displayName":"Cause of Death of Relative"}},"relative_survival_time":{"changeType":"created","description":"Indicate how long, in days, the relative survived from the time they were diagnosed with cancer.","name":"relative_survival_time","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","units":"days","displayName":"Survival Time Of Relative"}}},"deleted":{}},"biomarker":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"created","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"created","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"created","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"created","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"created","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"created","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"created","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"created","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"created","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"created","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"created","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"created","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"created","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"created","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"created","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"created","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"created","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"created","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"created","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}},"deleted":{}},"comorbidity":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"created","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"created","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"created","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"created","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"created","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"created","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}},"deleted":{}}}} diff --git a/website/static/data/schemas/diffs/1.10/1.10-diff-1.24.json b/website/static/data/schemas/diffs/1.10/1.10-diff-1.24.json new file mode 100644 index 00000000..083d4d30 --- /dev/null +++ b/website/static/data/schemas/diffs/1.10/1.10-diff-1.24.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \r\n const designation = $row.tumour_normal_designation.trim().toLowerCase();\r\n const specimen_type = $field.trim().toLowerCase();\r\n \r\n if (designation === \"normal\") {\r\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\r\n if (!validTypes.includes(specimen_type)) {\r\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\r\n }\r\n }\r\n else if (designation === \"tumour\") {\r\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\r\n if (invalidTypes.includes(specimen_type)) {\r\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\r\n }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"]}}},"submitter_sample_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased","Unknown"],"right":["Alive","Deceased"],"data":{"added":[],"deleted":["Unknown"]}}}},"cause_of_death":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n \r\n if ($row.vital_status != null) {\r\n const vitalStatus = $row.vital_status.trim().toLowerCase();\r\n\r\n if (!currField && vitalStatus === \"deceased\") {\r\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\r\n }\r\n else if (currField && vitalStatus != \"deceased\"){\r\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\r\n }\r\n }\r\n else if (($row.vital_status === null) && (currField)) {\r\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]}}},"survival_time":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n \r\n if ($row.vital_status != null) {\r\n const vitalStatus = $row.vital_status.trim().toLowerCase();\r\n\r\n if (!currField && vitalStatus === \"deceased\") {\r\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\r\n }\r\n else if (currField && vitalStatus != \"deceased\"){\r\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\r\n }\r\n }\r\n else if (($row.vital_status === null) && (currField)) {\r\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]}}},"primary_site":{"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"data":{"added":["Unknown primary site"],"deleted":[]}}}},"genetic_disorders":{"description":{"left":"Indicate presence of any hereditary genetic disorders. (Reference: Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","right":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)"},"restrictions":{"codeList":{"left":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Serrated Polyposis Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"],"right":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"],"data":{"added":["None","Not applicable","Unknown"],"deleted":[]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age at which the first menstruation event occurred. (Reference: NCIt C19666)","right":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)"}},"hrt_type":{"restrictions":{"codeList":{"left":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Other","Patch","Pill","Unknown"],"right":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"],"data":{"added":["Not applicable"],"deleted":[]}}}},"hrt_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n const type = $name.trim().toLowerCase().split('_duration')[0];\r\n const hormoneType = type + `_type`;\r\n \r\n if ($field != null && !(checkforEmpty($field))) {\r\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\r\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\r\n }\r\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\") {\r\n const submittedValue = $row[hormoneType].toLowerCase()\r\n result = {valid: false, message: `If '${$name}' is submitted, then '${hormoneType}' field cannot be '${submittedValue}'.`};\r\n }\r\n\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"]}}},"contraception_type":{"restrictions":{"codeList":{"left":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Other","Progestin-only pill","Unknown","Vaginal ring"],"right":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"],"data":{"added":["Not applicable","Oral contraceptive pill"],"deleted":[]}}}},"contraception_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n const type = $name.trim().toLowerCase().split('_duration')[0];\r\n const hormoneType = type + `_type`;\r\n \r\n if ($field != null && !(checkforEmpty($field))) {\r\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\r\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\r\n }\r\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\") {\r\n const submittedValue = $row[hormoneType].toLowerCase()\r\n result = {valid: false, message: `If '${$name}' is submitted, then '${hormoneType}' field cannot be '${submittedValue}'.`};\r\n }\r\n\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"]}}}},"created":{"lost_to_followup_after_clinical_event_id":{"changeType":"created","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}},"deleted":{}},"specimen":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"pathological_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\r\n\r\n \r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\r\n if (!($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n /* This is not a required field, so first ensure that it exists */\r\n else if ($field) {\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"pathological_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"pathological_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"pathological_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Cannot be assessed"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_stage_group')[0];\r\n\r\n const stagingSystem = stagingName + `_tumour_staging_system`;\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\r\n result.valid = false;\r\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\r\n result.message = msg;\r\n }\r\n else if (!($row[stagingSystem]) && $field) {\r\n result.valid = false;\r\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\r\n result.message = msg;\r\n }\r\n else if ($row[stagingSystem] && $field) {\r\n let codeList = [];\r\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage ii bulky',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ies',\r\n 'stage iae',\r\n 'stage ias',\r\n 'stage iaes',\r\n 'stage ib',\r\n 'stage ibe',\r\n 'stage ibs',\r\n 'stage ibes',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iies',\r\n 'stage iiae',\r\n 'stage iias',\r\n 'stage iiaes',\r\n 'stage iib',\r\n 'stage iibe',\r\n 'stage iibs',\r\n 'stage iibes',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iiies',\r\n 'stage iiiae',\r\n 'stage iiias',\r\n 'stage iiiaes',\r\n 'stage iiib',\r\n 'stage iiibe',\r\n 'stage iiibs',\r\n 'stage iiibes',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ive',\r\n 'stage ivs',\r\n 'stage ives',\r\n 'stage ivae',\r\n 'stage ivas',\r\n 'stage ivaes',\r\n 'stage ivb',\r\n 'stage ivbe',\r\n 'stage ivbs',\r\n 'stage ivbes'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\r\n $row[stagingSystem]\r\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n \r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"specimen_acquisition_interval":{"restrictions":{"range":{"left":{"min":0},"right":null}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"specimen_storage":{"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"reference_pathology_confirmed":{"description":{"left":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist.","right":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)"}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.tumour_grading_system && $field) {\r\n let codeList = [];\r\n const tieredGradingList = ['gx','g1','g2','g3'];\r\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\r\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\r\n case 'two-tier grading system':\r\n codeList = [\r\n 'low grade',\r\n 'high grade',\r\n ];\r\n break;\r\n case 'three-tier grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'four-tier grading system':\r\n codeList = [\r\n 'gx',\r\n 'g1',\r\n 'g2',\r\n 'g3',\r\n 'g4',\r\n ];\r\n break;\r\n case 'grading system for gists':\r\n codeList = [\r\n 'low',\r\n 'high',\r\n ];\r\n break;\r\n case 'grading system for gnets':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'isup grading system':\r\n codeList = [\r\n 'gx',\r\n 'g1',\r\n 'g2',\r\n 'g3',\r\n 'g4',\r\n ];\r\n break;\r\n case 'who grading system for cns tumours':\r\n codeList = [\r\n 'grade i',\r\n 'grade ii',\r\n 'grade iii',\r\n 'grade iv',\r\n ];\r\n break;\r\n case 'fnclcc grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'gleason grade group system':\r\n codeList = [\r\n 'grade group 1',\r\n 'grade group 2',\r\n 'grade group 3',\r\n 'grade group 4',\r\n 'grade group 5',\r\n ];\r\n break;\r\n case 'scarff-bloom-richardson grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'nuclear grading system for dcis':\r\n codeList = tieredGradingList;\r\n break;\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase())) {\r\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\r\n $row.tumour_grading_system\r\n }', 'tumour_grade' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\r\n result.valid = false;\r\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"percent_tumour_cells":{"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"]}}},"percent_proliferating_cells":{"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}}},"percent_inflammatory_tissue":{"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}}},"percent_stromal_cells":{"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}}},"percent_necrosis":{"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}}}},"created":{"specimen_laterality":{"changeType":"created","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"percent_tumour_cells_measurement_method":{"changeType":"created","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}},"deleted":{}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"number_lymph_nodes_examined":{"meta":{"notes":{"left":null,"right":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'."}},"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n /* checks for a string just consisting of whitespacei */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\r\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\r\n \r\n if ($row.lymph_nodes_examined_status != null) {\r\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\r\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\r\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\r\n if (lymphNodesExaminedStatus === \"yes\") { \r\n if (parseInt($field) <= 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n else if (parseInt($field) > 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n \r\n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\r\n else if ($name === \"number_lymph_nodes_positive\") {\r\n if (lymphNodesExaminedStatus === \"yes\") {\r\n if (checkforEmpty($field) || $field == null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n else if (parseInt($field) < 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n else if ($field || $field != null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n }\r\n return result;\r\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"]}}},"number_lymph_nodes_positive":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n /* checks for a string just consisting of whitespacei */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\r\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\r\n \r\n if ($row.lymph_nodes_examined_status != null) {\r\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\r\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\r\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\r\n if (lymphNodesExaminedStatus === \"yes\") { \r\n if (parseInt($field) <= 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n else if (parseInt($field) > 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n \r\n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\r\n else if ($name === \"number_lymph_nodes_positive\") {\r\n if (lymphNodesExaminedStatus === \"yes\") {\r\n if (checkforEmpty($field) || $field == null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n else if (parseInt($field) < 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n else if ($field || $field != null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n }\r\n return result;\r\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"]}}},"clinical_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\r\n\r\n \r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\r\n if (!($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n /* This is not a required field, so first ensure that it exists */\r\n else if ($field) {\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"clinical_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"clinical_n_category":{"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"clinical_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"clinical_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Cannot be assessed"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_stage_group')[0];\r\n\r\n const stagingSystem = stagingName + `_tumour_staging_system`;\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\r\n result.valid = false;\r\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\r\n result.message = msg;\r\n }\r\n else if (!($row[stagingSystem]) && $field) {\r\n result.valid = false;\r\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\r\n result.message = msg;\r\n }\r\n else if ($row[stagingSystem] && $field) {\r\n let codeList = [];\r\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage ii bulky',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ies',\r\n 'stage iae',\r\n 'stage ias',\r\n 'stage iaes',\r\n 'stage ib',\r\n 'stage ibe',\r\n 'stage ibs',\r\n 'stage ibes',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iies',\r\n 'stage iiae',\r\n 'stage iias',\r\n 'stage iiaes',\r\n 'stage iib',\r\n 'stage iibe',\r\n 'stage iibs',\r\n 'stage iibes',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iiies',\r\n 'stage iiiae',\r\n 'stage iiias',\r\n 'stage iiiaes',\r\n 'stage iiib',\r\n 'stage iiibe',\r\n 'stage iiibs',\r\n 'stage iiibes',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ive',\r\n 'stage ivs',\r\n 'stage ives',\r\n 'stage ivae',\r\n 'stage ivas',\r\n 'stage ivaes',\r\n 'stage ivb',\r\n 'stage ivbe',\r\n 'stage ivbs',\r\n 'stage ivbes'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\r\n $row[stagingSystem]\r\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n \r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"performance_status":{"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}}},"created":{"laterality":{"changeType":"created","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_method":{"changeType":"created","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}},"deleted":{}},"treatment":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":["End of life care"],"deleted":[]}}}},"is_primary_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Yes","No","Unknown"],"right":["Yes","No"],"data":{"added":[],"deleted":["Unknown"]}}}},"line_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\r\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\r\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\r\n if (isPrimaryTreatment === 'yes') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\r\n }\r\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\r\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\r\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\r\n }\r\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\r\n else if (isPrimaryTreatment === 'unknown') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'unknown'.`};\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"]}}},"treatment_start_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":{"exclusiveMin":0},"right":null}}},"treatment_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"days_per_cycle":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"number_of_cycles":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_intent":{"description":{"left":"Indicate the intended disease outcome for which the treatment is given. (Reference: NCIt C124307)","right":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)"},"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Curative","Palliative","Unknown"],"right":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"],"data":{"added":["Diagnostic","Forensic","Guidance","Preventative","Screening","Supportive"],"deleted":["Unknown"]}}}},"treatment_setting":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Adjuvant","Advanced/Metastatic","Neoadjuvant","Not applicable"],"right":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"],"data":{"added":["Conditioning","Induction","Maintenance","Mobilization","Preventative","Radiosensitization","Salvage"],"deleted":["Not applicable"]}}}},"response_to_treatment":{"description":{"left":"The donor's response to the applied treatment regimen. (Source: RECIST)","right":"The donor's response to the applied treatment regimen."},"meta":{"dependsOn":{"left":"treatment.treatment_type","right":"treatment.response_to_treatment_criteria_method"},"notes":{"left":null,"right":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"]},"codeList":{"left":["Complete response","Disease progression","NED","Partial response","Stable disease"],"right":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"],"data":{"added":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease"],"deleted":["Disease progression","NED"]}}}},"outcome_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"toxicity_type":{"restrictions":{"codeList":{"left":["Hematological","Non-hematological"],"right":["Hematological","Non-hematological","Not applicable","Unknown"],"data":{"added":["Not applicable","Unknown"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($field != null && !(checkforEmpty($field))) {\r\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \r\n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\r\n \r\n /* toxicityType should only be submitted if treatment was terminated early due to acute toxicity ('outcome_of_treatment' is 'Treatment stopped due to acute toxicity'). */\r\n if (outcomeOfTreatment != \"treatment stopped due to acute toxicity\") {\r\n result = { valid: false, message: `The 'outcome_of_treatment' field should be 'Treatment stopped due to acute toxicity' if the '${$name}' field is submitted.`};\r\n }\r\n }\r\n else {\r\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"]}}},"hematological_toxicity":{"restrictions":{"codeList":{"left":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5"],"right":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"data":{"added":["Unknown"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($field != null && !(checkforEmpty($field))) {\r\n if (($row.toxicity_type != null && !(checkforEmpty($row.toxicity_type)))) { \r\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\r\n \r\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\r\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\r\n }\r\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\r\n }\r\n }\r\n else {\r\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}},"non-hematological_toxicity":{"restrictions":{"codeList":{"left":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"right":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"data":{"added":["Unknown"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($field != null && !(checkforEmpty($field))) {\r\n if (($row.toxicity_type != null && !(checkforEmpty($row.toxicity_type)))) { \r\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\r\n \r\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\r\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\r\n }\r\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\r\n }\r\n }\r\n else {\r\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}},"adverse_events":{"restrictions":{"codeList":{"left":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"right":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"data":{"added":["None","Unknown"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"clinical_trials_database":{"meta":{"notes":{"left":null,"right":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added."}},"restrictions":{"codeList":{"left":["NCI Clinical Trials","EU Clinical Trials Register"],"right":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"],"data":{"added":["Not applicable","Unknown"],"deleted":[]}}}},"clinical_trial_number":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n //regex check for clinical trial number\r\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\r\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\r\n\r\n // list of valid clinical trial databases\r\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\r\n \r\n if ($row.clinical_trials_database && $field) {\r\n const trialNumber = $field.trim();\r\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\r\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\r\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\r\n }\r\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\r\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\r\n }\r\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\r\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database.`};\r\n }\r\n }\r\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\r\n result = {valid: true, message: \"Ok\"};\r\n }\r\n else if ($row.clinical_trials_database && !$field) {\r\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\r\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\r\n } \r\n }\r\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\r\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"]}}}},"created":{"response_to_treatment_criteria_method":{"changeType":"created","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}}},"deleted":{}},"chemotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"created","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"created","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"created","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"created","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}},"deleted":{"chemotherapy_dosage_units":{"changeType":"deleted","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate the total actual drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true,"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"created","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{"hormone_drug_dosage_units":{"changeType":"deleted","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true,"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"radiation":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"radiation_therapy_dosage":{"valueType":{"left":"integer","right":"number"}},"anatomical_site_irradiated":{"description":{"left":"Indicate localization site where radiation therapy was administered.","right":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)"},"restrictions":{"codeList":{"left":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"right":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"data":{"added":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"],"deleted":["Bone","Extremities","Head-Neck","Peritoneum"]}}}}},"created":{"radiation_boost":{"changeType":"created","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"created","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}},"deleted":{}},"immunotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"immunotherapy_type":{"meta":{"core":{"left":null,"right":true}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"immunotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"displayName":{"left":"Immunotherapy Drug Name","right":"Chemotherapy Drug Name"},"dependsOn":{"left":null,"right":"immunotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"created","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{}},"follow_up":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_follow_up_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"interval_of_followup":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"treatment.submitter_treatment_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"relapse_type":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n if ($row.disease_status_at_followup != null) {\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"relapse_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n if ($row.disease_status_at_followup != null) {\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const intervalOfFollowup = parseInt($row.interval_of_followup);\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n relapseInterval = parseInt($field);\r\n if (relapseInterval > intervalOfFollowup) {\r\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\r\n }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"]},"range":{"left":{"exclusiveMin":0},"right":null}}},"method_of_progression_status":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n if ($row.disease_status_at_followup != null) {\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"anatomic_site_progression_or_recurrence":{"description":{"left":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","right":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344."},"meta":{"examples":{"left":"C50.1,C18","right":"C50.1|C18"},"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}},"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n if ($row.disease_status_at_followup != null) {\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\r\n\r\n \r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\r\n if (!($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n /* This is not a required field, so first ensure that it exists */\r\n else if ($field) {\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })","(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n if ($row.disease_status_at_followup != null) {\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_t_category":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"recurrence_n_category":{"meta":{"core":{"left":true,"right":null}}},"recurrence_m_category":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"recurrence_stage_group":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Cannot be assessed"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_stage_group')[0];\r\n\r\n const stagingSystem = stagingName + `_tumour_staging_system`;\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\r\n result.valid = false;\r\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\r\n result.message = msg;\r\n }\r\n else if (!($row[stagingSystem]) && $field) {\r\n result.valid = false;\r\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\r\n result.message = msg;\r\n }\r\n else if ($row[stagingSystem] && $field) {\r\n let codeList = [];\r\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage ii bulky',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ies',\r\n 'stage iae',\r\n 'stage ias',\r\n 'stage iaes',\r\n 'stage ib',\r\n 'stage ibe',\r\n 'stage ibs',\r\n 'stage ibes',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iies',\r\n 'stage iiae',\r\n 'stage iias',\r\n 'stage iiaes',\r\n 'stage iib',\r\n 'stage iibe',\r\n 'stage iibs',\r\n 'stage iibes',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iiies',\r\n 'stage iiiae',\r\n 'stage iiias',\r\n 'stage iiiaes',\r\n 'stage iiib',\r\n 'stage iiibe',\r\n 'stage iiibs',\r\n 'stage iiibes',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ive',\r\n 'stage ivs',\r\n 'stage ives',\r\n 'stage ivae',\r\n 'stage ivas',\r\n 'stage ivaes',\r\n 'stage ivb',\r\n 'stage ivbe',\r\n 'stage ivbs',\r\n 'stage ivbes'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\r\n $row[stagingSystem]\r\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n \r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"posttherapy_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\r\n\r\n \r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\r\n if (!($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n /* This is not a required field, so first ensure that it exists */\r\n else if ($field) {\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"posttherapy_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"posttherapy_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"posttherapy_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Cannot be assessed"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_stage_group')[0];\r\n\r\n const stagingSystem = stagingName + `_tumour_staging_system`;\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\r\n result.valid = false;\r\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\r\n result.message = msg;\r\n }\r\n else if (!($row[stagingSystem]) && $field) {\r\n result.valid = false;\r\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\r\n result.message = msg;\r\n }\r\n else if ($row[stagingSystem] && $field) {\r\n let codeList = [];\r\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage ii bulky',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ies',\r\n 'stage iae',\r\n 'stage ias',\r\n 'stage iaes',\r\n 'stage ib',\r\n 'stage ibe',\r\n 'stage ibs',\r\n 'stage ibes',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iies',\r\n 'stage iiae',\r\n 'stage iias',\r\n 'stage iiaes',\r\n 'stage iib',\r\n 'stage iibe',\r\n 'stage iibs',\r\n 'stage iibes',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iiies',\r\n 'stage iiiae',\r\n 'stage iiias',\r\n 'stage iiiaes',\r\n 'stage iiib',\r\n 'stage iiibe',\r\n 'stage iiibs',\r\n 'stage iiibes',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ive',\r\n 'stage ivs',\r\n 'stage ives',\r\n 'stage ivae',\r\n 'stage ivas',\r\n 'stage ivaes',\r\n 'stage ivb',\r\n 'stage ivbe',\r\n 'stage ivbs',\r\n 'stage ivbes'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\r\n $row[stagingSystem]\r\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n \r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}}},"created":{},"deleted":{}},"exposure":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"tobacco_smoking_status":{"restrictions":{"codeList":{"left":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Smoking history not documented"],"right":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"],"data":{"added":["Not applicable"],"deleted":[]}}}},"tobacco_type":{"restrictions":{"codeList":{"left":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Roll-ups","Snuff","Unknown","Waterpipe"],"right":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"data":{"added":["Not applicable","Pipe"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n // check tobacco related fields\r\n if ($name === 'tobacco_type') {\r\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\r\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\r\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\r\n }\r\n else if ($row.tobacco_smoking_status.toLowerCase() === 'smoking history not documented') {\r\n result = { valid: false, message: `The 'tobacco_smoking_status' field (smoking status not documented) is inconsistent if donor smoked '${$row.tobacco_type}'.`};\r\n }\r\n else if ($row.tobacco_smoking_status.toLowerCase() === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if donor is a lifelong non-smoker.`}\r\n }\r\n }\r\n else {\r\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\r\n if (smokerCategories.includes($row.tobacco_smoking_status.toLowerCase())) {\r\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\r\n }\r\n }\r\n }\r\n }\r\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\r\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\r\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}}},"pack_years_smoked":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n // check tobacco related fields\r\n if ($name === 'tobacco_type') {\r\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\r\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\r\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\r\n }\r\n else if ($row.tobacco_smoking_status.toLowerCase() === 'smoking history not documented') {\r\n result = { valid: false, message: `The 'tobacco_smoking_status' field (smoking status not documented) is inconsistent if donor smoked '${$row.tobacco_type}'.`};\r\n }\r\n else if ($row.tobacco_smoking_status.toLowerCase() === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if donor is a lifelong non-smoker.`}\r\n }\r\n }\r\n else {\r\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\r\n if (smokerCategories.includes($row.tobacco_smoking_status.toLowerCase())) {\r\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\r\n }\r\n }\r\n }\r\n }\r\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\r\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\r\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}}},"alcohol_history":{"restrictions":{"codeList":{"left":["Yes","No","Unknown"],"right":["Yes","No","Not applicable","Unknown"],"data":{"added":["Not applicable"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\r\n noOrUnknownAllowedCategories = [\"none\", \"occasional drinker (< once a month)\", \"unknown\"];\r\n \r\n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\r\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\r\n if ((!$field || $field == null || checkforEmpty($field)) && alcoholHistoryCategories.includes(alcoholConsumptionCategory)) {\r\n result = {valid:false, message: `If the donor is a '${alcoholConsumptionCategory}', then the 'alcohol_history' field must be submitted as well.`};\r\n }\r\n if ((!$field || $field === null || checkforEmpty($field) || $field.trim().toLowerCase() === 'no') && (!(noOrUnknownAllowedCategories.includes(alcoholConsumptionCategory)))) {\r\n result = {valid:false, message: `If the donor is a '${alcoholConsumptionCategory}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}}},"alcohol_consumption_category":{"restrictions":{"codeList":{"left":["Daily Drinker","None","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"right":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"data":{"added":["Not applicable"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\r\n \r\n if (!$field || $field === null || checkforEmpty($field)) {\r\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\r\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\r\n }\r\n }\r\n else {\r\n alcoholConsumptionCategory = $field.trim().toLowerCase();\r\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\r\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}}},"alcohol_type":{"restrictions":{"codeList":{"left":["Beer","Liquor","Other","Unknown","Wine"],"right":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"data":{"added":["Not applicable"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n exclusionTerms = [\"no\", \"none\", \"unknown\"]; \r\n requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\r\n \r\n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\r\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\r\n if ($field && $field != null && !(checkforEmpty($field))) {\r\n if (exclusionTerms.includes(alcoholConsumptionCategory)) {\r\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field should not be submitted.`};\r\n }\r\n }\r\n else {\r\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\r\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\r\n }\r\n }\r\n }\r\n if ($field && $field != null && !(checkforEmpty($field)) && (!$row.alcohol_consumption_category || $row.alcohol_consumption_category === null || checkforEmpty($row.alcohol_consumption_category))) {\r\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}},"opiate_use":{"restrictions":{"codeList":{"left":["Never","Unknown","Yes, currently","Yes, only in the past"],"right":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"],"data":{"added":["Not applicable"],"deleted":[]}}}},"hot_drinks_consumption":{"restrictions":{"codeList":{"left":["Never","Unknown","Yes, currently","Yes, only in the past"],"right":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"],"data":{"added":["Not applicable"],"deleted":[]}}}},"red_meat_frequency":{"restrictions":{"codeList":{"left":["Never","Less than once a month","1-3 times a month","Once or twice a week","Most days but not every day","Every day","Unknown"],"right":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"],"data":{"added":["Not applicable"],"deleted":[]}}}},"processed_meat_frequency":{"restrictions":{"codeList":{"left":["Never","Less than once a month","1-3 times a month","Once or twice a week","Most days but not every day","Every day","Unknown"],"right":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"],"data":{"added":["Not applicable"],"deleted":[]}}}},"soft_drinks_frequency":{"restrictions":{"codeList":{"left":["Never","Less than once a month","1-3 times a month","Once or twice a week","Most days but not every day","Every day","Unknown"],"right":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"],"data":{"added":["Not applicable"],"deleted":[]}}}},"exercise_frequency":{"restrictions":{"codeList":{"left":["Never","Less than once a month","1-3 times a month","Once or twice a week","Most days but not every day","Every day","Unknown"],"right":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"],"data":{"added":["Not applicable"],"deleted":[]}}}},"exercise_intensity":{"restrictions":{"codeList":{"left":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Vigorous: Increase in the heart beat substantially with heavy perspiration"],"right":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"data":{"added":["Not applicable","Unknown"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($field != null || !(checkforEmpty($field))) {\r\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency)) && $row.exercise_frequency.trim().toLowerCase() === \"never\") {\r\n result = {valid: false, message: `The 'exercise_frequency' field cannot be 'never' if the '${$name}' field is submitted.`};\r\n }\r\n } \r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}}},"created":{},"deleted":{}},"family_history":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"family_relative_id":{"meta":{"primaryId":{"left":null,"right":true}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"relationship_type":{"restrictions":{"codeList":{"left":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Sister","Son","Unknown"],"right":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"],"data":{"added":["Maternal Uncle","Paternal Uncle","Uncle"],"deleted":[]}}}},"age_of_relative_at_diagnosis":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n if ($row.relative_with_cancer_history != null) {\r\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\r\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\r\n };\r\n }\r\n }\r\n else {\r\n if (currField || currField != null) {\r\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}},"cancer_type_code_of_relative":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n if ($row.relative_with_cancer_history != null) {\r\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\r\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\r\n };\r\n }\r\n }\r\n else {\r\n if (currField || currField != null) {\r\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}},"cause_of_death_of_relative":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n if ($row.relative_vital_status && $row.relative_vital_status != null) {\r\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\r\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\r\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\r\n }\r\n }\r\n else {\r\n if ($field || $field != null) {\r\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]}}},"relative_survival_time":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n if ($row.relative_with_cancer_history != null) {\r\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\r\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\r\n };\r\n }\r\n }\r\n else {\r\n if (currField || currField != null) {\r\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}}},"created":{},"deleted":{}},"comorbidity":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"laterality_of_prior_malignancy":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n const invalidTypes = [\"no\", \"unknown\"]\r\n \r\n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\r\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\r\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}},"age_at_comorbidity_diagnosis":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n const invalidTypes = [\"no\", \"unknown\"]\r\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\r\n \r\n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\r\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\r\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\r\n }\r\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\r\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\r\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\r\n }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]}}},"comorbidity_type_code":{"meta":{"notes":{"left":null,"right":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n const invalidTypes = [\"no\", \"unknown\"]\r\n /* check if ICD-10 code is for neoplasms */\r\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\r\n\r\n \r\n if (neoplasmCode($row.comorbidity_type_code)) { \r\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\r\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\r\n }\r\n }\r\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\r\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"]}}},"comorbidity_treatment_status":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n const invalidTypes = [\"no\", \"unknown\"]\r\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\r\n \r\n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\r\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\r\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\r\n }\r\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\r\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\r\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\r\n }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]}}},"comorbidity_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n const invalidTypes = [\"no\", \"unknown\"]\r\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\r\n \r\n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\r\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\r\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\r\n }\r\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\r\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\r\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\r\n }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]}}}},"created":{},"deleted":{}},"surgery":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"created","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"created","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"created","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"created","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"created","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"created","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"created","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"created","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"created","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"created","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"created","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"created","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"created","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"created","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}},"deleted":{}},"biomarker":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"created","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"created","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"created","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"created","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"created","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"created","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"created","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"created","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"created","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"created","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"created","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"created","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"created","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"created","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"created","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"created","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"created","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"created","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"created","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}},"deleted":{}}}} diff --git a/website/static/data/schemas/diffs/1.11/1.11-diff-1.24.json b/website/static/data/schemas/diffs/1.11/1.11-diff-1.24.json new file mode 100644 index 00000000..a16830e0 --- /dev/null +++ b/website/static/data/schemas/diffs/1.11/1.11-diff-1.24.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \r\n const designation = $row.tumour_normal_designation.trim().toLowerCase();\r\n const specimen_type = $field.trim().toLowerCase();\r\n \r\n if (designation === \"normal\") {\r\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\r\n if (!validTypes.includes(specimen_type)) {\r\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\r\n }\r\n }\r\n else if (designation === \"tumour\") {\r\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\r\n if (invalidTypes.includes(specimen_type)) {\r\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\r\n }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"]}}},"submitter_sample_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased","Unknown"],"right":["Alive","Deceased"],"data":{"added":[],"deleted":["Unknown"]}}}},"cause_of_death":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n \r\n if ($row.vital_status != null) {\r\n const vitalStatus = $row.vital_status.trim().toLowerCase();\r\n\r\n if (!currField && vitalStatus === \"deceased\") {\r\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\r\n }\r\n else if (currField && vitalStatus != \"deceased\"){\r\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\r\n }\r\n }\r\n else if (($row.vital_status === null) && (currField)) {\r\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]}}},"survival_time":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n \r\n if ($row.vital_status != null) {\r\n const vitalStatus = $row.vital_status.trim().toLowerCase();\r\n\r\n if (!currField && vitalStatus === \"deceased\") {\r\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\r\n }\r\n else if (currField && vitalStatus != \"deceased\"){\r\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\r\n }\r\n }\r\n else if (($row.vital_status === null) && (currField)) {\r\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]}}},"primary_site":{"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"data":{"added":["Unknown primary site"],"deleted":[]}}}},"genetic_disorders":{"description":{"left":"Indicate presence of any hereditary genetic disorders. (Reference: Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","right":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)"},"restrictions":{"codeList":{"left":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Serrated Polyposis Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"],"right":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"],"data":{"added":["None","Not applicable","Unknown"],"deleted":[]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age at which the first menstruation event occurred. (Reference: NCIt C19666)","right":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)"}},"hrt_type":{"restrictions":{"codeList":{"left":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Other","Patch","Pill","Unknown"],"right":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"],"data":{"added":["Not applicable"],"deleted":[]}}}},"hrt_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n const type = $name.trim().toLowerCase().split('_duration')[0];\r\n const hormoneType = type + `_type`;\r\n \r\n if ($field != null && !(checkforEmpty($field))) {\r\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\r\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\r\n }\r\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\") {\r\n const submittedValue = $row[hormoneType].toLowerCase()\r\n result = {valid: false, message: `If '${$name}' is submitted, then '${hormoneType}' field cannot be '${submittedValue}'.`};\r\n }\r\n\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"]}}},"contraception_type":{"restrictions":{"codeList":{"left":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Other","Progestin-only pill","Unknown","Vaginal ring"],"right":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"],"data":{"added":["Not applicable","Oral contraceptive pill"],"deleted":[]}}}},"contraception_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n const type = $name.trim().toLowerCase().split('_duration')[0];\r\n const hormoneType = type + `_type`;\r\n \r\n if ($field != null && !(checkforEmpty($field))) {\r\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\r\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\r\n }\r\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\") {\r\n const submittedValue = $row[hormoneType].toLowerCase()\r\n result = {valid: false, message: `If '${$name}' is submitted, then '${hormoneType}' field cannot be '${submittedValue}'.`};\r\n }\r\n\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"]}}}},"created":{"lost_to_followup_after_clinical_event_id":{"changeType":"created","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}},"deleted":{}},"specimen":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"pathological_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\r\n\r\n \r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\r\n if (!($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n /* This is not a required field, so first ensure that it exists */\r\n else if ($field) {\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"pathological_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"pathological_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"pathological_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Cannot be assessed"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_stage_group')[0];\r\n\r\n const stagingSystem = stagingName + `_tumour_staging_system`;\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\r\n result.valid = false;\r\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\r\n result.message = msg;\r\n }\r\n else if (!($row[stagingSystem]) && $field) {\r\n result.valid = false;\r\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\r\n result.message = msg;\r\n }\r\n else if ($row[stagingSystem] && $field) {\r\n let codeList = [];\r\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage ii bulky',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ies',\r\n 'stage iae',\r\n 'stage ias',\r\n 'stage iaes',\r\n 'stage ib',\r\n 'stage ibe',\r\n 'stage ibs',\r\n 'stage ibes',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iies',\r\n 'stage iiae',\r\n 'stage iias',\r\n 'stage iiaes',\r\n 'stage iib',\r\n 'stage iibe',\r\n 'stage iibs',\r\n 'stage iibes',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iiies',\r\n 'stage iiiae',\r\n 'stage iiias',\r\n 'stage iiiaes',\r\n 'stage iiib',\r\n 'stage iiibe',\r\n 'stage iiibs',\r\n 'stage iiibes',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ive',\r\n 'stage ivs',\r\n 'stage ives',\r\n 'stage ivae',\r\n 'stage ivas',\r\n 'stage ivaes',\r\n 'stage ivb',\r\n 'stage ivbe',\r\n 'stage ivbs',\r\n 'stage ivbes'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\r\n $row[stagingSystem]\r\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n \r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"specimen_acquisition_interval":{"restrictions":{"range":{"left":{"min":0},"right":null}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"specimen_storage":{"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"reference_pathology_confirmed":{"description":{"left":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist.","right":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)"}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.tumour_grading_system && $field) {\r\n let codeList = [];\r\n const tieredGradingList = ['gx','g1','g2','g3'];\r\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\r\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\r\n case 'two-tier grading system':\r\n codeList = [\r\n 'low grade',\r\n 'high grade',\r\n ];\r\n break;\r\n case 'three-tier grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'four-tier grading system':\r\n codeList = [\r\n 'gx',\r\n 'g1',\r\n 'g2',\r\n 'g3',\r\n 'g4',\r\n ];\r\n break;\r\n case 'grading system for gists':\r\n codeList = [\r\n 'low',\r\n 'high',\r\n ];\r\n break;\r\n case 'grading system for gnets':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'isup grading system':\r\n codeList = [\r\n 'gx',\r\n 'g1',\r\n 'g2',\r\n 'g3',\r\n 'g4',\r\n ];\r\n break;\r\n case 'who grading system for cns tumours':\r\n codeList = [\r\n 'grade i',\r\n 'grade ii',\r\n 'grade iii',\r\n 'grade iv',\r\n ];\r\n break;\r\n case 'fnclcc grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'gleason grade group system':\r\n codeList = [\r\n 'grade group 1',\r\n 'grade group 2',\r\n 'grade group 3',\r\n 'grade group 4',\r\n 'grade group 5',\r\n ];\r\n break;\r\n case 'scarff-bloom-richardson grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'nuclear grading system for dcis':\r\n codeList = tieredGradingList;\r\n break;\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase())) {\r\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\r\n $row.tumour_grading_system\r\n }', 'tumour_grade' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\r\n result.valid = false;\r\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"percent_tumour_cells":{"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"]}}},"percent_proliferating_cells":{"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}}},"percent_inflammatory_tissue":{"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}}},"percent_stromal_cells":{"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}}},"percent_necrosis":{"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}}}},"created":{"specimen_laterality":{"changeType":"created","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"percent_tumour_cells_measurement_method":{"changeType":"created","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}},"deleted":{}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"number_lymph_nodes_examined":{"meta":{"notes":{"left":null,"right":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'."}},"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n /* checks for a string just consisting of whitespacei */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\r\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\r\n \r\n if ($row.lymph_nodes_examined_status != null) {\r\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\r\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\r\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\r\n if (lymphNodesExaminedStatus === \"yes\") { \r\n if (parseInt($field) <= 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n else if (parseInt($field) > 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n \r\n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\r\n else if ($name === \"number_lymph_nodes_positive\") {\r\n if (lymphNodesExaminedStatus === \"yes\") {\r\n if (checkforEmpty($field) || $field == null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n else if (parseInt($field) < 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n else if ($field || $field != null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n }\r\n return result;\r\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"]}}},"number_lymph_nodes_positive":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n /* checks for a string just consisting of whitespacei */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\r\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\r\n \r\n if ($row.lymph_nodes_examined_status != null) {\r\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\r\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\r\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\r\n if (lymphNodesExaminedStatus === \"yes\") { \r\n if (parseInt($field) <= 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n else if (parseInt($field) > 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n \r\n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\r\n else if ($name === \"number_lymph_nodes_positive\") {\r\n if (lymphNodesExaminedStatus === \"yes\") {\r\n if (checkforEmpty($field) || $field == null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n else if (parseInt($field) < 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n else if ($field || $field != null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n }\r\n return result;\r\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"]}}},"clinical_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\r\n\r\n \r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\r\n if (!($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n /* This is not a required field, so first ensure that it exists */\r\n else if ($field) {\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"clinical_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"clinical_n_category":{"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"clinical_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"clinical_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Cannot be assessed"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_stage_group')[0];\r\n\r\n const stagingSystem = stagingName + `_tumour_staging_system`;\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\r\n result.valid = false;\r\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\r\n result.message = msg;\r\n }\r\n else if (!($row[stagingSystem]) && $field) {\r\n result.valid = false;\r\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\r\n result.message = msg;\r\n }\r\n else if ($row[stagingSystem] && $field) {\r\n let codeList = [];\r\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage ii bulky',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ies',\r\n 'stage iae',\r\n 'stage ias',\r\n 'stage iaes',\r\n 'stage ib',\r\n 'stage ibe',\r\n 'stage ibs',\r\n 'stage ibes',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iies',\r\n 'stage iiae',\r\n 'stage iias',\r\n 'stage iiaes',\r\n 'stage iib',\r\n 'stage iibe',\r\n 'stage iibs',\r\n 'stage iibes',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iiies',\r\n 'stage iiiae',\r\n 'stage iiias',\r\n 'stage iiiaes',\r\n 'stage iiib',\r\n 'stage iiibe',\r\n 'stage iiibs',\r\n 'stage iiibes',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ive',\r\n 'stage ivs',\r\n 'stage ives',\r\n 'stage ivae',\r\n 'stage ivas',\r\n 'stage ivaes',\r\n 'stage ivb',\r\n 'stage ivbe',\r\n 'stage ivbs',\r\n 'stage ivbes'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\r\n $row[stagingSystem]\r\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n \r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"performance_status":{"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}}},"created":{"laterality":{"changeType":"created","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_method":{"changeType":"created","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}},"deleted":{}},"treatment":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":["End of life care"],"deleted":[]}}}},"is_primary_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Yes","No","Unknown"],"right":["Yes","No"],"data":{"added":[],"deleted":["Unknown"]}}}},"line_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\r\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\r\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\r\n if (isPrimaryTreatment === 'yes') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\r\n }\r\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\r\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\r\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\r\n }\r\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\r\n else if (isPrimaryTreatment === 'unknown') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'unknown'.`};\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"]}}},"treatment_start_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":{"exclusiveMin":0},"right":null}}},"treatment_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"days_per_cycle":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"number_of_cycles":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_intent":{"description":{"left":"Indicate the intended disease outcome for which the treatment is given. (Reference: NCIt C124307)","right":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)"},"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Curative","Palliative","Unknown"],"right":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"],"data":{"added":["Diagnostic","Forensic","Guidance","Preventative","Screening","Supportive"],"deleted":["Unknown"]}}}},"treatment_setting":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Adjuvant","Advanced/Metastatic","Neoadjuvant","Not applicable"],"right":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"],"data":{"added":["Conditioning","Induction","Maintenance","Mobilization","Preventative","Radiosensitization","Salvage"],"deleted":["Not applicable"]}}}},"response_to_treatment":{"description":{"left":"The donor's response to the applied treatment regimen. (Source: RECIST)","right":"The donor's response to the applied treatment regimen."},"meta":{"dependsOn":{"left":"treatment.treatment_type","right":"treatment.response_to_treatment_criteria_method"},"notes":{"left":null,"right":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"]},"codeList":{"left":["Complete response","Disease progression","NED","Partial response","Stable disease"],"right":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"],"data":{"added":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease"],"deleted":["Disease progression","NED"]}}}},"outcome_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"toxicity_type":{"restrictions":{"codeList":{"left":["Hematological","Non-hematological"],"right":["Hematological","Non-hematological","Not applicable","Unknown"],"data":{"added":["Not applicable","Unknown"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($field != null && !(checkforEmpty($field))) {\r\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \r\n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\r\n \r\n /* toxicityType should only be submitted if treatment was terminated early due to acute toxicity ('outcome_of_treatment' is 'Treatment stopped due to acute toxicity'). */\r\n if (outcomeOfTreatment != \"treatment stopped due to acute toxicity\") {\r\n result = { valid: false, message: `The 'outcome_of_treatment' field should be 'Treatment stopped due to acute toxicity' if the '${$name}' field is submitted.`};\r\n }\r\n }\r\n else {\r\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"]}}},"hematological_toxicity":{"restrictions":{"codeList":{"left":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5"],"right":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"data":{"added":["Unknown"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($field != null && !(checkforEmpty($field))) {\r\n if (($row.toxicity_type != null && !(checkforEmpty($row.toxicity_type)))) { \r\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\r\n \r\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\r\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\r\n }\r\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\r\n }\r\n }\r\n else {\r\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}},"non-hematological_toxicity":{"restrictions":{"codeList":{"left":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"right":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"data":{"added":["Unknown"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($field != null && !(checkforEmpty($field))) {\r\n if (($row.toxicity_type != null && !(checkforEmpty($row.toxicity_type)))) { \r\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\r\n \r\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\r\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\r\n }\r\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\r\n }\r\n }\r\n else {\r\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}},"adverse_events":{"restrictions":{"codeList":{"left":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"right":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"data":{"added":["None","Unknown"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"clinical_trials_database":{"meta":{"notes":{"left":null,"right":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added."}},"restrictions":{"codeList":{"left":["NCI Clinical Trials","EU Clinical Trials Register"],"right":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"],"data":{"added":["Not applicable","Unknown"],"deleted":[]}}}},"clinical_trial_number":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n //regex check for clinical trial number\r\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\r\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\r\n\r\n // list of valid clinical trial databases\r\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\r\n \r\n if ($row.clinical_trials_database && $field) {\r\n const trialNumber = $field.trim();\r\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\r\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\r\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\r\n }\r\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\r\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\r\n }\r\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\r\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database.`};\r\n }\r\n }\r\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\r\n result = {valid: true, message: \"Ok\"};\r\n }\r\n else if ($row.clinical_trials_database && !$field) {\r\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\r\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\r\n } \r\n }\r\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\r\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"]}}}},"created":{"response_to_treatment_criteria_method":{"changeType":"created","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}}},"deleted":{}},"chemotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"created","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"created","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"created","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"created","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}},"deleted":{"chemotherapy_dosage_units":{"changeType":"deleted","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate the total actual drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true,"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"created","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{"hormone_drug_dosage_units":{"changeType":"deleted","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true,"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"radiation":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"radiation_therapy_dosage":{"valueType":{"left":"integer","right":"number"}},"anatomical_site_irradiated":{"description":{"left":"Indicate localization site where radiation therapy was administered.","right":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)"},"restrictions":{"codeList":{"left":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"right":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"data":{"added":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"],"deleted":["Bone","Extremities","Head-Neck","Peritoneum"]}}}}},"created":{"radiation_boost":{"changeType":"created","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"created","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}},"deleted":{}},"immunotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"immunotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"displayName":{"left":"Immunotherapy Drug Name","right":"Chemotherapy Drug Name"},"dependsOn":{"left":null,"right":"immunotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"created","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{}},"follow_up":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_follow_up_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"interval_of_followup":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"treatment.submitter_treatment_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"relapse_type":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n if ($row.disease_status_at_followup != null) {\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"relapse_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n if ($row.disease_status_at_followup != null) {\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const intervalOfFollowup = parseInt($row.interval_of_followup);\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n relapseInterval = parseInt($field);\r\n if (relapseInterval > intervalOfFollowup) {\r\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\r\n }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"]},"range":{"left":{"exclusiveMin":0},"right":null}}},"method_of_progression_status":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n if ($row.disease_status_at_followup != null) {\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"anatomic_site_progression_or_recurrence":{"description":{"left":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","right":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344."},"meta":{"examples":{"left":"C50.1,C18","right":"C50.1|C18"},"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}},"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n if ($row.disease_status_at_followup != null) {\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\r\n\r\n \r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\r\n if (!($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n /* This is not a required field, so first ensure that it exists */\r\n else if ($field) {\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })","(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n if ($row.disease_status_at_followup != null) {\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_t_category":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"recurrence_n_category":{"meta":{"core":{"left":true,"right":null}}},"recurrence_m_category":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"recurrence_stage_group":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Cannot be assessed"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_stage_group')[0];\r\n\r\n const stagingSystem = stagingName + `_tumour_staging_system`;\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\r\n result.valid = false;\r\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\r\n result.message = msg;\r\n }\r\n else if (!($row[stagingSystem]) && $field) {\r\n result.valid = false;\r\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\r\n result.message = msg;\r\n }\r\n else if ($row[stagingSystem] && $field) {\r\n let codeList = [];\r\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage ii bulky',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ies',\r\n 'stage iae',\r\n 'stage ias',\r\n 'stage iaes',\r\n 'stage ib',\r\n 'stage ibe',\r\n 'stage ibs',\r\n 'stage ibes',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iies',\r\n 'stage iiae',\r\n 'stage iias',\r\n 'stage iiaes',\r\n 'stage iib',\r\n 'stage iibe',\r\n 'stage iibs',\r\n 'stage iibes',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iiies',\r\n 'stage iiiae',\r\n 'stage iiias',\r\n 'stage iiiaes',\r\n 'stage iiib',\r\n 'stage iiibe',\r\n 'stage iiibs',\r\n 'stage iiibes',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ive',\r\n 'stage ivs',\r\n 'stage ives',\r\n 'stage ivae',\r\n 'stage ivas',\r\n 'stage ivaes',\r\n 'stage ivb',\r\n 'stage ivbe',\r\n 'stage ivbs',\r\n 'stage ivbes'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\r\n $row[stagingSystem]\r\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n \r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"posttherapy_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\r\n\r\n \r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\r\n if (!($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n /* This is not a required field, so first ensure that it exists */\r\n else if ($field) {\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"posttherapy_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"posttherapy_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"posttherapy_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Cannot be assessed"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_stage_group')[0];\r\n\r\n const stagingSystem = stagingName + `_tumour_staging_system`;\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\r\n result.valid = false;\r\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\r\n result.message = msg;\r\n }\r\n else if (!($row[stagingSystem]) && $field) {\r\n result.valid = false;\r\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\r\n result.message = msg;\r\n }\r\n else if ($row[stagingSystem] && $field) {\r\n let codeList = [];\r\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage ii bulky',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ies',\r\n 'stage iae',\r\n 'stage ias',\r\n 'stage iaes',\r\n 'stage ib',\r\n 'stage ibe',\r\n 'stage ibs',\r\n 'stage ibes',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iies',\r\n 'stage iiae',\r\n 'stage iias',\r\n 'stage iiaes',\r\n 'stage iib',\r\n 'stage iibe',\r\n 'stage iibs',\r\n 'stage iibes',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iiies',\r\n 'stage iiiae',\r\n 'stage iiias',\r\n 'stage iiiaes',\r\n 'stage iiib',\r\n 'stage iiibe',\r\n 'stage iiibs',\r\n 'stage iiibes',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ive',\r\n 'stage ivs',\r\n 'stage ives',\r\n 'stage ivae',\r\n 'stage ivas',\r\n 'stage ivaes',\r\n 'stage ivb',\r\n 'stage ivbe',\r\n 'stage ivbs',\r\n 'stage ivbes'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\r\n $row[stagingSystem]\r\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n \r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}}},"created":{},"deleted":{}},"exposure":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"tobacco_smoking_status":{"restrictions":{"codeList":{"left":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Smoking history not documented"],"right":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"],"data":{"added":["Not applicable"],"deleted":[]}}}},"tobacco_type":{"restrictions":{"codeList":{"left":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Roll-ups","Snuff","Unknown","Waterpipe"],"right":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"data":{"added":["Not applicable","Pipe"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n // check tobacco related fields\r\n if ($name === 'tobacco_type') {\r\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\r\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\r\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\r\n }\r\n else if ($row.tobacco_smoking_status.toLowerCase() === 'smoking history not documented') {\r\n result = { valid: false, message: `The 'tobacco_smoking_status' field (smoking status not documented) is inconsistent if donor smoked '${$row.tobacco_type}'.`};\r\n }\r\n else if ($row.tobacco_smoking_status.toLowerCase() === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if donor is a lifelong non-smoker.`}\r\n }\r\n }\r\n else {\r\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\r\n if (smokerCategories.includes($row.tobacco_smoking_status.toLowerCase())) {\r\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\r\n }\r\n }\r\n }\r\n }\r\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\r\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\r\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}}},"pack_years_smoked":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n // check tobacco related fields\r\n if ($name === 'tobacco_type') {\r\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\r\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\r\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\r\n }\r\n else if ($row.tobacco_smoking_status.toLowerCase() === 'smoking history not documented') {\r\n result = { valid: false, message: `The 'tobacco_smoking_status' field (smoking status not documented) is inconsistent if donor smoked '${$row.tobacco_type}'.`};\r\n }\r\n else if ($row.tobacco_smoking_status.toLowerCase() === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if donor is a lifelong non-smoker.`}\r\n }\r\n }\r\n else {\r\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\r\n if (smokerCategories.includes($row.tobacco_smoking_status.toLowerCase())) {\r\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\r\n }\r\n }\r\n }\r\n }\r\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\r\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\r\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}}},"alcohol_history":{"restrictions":{"codeList":{"left":["Yes","No","Unknown"],"right":["Yes","No","Not applicable","Unknown"],"data":{"added":["Not applicable"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\r\n noOrUnknownAllowedCategories = [\"none\", \"occasional drinker (< once a month)\", \"unknown\"];\r\n \r\n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\r\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\r\n if ((!$field || $field == null || checkforEmpty($field)) && alcoholHistoryCategories.includes(alcoholConsumptionCategory)) {\r\n result = {valid:false, message: `If the donor is a '${alcoholConsumptionCategory}', then the 'alcohol_history' field must be submitted as well.`};\r\n }\r\n if ((!$field || $field === null || checkforEmpty($field) || $field.trim().toLowerCase() === 'no') && (!(noOrUnknownAllowedCategories.includes(alcoholConsumptionCategory)))) {\r\n result = {valid:false, message: `If the donor is a '${alcoholConsumptionCategory}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}}},"alcohol_consumption_category":{"restrictions":{"codeList":{"left":["Daily Drinker","None","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"right":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"data":{"added":["Not applicable"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\r\n \r\n if (!$field || $field === null || checkforEmpty($field)) {\r\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\r\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\r\n }\r\n }\r\n else {\r\n alcoholConsumptionCategory = $field.trim().toLowerCase();\r\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\r\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}}},"alcohol_type":{"restrictions":{"codeList":{"left":["Beer","Liquor","Other","Unknown","Wine"],"right":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"data":{"added":["Not applicable"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n exclusionTerms = [\"no\", \"none\", \"unknown\"]; \r\n requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\r\n \r\n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\r\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\r\n if ($field && $field != null && !(checkforEmpty($field))) {\r\n if (exclusionTerms.includes(alcoholConsumptionCategory)) {\r\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field should not be submitted.`};\r\n }\r\n }\r\n else {\r\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\r\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\r\n }\r\n }\r\n }\r\n if ($field && $field != null && !(checkforEmpty($field)) && (!$row.alcohol_consumption_category || $row.alcohol_consumption_category === null || checkforEmpty($row.alcohol_consumption_category))) {\r\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}},"opiate_use":{"restrictions":{"codeList":{"left":["Never","Unknown","Yes, currently","Yes, only in the past"],"right":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"],"data":{"added":["Not applicable"],"deleted":[]}}}},"hot_drinks_consumption":{"restrictions":{"codeList":{"left":["Never","Unknown","Yes, currently","Yes, only in the past"],"right":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"],"data":{"added":["Not applicable"],"deleted":[]}}}},"red_meat_frequency":{"restrictions":{"codeList":{"left":["Never","Less than once a month","1-3 times a month","Once or twice a week","Most days but not every day","Every day","Unknown"],"right":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"],"data":{"added":["Not applicable"],"deleted":[]}}}},"processed_meat_frequency":{"restrictions":{"codeList":{"left":["Never","Less than once a month","1-3 times a month","Once or twice a week","Most days but not every day","Every day","Unknown"],"right":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"],"data":{"added":["Not applicable"],"deleted":[]}}}},"soft_drinks_frequency":{"restrictions":{"codeList":{"left":["Never","Less than once a month","1-3 times a month","Once or twice a week","Most days but not every day","Every day","Unknown"],"right":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"],"data":{"added":["Not applicable"],"deleted":[]}}}},"exercise_frequency":{"restrictions":{"codeList":{"left":["Never","Less than once a month","1-3 times a month","Once or twice a week","Most days but not every day","Every day","Unknown"],"right":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"],"data":{"added":["Not applicable"],"deleted":[]}}}},"exercise_intensity":{"restrictions":{"codeList":{"left":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Vigorous: Increase in the heart beat substantially with heavy perspiration"],"right":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"data":{"added":["Not applicable","Unknown"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($field != null || !(checkforEmpty($field))) {\r\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency)) && $row.exercise_frequency.trim().toLowerCase() === \"never\") {\r\n result = {valid: false, message: `The 'exercise_frequency' field cannot be 'never' if the '${$name}' field is submitted.`};\r\n }\r\n } \r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}}},"created":{},"deleted":{}},"family_history":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"family_relative_id":{"meta":{"primaryId":{"left":null,"right":true}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"age_of_relative_at_diagnosis":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n if ($row.relative_with_cancer_history != null) {\r\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\r\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\r\n };\r\n }\r\n }\r\n else {\r\n if (currField || currField != null) {\r\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}},"cancer_type_code_of_relative":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n if ($row.relative_with_cancer_history != null) {\r\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\r\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\r\n };\r\n }\r\n }\r\n else {\r\n if (currField || currField != null) {\r\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}},"cause_of_death_of_relative":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n if ($row.relative_vital_status && $row.relative_vital_status != null) {\r\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\r\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\r\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\r\n }\r\n }\r\n else {\r\n if ($field || $field != null) {\r\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]}}},"relative_survival_time":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n if ($row.relative_with_cancer_history != null) {\r\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\r\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\r\n };\r\n }\r\n }\r\n else {\r\n if (currField || currField != null) {\r\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}}},"created":{},"deleted":{}},"biomarker":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"meta":{"notes":{"left":null,"right":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n let missing = true;\r\n\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\r\n \r\n if (!$field || checkforEmpty($field) || $field === null) { \r\n for (let idField of identifierFields) {\r\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\r\n continue;\r\n }\r\n else {\r\n missing = false;\r\n }\r\n }\r\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\r\n result = {\r\n valid: false,\r\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\r\n }\r\n }\r\n else if ($field && !(checkforEmpty($field)) && $field != null) {\r\n for (let idField of identifierFields) {\r\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\r\n result = {\r\n valid: false,\r\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\r\n break;\r\n }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"},"notes":{"left":null,"right":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n let missing = true;\r\n\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\r\n \r\n if (!$field || checkforEmpty($field) || $field === null) { \r\n for (let idField of identifierFields) {\r\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\r\n continue;\r\n }\r\n else {\r\n missing = false;\r\n }\r\n }\r\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\r\n result = {\r\n valid: false,\r\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\r\n }\r\n }\r\n else if ($field && !(checkforEmpty($field)) && $field != null) {\r\n for (let idField of identifierFields) {\r\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\r\n result = {\r\n valid: false,\r\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\r\n break;\r\n }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"treatment.submitter_treatment_id"},"notes":{"left":null,"right":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n let missing = true;\r\n\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\r\n \r\n if (!$field || checkforEmpty($field) || $field === null) { \r\n for (let idField of identifierFields) {\r\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\r\n continue;\r\n }\r\n else {\r\n missing = false;\r\n }\r\n }\r\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\r\n result = {\r\n valid: false,\r\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\r\n }\r\n }\r\n else if ($field && !(checkforEmpty($field)) && $field != null) {\r\n for (let idField of identifierFields) {\r\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\r\n result = {\r\n valid: false,\r\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\r\n break;\r\n }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}}},"submitter_follow_up_id":{"meta":{"foreignKey":{"left":null,"right":"follow_up.submitter_follow_up_id"},"notes":{"left":null,"right":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n let missing = true;\r\n\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\r\n \r\n if (!$field || checkforEmpty($field) || $field === null) { \r\n for (let idField of identifierFields) {\r\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\r\n continue;\r\n }\r\n else {\r\n missing = false;\r\n }\r\n }\r\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\r\n result = {\r\n valid: false,\r\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\r\n }\r\n }\r\n else if ($field && !(checkforEmpty($field)) && $field != null) {\r\n for (let idField of identifierFields) {\r\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\r\n result = {\r\n valid: false,\r\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\r\n break;\r\n }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}}},"test_interval":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n let missing = true;\r\n\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\r\n \r\n if (!$field || checkforEmpty($field) || $field === null) { \r\n for (let idField of identifierFields) {\r\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\r\n continue;\r\n }\r\n else {\r\n missing = false;\r\n }\r\n }\r\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\r\n result = {\r\n valid: false,\r\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\r\n }\r\n }\r\n else if ($field && !(checkforEmpty($field)) && $field != null) {\r\n for (let idField of identifierFields) {\r\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\r\n result = {\r\n valid: false,\r\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\r\n break;\r\n }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}}}},"created":{"ldh_level":{"changeType":"created","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}}},"deleted":{"ldl_level":{"changeType":"deleted","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldl_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}}}},"comorbidity":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"laterality_of_prior_malignancy":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n const invalidTypes = [\"no\", \"unknown\"]\r\n \r\n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\r\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\r\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}},"age_at_comorbidity_diagnosis":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n const invalidTypes = [\"no\", \"unknown\"]\r\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\r\n \r\n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\r\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\r\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\r\n }\r\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\r\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\r\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\r\n }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]}}},"comorbidity_type_code":{"meta":{"notes":{"left":null,"right":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n const invalidTypes = [\"no\", \"unknown\"]\r\n /* check if ICD-10 code is for neoplasms */\r\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\r\n\r\n \r\n if (neoplasmCode($row.comorbidity_type_code)) { \r\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\r\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\r\n }\r\n }\r\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\r\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"]}}},"comorbidity_treatment_status":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n const invalidTypes = [\"no\", \"unknown\"]\r\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\r\n \r\n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\r\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\r\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\r\n }\r\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\r\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\r\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\r\n }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]}}},"comorbidity_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n const invalidTypes = [\"no\", \"unknown\"]\r\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\r\n \r\n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\r\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\r\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\r\n }\r\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\r\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\r\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\r\n }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]}}}},"created":{},"deleted":{}},"surgery":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"created","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"created","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"created","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"created","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"created","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"created","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"created","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"created","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"created","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"created","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"created","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"created","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"created","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"created","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}},"deleted":{}}}} diff --git a/website/static/data/schemas/diffs/1.12/1.12-diff-1.24.json b/website/static/data/schemas/diffs/1.12/1.12-diff-1.24.json new file mode 100644 index 00000000..1afeefb4 --- /dev/null +++ b/website/static/data/schemas/diffs/1.12/1.12-diff-1.24.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \r\n const designation = $row.tumour_normal_designation.trim().toLowerCase();\r\n const specimen_type = $field.trim().toLowerCase();\r\n \r\n if (designation === \"normal\") {\r\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\r\n if (!validTypes.includes(specimen_type)) {\r\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\r\n }\r\n }\r\n else if (designation === \"tumour\") {\r\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\r\n if (invalidTypes.includes(specimen_type)) {\r\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\r\n }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"]}}},"submitter_sample_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased","Unknown"],"right":["Alive","Deceased"],"data":{"added":[],"deleted":["Unknown"]}}}},"cause_of_death":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n \r\n if ($row.vital_status != null) {\r\n const vitalStatus = $row.vital_status.trim().toLowerCase();\r\n\r\n if (!currField && vitalStatus === \"deceased\") {\r\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\r\n }\r\n else if (currField && vitalStatus != \"deceased\"){\r\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\r\n }\r\n }\r\n else if (($row.vital_status === null) && (currField)) {\r\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]}}},"survival_time":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n \r\n if ($row.vital_status != null) {\r\n const vitalStatus = $row.vital_status.trim().toLowerCase();\r\n\r\n if (!currField && vitalStatus === \"deceased\") {\r\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\r\n }\r\n else if (currField && vitalStatus != \"deceased\"){\r\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\r\n }\r\n }\r\n else if (($row.vital_status === null) && (currField)) {\r\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]}}},"primary_site":{"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"data":{"added":["Unknown primary site"],"deleted":[]}}}},"genetic_disorders":{"description":{"left":"Indicate presence of any hereditary genetic disorders. (Reference: Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","right":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)"},"restrictions":{"codeList":{"left":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Serrated Polyposis Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"],"right":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"],"data":{"added":["None","Not applicable","Unknown"],"deleted":[]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age at which the first menstruation event occurred. (Reference: NCIt C19666)","right":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)"}},"hrt_type":{"restrictions":{"codeList":{"left":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Other","Patch","Pill","Unknown"],"right":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"],"data":{"added":["Not applicable"],"deleted":[]}}}},"hrt_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n const type = $name.trim().toLowerCase().split('_duration')[0];\r\n const hormoneType = type + `_type`;\r\n \r\n if ($field != null && !(checkforEmpty($field))) {\r\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\r\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\r\n }\r\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\") {\r\n const submittedValue = $row[hormoneType].toLowerCase()\r\n result = {valid: false, message: `If '${$name}' is submitted, then '${hormoneType}' field cannot be '${submittedValue}'.`};\r\n }\r\n\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"]}}},"contraception_type":{"restrictions":{"codeList":{"left":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Other","Progestin-only pill","Unknown","Vaginal ring"],"right":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"],"data":{"added":["Not applicable","Oral contraceptive pill"],"deleted":[]}}}},"contraception_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n const type = $name.trim().toLowerCase().split('_duration')[0];\r\n const hormoneType = type + `_type`;\r\n \r\n if ($field != null && !(checkforEmpty($field))) {\r\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\r\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\r\n }\r\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\") {\r\n const submittedValue = $row[hormoneType].toLowerCase()\r\n result = {valid: false, message: `If '${$name}' is submitted, then '${hormoneType}' field cannot be '${submittedValue}'.`};\r\n }\r\n\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"]}}}},"created":{"lost_to_followup_after_clinical_event_id":{"changeType":"created","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}},"deleted":{}},"specimen":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"pathological_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\r\n\r\n \r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\r\n if (!($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n /* This is not a required field, so first ensure that it exists */\r\n else if ($field) {\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"pathological_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"pathological_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"pathological_stage_group":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_stage_group')[0];\r\n\r\n const stagingSystem = stagingName + `_tumour_staging_system`;\r\n const tCategory = `${stagingName}_t_category`;\r\n const nCategory = `${stagingName}_n_category`;\r\n const mCategory = `${stagingName}_m_category`;\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\r\n result.valid = false;\r\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\r\n result.message = msg;\r\n }\r\n else if (!($row[stagingSystem]) && $field) {\r\n result.valid = false;\r\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\r\n result.message = msg;\r\n }\r\n else if ($row[stagingSystem] && $field) {\r\n let codeList = [];\r\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage ii bulky',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ies',\r\n 'stage iae',\r\n 'stage ias',\r\n 'stage iaes',\r\n 'stage ib',\r\n 'stage ibe',\r\n 'stage ibs',\r\n 'stage ibes',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iies',\r\n 'stage iiae',\r\n 'stage iias',\r\n 'stage iiaes',\r\n 'stage iib',\r\n 'stage iibe',\r\n 'stage iibs',\r\n 'stage iibes',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iiies',\r\n 'stage iiiae',\r\n 'stage iiias',\r\n 'stage iiiaes',\r\n 'stage iiib',\r\n 'stage iiibe',\r\n 'stage iiibs',\r\n 'stage iiibes',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ive',\r\n 'stage ivs',\r\n 'stage ives',\r\n 'stage ivae',\r\n 'stage ivas',\r\n 'stage ivaes',\r\n 'stage ivb',\r\n 'stage ivbe',\r\n 'stage ivbs',\r\n 'stage ivbes'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\r\n $row[stagingSystem]\r\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\r\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\r\n result = {\r\n valid: false,\r\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\r\n };\r\n }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"specimen_acquisition_interval":{"restrictions":{"range":{"left":{"min":0},"right":null}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"specimen_storage":{"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"reference_pathology_confirmed":{"description":{"left":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist.","right":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)"}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.tumour_grading_system && $field) {\r\n let codeList = [];\r\n const tieredGradingList = ['gx','g1','g2','g3'];\r\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\r\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\r\n case 'two-tier grading system':\r\n codeList = [\r\n 'low grade',\r\n 'high grade',\r\n ];\r\n break;\r\n case 'three-tier grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'four-tier grading system':\r\n codeList = [\r\n 'gx',\r\n 'g1',\r\n 'g2',\r\n 'g3',\r\n 'g4',\r\n ];\r\n break;\r\n case 'grading system for gists':\r\n codeList = [\r\n 'low',\r\n 'high',\r\n ];\r\n break;\r\n case 'grading system for gnets':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'isup grading system':\r\n codeList = [\r\n 'gx',\r\n 'g1',\r\n 'g2',\r\n 'g3',\r\n 'g4',\r\n ];\r\n break;\r\n case 'who grading system for cns tumours':\r\n codeList = [\r\n 'grade i',\r\n 'grade ii',\r\n 'grade iii',\r\n 'grade iv',\r\n ];\r\n break;\r\n case 'fnclcc grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'gleason grade group system':\r\n codeList = [\r\n 'grade group 1',\r\n 'grade group 2',\r\n 'grade group 3',\r\n 'grade group 4',\r\n 'grade group 5',\r\n ];\r\n break;\r\n case 'scarff-bloom-richardson grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'nuclear grading system for dcis':\r\n codeList = tieredGradingList;\r\n break;\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase())) {\r\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\r\n $row.tumour_grading_system\r\n }', 'tumour_grade' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\r\n result.valid = false;\r\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"percent_tumour_cells":{"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"]}}},"percent_proliferating_cells":{"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}}},"percent_inflammatory_tissue":{"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}}},"percent_stromal_cells":{"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}}},"percent_necrosis":{"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}}}},"created":{"specimen_laterality":{"changeType":"created","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"percent_tumour_cells_measurement_method":{"changeType":"created","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}},"deleted":{}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"number_lymph_nodes_examined":{"meta":{"notes":{"left":null,"right":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'."}},"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n /* checks for a string just consisting of whitespacei */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\r\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\r\n \r\n if ($row.lymph_nodes_examined_status != null) {\r\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\r\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\r\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\r\n if (lymphNodesExaminedStatus === \"yes\") { \r\n if (parseInt($field) <= 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n else if (parseInt($field) > 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n \r\n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\r\n else if ($name === \"number_lymph_nodes_positive\") {\r\n if (lymphNodesExaminedStatus === \"yes\") {\r\n if (checkforEmpty($field) || $field == null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n else if (parseInt($field) < 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n else if ($field || $field != null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n }\r\n return result;\r\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"]}}},"number_lymph_nodes_positive":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n /* checks for a string just consisting of whitespacei */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\r\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\r\n \r\n if ($row.lymph_nodes_examined_status != null) {\r\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\r\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\r\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\r\n if (lymphNodesExaminedStatus === \"yes\") { \r\n if (parseInt($field) <= 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n else if (parseInt($field) > 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n \r\n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\r\n else if ($name === \"number_lymph_nodes_positive\") {\r\n if (lymphNodesExaminedStatus === \"yes\") {\r\n if (checkforEmpty($field) || $field == null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n else if (parseInt($field) < 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n else if ($field || $field != null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n }\r\n return result;\r\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"]}}},"clinical_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\r\n\r\n \r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\r\n if (!($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n /* This is not a required field, so first ensure that it exists */\r\n else if ($field) {\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"clinical_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"clinical_n_category":{"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"clinical_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"clinical_stage_group":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_stage_group')[0];\r\n\r\n const stagingSystem = stagingName + `_tumour_staging_system`;\r\n const tCategory = `${stagingName}_t_category`;\r\n const nCategory = `${stagingName}_n_category`;\r\n const mCategory = `${stagingName}_m_category`;\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\r\n result.valid = false;\r\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\r\n result.message = msg;\r\n }\r\n else if (!($row[stagingSystem]) && $field) {\r\n result.valid = false;\r\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\r\n result.message = msg;\r\n }\r\n else if ($row[stagingSystem] && $field) {\r\n let codeList = [];\r\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage ii bulky',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ies',\r\n 'stage iae',\r\n 'stage ias',\r\n 'stage iaes',\r\n 'stage ib',\r\n 'stage ibe',\r\n 'stage ibs',\r\n 'stage ibes',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iies',\r\n 'stage iiae',\r\n 'stage iias',\r\n 'stage iiaes',\r\n 'stage iib',\r\n 'stage iibe',\r\n 'stage iibs',\r\n 'stage iibes',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iiies',\r\n 'stage iiiae',\r\n 'stage iiias',\r\n 'stage iiiaes',\r\n 'stage iiib',\r\n 'stage iiibe',\r\n 'stage iiibs',\r\n 'stage iiibes',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ive',\r\n 'stage ivs',\r\n 'stage ives',\r\n 'stage ivae',\r\n 'stage ivas',\r\n 'stage ivaes',\r\n 'stage ivb',\r\n 'stage ivbe',\r\n 'stage ivbs',\r\n 'stage ivbes'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\r\n $row[stagingSystem]\r\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\r\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\r\n result = {\r\n valid: false,\r\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\r\n };\r\n }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"performance_status":{"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}}},"created":{"laterality":{"changeType":"created","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_method":{"changeType":"created","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}},"deleted":{}},"treatment":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":["End of life care"],"deleted":[]}}}},"is_primary_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Yes","No","Unknown"],"right":["Yes","No"],"data":{"added":[],"deleted":["Unknown"]}}}},"line_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\r\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\r\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\r\n if (isPrimaryTreatment === 'yes') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\r\n }\r\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\r\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\r\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\r\n }\r\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\r\n else if (isPrimaryTreatment === 'unknown') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'unknown'.`};\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"]}}},"treatment_start_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":{"exclusiveMin":0},"right":null}}},"treatment_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"days_per_cycle":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"number_of_cycles":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_intent":{"description":{"left":"Indicate the intended disease outcome for which the treatment is given. (Reference: NCIt C124307)","right":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)"},"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Curative","Palliative","Unknown"],"right":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"],"data":{"added":["Diagnostic","Forensic","Guidance","Preventative","Screening","Supportive"],"deleted":["Unknown"]}}}},"treatment_setting":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Adjuvant","Advanced/Metastatic","Neoadjuvant","Not applicable"],"right":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"],"data":{"added":["Conditioning","Induction","Maintenance","Mobilization","Preventative","Radiosensitization","Salvage"],"deleted":["Not applicable"]}}}},"response_to_treatment":{"description":{"left":"The donor's response to the applied treatment regimen. (Source: RECIST)","right":"The donor's response to the applied treatment regimen."},"meta":{"dependsOn":{"left":"treatment.treatment_type","right":"treatment.response_to_treatment_criteria_method"},"notes":{"left":null,"right":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"]},"codeList":{"left":["Complete response","Disease progression","NED","Partial response","Stable disease"],"right":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"],"data":{"added":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease"],"deleted":["Disease progression","NED"]}}}},"outcome_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"toxicity_type":{"restrictions":{"codeList":{"left":["Hematological","Non-hematological"],"right":["Hematological","Non-hematological","Not applicable","Unknown"],"data":{"added":["Not applicable","Unknown"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($field != null && !(checkforEmpty($field))) {\r\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \r\n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\r\n \r\n /* toxicityType should only be submitted if treatment was terminated early due to acute toxicity ('outcome_of_treatment' is 'Treatment stopped due to acute toxicity'). */\r\n if (outcomeOfTreatment != \"treatment stopped due to acute toxicity\") {\r\n result = { valid: false, message: `The 'outcome_of_treatment' field should be 'Treatment stopped due to acute toxicity' if the '${$name}' field is submitted.`};\r\n }\r\n }\r\n else {\r\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"]}}},"hematological_toxicity":{"restrictions":{"codeList":{"left":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5"],"right":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"data":{"added":["Unknown"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($field != null && !(checkforEmpty($field))) {\r\n if (($row.toxicity_type != null && !(checkforEmpty($row.toxicity_type)))) { \r\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\r\n \r\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\r\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\r\n }\r\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\r\n }\r\n }\r\n else {\r\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}},"non-hematological_toxicity":{"restrictions":{"codeList":{"left":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"right":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"data":{"added":["Unknown"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($field != null && !(checkforEmpty($field))) {\r\n if (($row.toxicity_type != null && !(checkforEmpty($row.toxicity_type)))) { \r\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\r\n \r\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\r\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\r\n }\r\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\r\n }\r\n }\r\n else {\r\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}},"adverse_events":{"restrictions":{"codeList":{"left":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"right":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"data":{"added":["None","Unknown"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"clinical_trials_database":{"meta":{"notes":{"left":null,"right":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added."}},"restrictions":{"codeList":{"left":["NCI Clinical Trials","EU Clinical Trials Register"],"right":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"],"data":{"added":["Not applicable","Unknown"],"deleted":[]}}}},"clinical_trial_number":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n //regex check for clinical trial number\r\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\r\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\r\n\r\n // list of valid clinical trial databases\r\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\r\n \r\n if ($row.clinical_trials_database && $field) {\r\n const trialNumber = $field.trim();\r\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\r\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\r\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\r\n }\r\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\r\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\r\n }\r\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\r\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database.`};\r\n }\r\n }\r\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\r\n result = {valid: true, message: \"Ok\"};\r\n }\r\n else if ($row.clinical_trials_database && !$field) {\r\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\r\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\r\n } \r\n }\r\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\r\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"]}}}},"created":{"response_to_treatment_criteria_method":{"changeType":"created","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}}},"deleted":{}},"chemotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"created","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"created","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"created","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"created","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}},"deleted":{"chemotherapy_dosage_units":{"changeType":"deleted","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate the total actual drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true,"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"created","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{"hormone_drug_dosage_units":{"changeType":"deleted","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true,"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"radiation":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"radiation_therapy_dosage":{"valueType":{"left":"integer","right":"number"}},"anatomical_site_irradiated":{"description":{"left":"Indicate localization site where radiation therapy was administered.","right":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)"},"restrictions":{"codeList":{"left":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"right":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"data":{"added":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"],"deleted":["Bone","Extremities","Head-Neck","Peritoneum"]}}}}},"created":{"radiation_boost":{"changeType":"created","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"created","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}},"deleted":{}},"immunotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"immunotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"displayName":{"left":"Immunotherapy Drug Name","right":"Chemotherapy Drug Name"},"dependsOn":{"left":null,"right":"immunotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"created","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{}},"follow_up":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_follow_up_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"interval_of_followup":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"treatment.submitter_treatment_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"relapse_type":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n if ($row.disease_status_at_followup != null) {\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"relapse_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n if ($row.disease_status_at_followup != null) {\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const intervalOfFollowup = parseInt($row.interval_of_followup);\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n relapseInterval = parseInt($field);\r\n if (relapseInterval > intervalOfFollowup) {\r\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\r\n }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"]},"range":{"left":{"exclusiveMin":0},"right":null}}},"method_of_progression_status":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n if ($row.disease_status_at_followup != null) {\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"anatomic_site_progression_or_recurrence":{"description":{"left":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","right":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344."},"meta":{"examples":{"left":"C50.1,C18","right":"C50.1|C18"},"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}},"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n if ($row.disease_status_at_followup != null) {\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\r\n\r\n \r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\r\n if (!($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n /* This is not a required field, so first ensure that it exists */\r\n else if ($field) {\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })","(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n if ($row.disease_status_at_followup != null) {\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_t_category":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"recurrence_n_category":{"meta":{"core":{"left":true,"right":null}}},"recurrence_m_category":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"recurrence_stage_group":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_stage_group')[0];\r\n\r\n const stagingSystem = stagingName + `_tumour_staging_system`;\r\n const tCategory = `${stagingName}_t_category`;\r\n const nCategory = `${stagingName}_n_category`;\r\n const mCategory = `${stagingName}_m_category`;\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\r\n result.valid = false;\r\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\r\n result.message = msg;\r\n }\r\n else if (!($row[stagingSystem]) && $field) {\r\n result.valid = false;\r\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\r\n result.message = msg;\r\n }\r\n else if ($row[stagingSystem] && $field) {\r\n let codeList = [];\r\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage ii bulky',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ies',\r\n 'stage iae',\r\n 'stage ias',\r\n 'stage iaes',\r\n 'stage ib',\r\n 'stage ibe',\r\n 'stage ibs',\r\n 'stage ibes',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iies',\r\n 'stage iiae',\r\n 'stage iias',\r\n 'stage iiaes',\r\n 'stage iib',\r\n 'stage iibe',\r\n 'stage iibs',\r\n 'stage iibes',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iiies',\r\n 'stage iiiae',\r\n 'stage iiias',\r\n 'stage iiiaes',\r\n 'stage iiib',\r\n 'stage iiibe',\r\n 'stage iiibs',\r\n 'stage iiibes',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ive',\r\n 'stage ivs',\r\n 'stage ives',\r\n 'stage ivae',\r\n 'stage ivas',\r\n 'stage ivaes',\r\n 'stage ivb',\r\n 'stage ivbe',\r\n 'stage ivbs',\r\n 'stage ivbes'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\r\n $row[stagingSystem]\r\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\r\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\r\n result = {\r\n valid: false,\r\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\r\n };\r\n }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"posttherapy_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\r\n\r\n \r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\r\n if (!($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n /* This is not a required field, so first ensure that it exists */\r\n else if ($field) {\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"posttherapy_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"posttherapy_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"posttherapy_stage_group":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_stage_group')[0];\r\n\r\n const stagingSystem = stagingName + `_tumour_staging_system`;\r\n const tCategory = `${stagingName}_t_category`;\r\n const nCategory = `${stagingName}_n_category`;\r\n const mCategory = `${stagingName}_m_category`;\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\r\n result.valid = false;\r\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\r\n result.message = msg;\r\n }\r\n else if (!($row[stagingSystem]) && $field) {\r\n result.valid = false;\r\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\r\n result.message = msg;\r\n }\r\n else if ($row[stagingSystem] && $field) {\r\n let codeList = [];\r\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage ii bulky',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ies',\r\n 'stage iae',\r\n 'stage ias',\r\n 'stage iaes',\r\n 'stage ib',\r\n 'stage ibe',\r\n 'stage ibs',\r\n 'stage ibes',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iies',\r\n 'stage iiae',\r\n 'stage iias',\r\n 'stage iiaes',\r\n 'stage iib',\r\n 'stage iibe',\r\n 'stage iibs',\r\n 'stage iibes',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iiies',\r\n 'stage iiiae',\r\n 'stage iiias',\r\n 'stage iiiaes',\r\n 'stage iiib',\r\n 'stage iiibe',\r\n 'stage iiibs',\r\n 'stage iiibes',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ive',\r\n 'stage ivs',\r\n 'stage ives',\r\n 'stage ivae',\r\n 'stage ivas',\r\n 'stage ivaes',\r\n 'stage ivb',\r\n 'stage ivbe',\r\n 'stage ivbs',\r\n 'stage ivbes'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\r\n $row[stagingSystem]\r\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\r\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\r\n result = {\r\n valid: false,\r\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\r\n };\r\n }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}}},"created":{},"deleted":{}},"exposure":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"tobacco_smoking_status":{"restrictions":{"codeList":{"left":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Smoking history not documented"],"right":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"],"data":{"added":["Not applicable"],"deleted":[]}}}},"tobacco_type":{"restrictions":{"codeList":{"left":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"right":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"data":{"added":["Not applicable"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n // check tobacco related fields\r\n if ($name === 'tobacco_type') {\r\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\r\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\r\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\r\n }\r\n else if ($row.tobacco_smoking_status.toLowerCase() === 'smoking history not documented') {\r\n result = { valid: false, message: `The 'tobacco_smoking_status' field (smoking status not documented) is inconsistent if donor smoked '${$row.tobacco_type}'.`};\r\n }\r\n else if ($row.tobacco_smoking_status.toLowerCase() === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if donor is a lifelong non-smoker.`}\r\n }\r\n }\r\n else {\r\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\r\n if (smokerCategories.includes($row.tobacco_smoking_status.toLowerCase())) {\r\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\r\n }\r\n }\r\n }\r\n }\r\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\r\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\r\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}}},"pack_years_smoked":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n // check tobacco related fields\r\n if ($name === 'tobacco_type') {\r\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\r\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\r\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\r\n }\r\n else if ($row.tobacco_smoking_status.toLowerCase() === 'smoking history not documented') {\r\n result = { valid: false, message: `The 'tobacco_smoking_status' field (smoking status not documented) is inconsistent if donor smoked '${$row.tobacco_type}'.`};\r\n }\r\n else if ($row.tobacco_smoking_status.toLowerCase() === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if donor is a lifelong non-smoker.`}\r\n }\r\n }\r\n else {\r\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\r\n if (smokerCategories.includes($row.tobacco_smoking_status.toLowerCase())) {\r\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\r\n }\r\n }\r\n }\r\n }\r\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\r\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\r\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}}},"alcohol_history":{"restrictions":{"codeList":{"left":["Yes","No","Unknown"],"right":["Yes","No","Not applicable","Unknown"],"data":{"added":["Not applicable"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\r\n noOrUnknownAllowedCategories = [\"none\", \"occasional drinker (< once a month)\", \"unknown\"];\r\n \r\n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\r\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\r\n if ((!$field || $field == null || checkforEmpty($field)) && alcoholHistoryCategories.includes(alcoholConsumptionCategory)) {\r\n result = {valid:false, message: `If the donor is a '${alcoholConsumptionCategory}', then the 'alcohol_history' field must be submitted as well.`};\r\n }\r\n if ((!$field || $field === null || checkforEmpty($field) || $field.trim().toLowerCase() === 'no') && (!(noOrUnknownAllowedCategories.includes(alcoholConsumptionCategory)))) {\r\n result = {valid:false, message: `If the donor is a '${alcoholConsumptionCategory}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}}},"alcohol_consumption_category":{"restrictions":{"codeList":{"left":["Daily Drinker","None","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"right":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"data":{"added":["Not applicable"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\r\n \r\n if (!$field || $field === null || checkforEmpty($field)) {\r\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\r\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\r\n }\r\n }\r\n else {\r\n alcoholConsumptionCategory = $field.trim().toLowerCase();\r\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\r\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}}},"alcohol_type":{"restrictions":{"codeList":{"left":["Beer","Liquor","Other","Unknown","Wine"],"right":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"data":{"added":["Not applicable"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n exclusionTerms = [\"no\", \"none\", \"unknown\"]; \r\n requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\r\n \r\n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\r\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\r\n if ($field && $field != null && !(checkforEmpty($field))) {\r\n if (exclusionTerms.includes(alcoholConsumptionCategory)) {\r\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field should not be submitted.`};\r\n }\r\n }\r\n else {\r\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\r\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\r\n }\r\n }\r\n }\r\n if ($field && $field != null && !(checkforEmpty($field)) && (!$row.alcohol_consumption_category || $row.alcohol_consumption_category === null || checkforEmpty($row.alcohol_consumption_category))) {\r\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}},"opiate_use":{"restrictions":{"codeList":{"left":["Never","Unknown","Yes, currently","Yes, only in the past"],"right":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"],"data":{"added":["Not applicable"],"deleted":[]}}}},"hot_drinks_consumption":{"restrictions":{"codeList":{"left":["Never","Unknown","Yes, currently","Yes, only in the past"],"right":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"],"data":{"added":["Not applicable"],"deleted":[]}}}},"red_meat_frequency":{"restrictions":{"codeList":{"left":["Never","Less than once a month","1-3 times a month","Once or twice a week","Most days but not every day","Every day","Unknown"],"right":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"],"data":{"added":["Not applicable"],"deleted":[]}}}},"processed_meat_frequency":{"restrictions":{"codeList":{"left":["Never","Less than once a month","1-3 times a month","Once or twice a week","Most days but not every day","Every day","Unknown"],"right":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"],"data":{"added":["Not applicable"],"deleted":[]}}}},"soft_drinks_frequency":{"restrictions":{"codeList":{"left":["Never","Less than once a month","1-3 times a month","Once or twice a week","Most days but not every day","Every day","Unknown"],"right":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"],"data":{"added":["Not applicable"],"deleted":[]}}}},"exercise_frequency":{"restrictions":{"codeList":{"left":["Never","Less than once a month","1-3 times a month","Once or twice a week","Most days but not every day","Every day","Unknown"],"right":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"],"data":{"added":["Not applicable"],"deleted":[]}}}},"exercise_intensity":{"restrictions":{"codeList":{"left":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Vigorous: Increase in the heart beat substantially with heavy perspiration"],"right":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"data":{"added":["Not applicable","Unknown"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($field != null || !(checkforEmpty($field))) {\r\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency)) && $row.exercise_frequency.trim().toLowerCase() === \"never\") {\r\n result = {valid: false, message: `The 'exercise_frequency' field cannot be 'never' if the '${$name}' field is submitted.`};\r\n }\r\n } \r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}}},"created":{},"deleted":{}},"family_history":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"family_relative_id":{"meta":{"primaryId":{"left":null,"right":true}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"age_of_relative_at_diagnosis":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n if ($row.relative_with_cancer_history != null) {\r\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\r\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\r\n };\r\n }\r\n }\r\n else {\r\n if (currField || currField != null) {\r\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}},"cancer_type_code_of_relative":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n if ($row.relative_with_cancer_history != null) {\r\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\r\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\r\n };\r\n }\r\n }\r\n else {\r\n if (currField || currField != null) {\r\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}},"cause_of_death_of_relative":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n if ($row.relative_vital_status && $row.relative_vital_status != null) {\r\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\r\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\r\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\r\n }\r\n }\r\n else {\r\n if ($field || $field != null) {\r\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]}}},"relative_survival_time":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n if ($row.relative_with_cancer_history != null) {\r\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\r\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\r\n };\r\n }\r\n }\r\n else {\r\n if (currField || currField != null) {\r\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}}},"created":{},"deleted":{}},"biomarker":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"meta":{"notes":{"left":null,"right":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n let missing = true;\r\n\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\r\n \r\n if (!$field || checkforEmpty($field) || $field === null) { \r\n for (let idField of identifierFields) {\r\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\r\n continue;\r\n }\r\n else {\r\n missing = false;\r\n }\r\n }\r\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\r\n result = {\r\n valid: false,\r\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\r\n }\r\n }\r\n else if ($field && !(checkforEmpty($field)) && $field != null) {\r\n for (let idField of identifierFields) {\r\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\r\n result = {\r\n valid: false,\r\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\r\n break;\r\n }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"},"notes":{"left":null,"right":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n let missing = true;\r\n\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\r\n \r\n if (!$field || checkforEmpty($field) || $field === null) { \r\n for (let idField of identifierFields) {\r\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\r\n continue;\r\n }\r\n else {\r\n missing = false;\r\n }\r\n }\r\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\r\n result = {\r\n valid: false,\r\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\r\n }\r\n }\r\n else if ($field && !(checkforEmpty($field)) && $field != null) {\r\n for (let idField of identifierFields) {\r\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\r\n result = {\r\n valid: false,\r\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\r\n break;\r\n }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"treatment.submitter_treatment_id"},"notes":{"left":null,"right":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n let missing = true;\r\n\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\r\n \r\n if (!$field || checkforEmpty($field) || $field === null) { \r\n for (let idField of identifierFields) {\r\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\r\n continue;\r\n }\r\n else {\r\n missing = false;\r\n }\r\n }\r\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\r\n result = {\r\n valid: false,\r\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\r\n }\r\n }\r\n else if ($field && !(checkforEmpty($field)) && $field != null) {\r\n for (let idField of identifierFields) {\r\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\r\n result = {\r\n valid: false,\r\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\r\n break;\r\n }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}}},"submitter_follow_up_id":{"meta":{"foreignKey":{"left":null,"right":"follow_up.submitter_follow_up_id"},"notes":{"left":null,"right":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n let missing = true;\r\n\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\r\n \r\n if (!$field || checkforEmpty($field) || $field === null) { \r\n for (let idField of identifierFields) {\r\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\r\n continue;\r\n }\r\n else {\r\n missing = false;\r\n }\r\n }\r\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\r\n result = {\r\n valid: false,\r\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\r\n }\r\n }\r\n else if ($field && !(checkforEmpty($field)) && $field != null) {\r\n for (let idField of identifierFields) {\r\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\r\n result = {\r\n valid: false,\r\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\r\n break;\r\n }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}}},"test_interval":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n let missing = true;\r\n\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\r\n \r\n if (!$field || checkforEmpty($field) || $field === null) { \r\n for (let idField of identifierFields) {\r\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\r\n continue;\r\n }\r\n else {\r\n missing = false;\r\n }\r\n }\r\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\r\n result = {\r\n valid: false,\r\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\r\n }\r\n }\r\n else if ($field && !(checkforEmpty($field)) && $field != null) {\r\n for (let idField of identifierFields) {\r\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\r\n result = {\r\n valid: false,\r\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\r\n break;\r\n }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}}}},"created":{},"deleted":{}},"comorbidity":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"laterality_of_prior_malignancy":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n const invalidTypes = [\"no\", \"unknown\"]\r\n \r\n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\r\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\r\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}},"age_at_comorbidity_diagnosis":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n const invalidTypes = [\"no\", \"unknown\"]\r\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\r\n \r\n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\r\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\r\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\r\n }\r\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\r\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\r\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\r\n }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]}}},"comorbidity_type_code":{"meta":{"notes":{"left":null,"right":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n const invalidTypes = [\"no\", \"unknown\"]\r\n /* check if ICD-10 code is for neoplasms */\r\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\r\n\r\n \r\n if (neoplasmCode($row.comorbidity_type_code)) { \r\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\r\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\r\n }\r\n }\r\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\r\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"]}}},"comorbidity_treatment_status":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n const invalidTypes = [\"no\", \"unknown\"]\r\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\r\n \r\n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\r\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\r\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\r\n }\r\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\r\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\r\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\r\n }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]}}},"comorbidity_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n const invalidTypes = [\"no\", \"unknown\"]\r\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\r\n \r\n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\r\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\r\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\r\n }\r\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\r\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\r\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\r\n }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]}}}},"created":{},"deleted":{}},"surgery":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"created","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"created","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"created","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"created","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"created","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"created","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"created","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"created","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"created","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"created","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"created","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"created","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"created","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"created","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}},"deleted":{}}}} diff --git a/website/static/data/schemas/diffs/1.13/1.13-diff-1.24.json b/website/static/data/schemas/diffs/1.13/1.13-diff-1.24.json new file mode 100644 index 00000000..4108e63b --- /dev/null +++ b/website/static/data/schemas/diffs/1.13/1.13-diff-1.24.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"],"deleted":[]}}}},"submitter_sample_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"primary_site":{"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"data":{"added":["Unknown primary site"],"deleted":[]}}}},"genetic_disorders":{"description":{"left":"Indicate presence of any hereditary genetic disorders. (Reference: Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","right":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)"},"restrictions":{"codeList":{"left":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Serrated Polyposis Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"],"right":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"],"data":{"added":["None","Not applicable","Unknown"],"deleted":[]}}}},"hrt_type":{"restrictions":{"codeList":{"left":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Other","Patch","Pill","Unknown"],"right":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"],"data":{"added":["Not applicable"],"deleted":[]}}}},"hrt_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\") {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If '${$name}' is submitted, then '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"]}}},"contraception_type":{"restrictions":{"codeList":{"left":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Other","Progestin-only pill","Unknown","Vaginal ring"],"right":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"],"data":{"added":["Not applicable","Oral contraceptive pill"],"deleted":[]}}}},"contraception_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\") {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If '${$name}' is submitted, then '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"]}}}},"created":{"lost_to_followup_after_clinical_event_id":{"changeType":"created","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}},"deleted":{}},"specimen":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"pathological_tumour_staging_system":{"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"pathological_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["Not applicable"],"deleted":[]}}}},"specimen_acquisition_interval":{"restrictions":{"range":{"left":{"min":0},"right":null}}},"specimen_laterality":{"description":{"left":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR 2007875)","right":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)"},"restrictions":{"codeList":{"left":["Left","Right","Unknown"],"right":["Left","Not applicable","Right","Unknown"],"data":{"added":["Not applicable"],"deleted":[]}}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"specimen_storage":{"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"reference_pathology_confirmed":{"description":{"left":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist.","right":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)"}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"percent_tumour_cells":{"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"]}}}},"created":{"percent_tumour_cells_measurement_method":{"changeType":"created","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}},"deleted":{}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"laterality":{"description":{"left":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR 827)","right":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)"}},"clinical_tumour_staging_system":{"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"clinical_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["Not applicable"],"deleted":[]}}}},"performance_status":{"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}}},"created":{"lymph_nodes_examined_method":{"changeType":"created","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}},"deleted":{}},"treatment":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":["End of life care"],"deleted":[]}}}},"is_primary_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Yes","No","Unknown"],"right":["Yes","No"],"data":{"added":[],"deleted":["Unknown"]}}}},"line_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'unknown') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'unknown'.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"]}}},"treatment_start_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":{"exclusiveMin":0},"right":null}}},"treatment_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"days_per_cycle":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"number_of_cycles":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_intent":{"description":{"left":"Indicate the intended disease outcome for which the treatment is given. (Reference: NCIt C124307)","right":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)"},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Curative","Palliative","Unknown"],"right":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"],"data":{"added":["Diagnostic","Forensic","Guidance","Preventative","Screening","Supportive"],"deleted":["Unknown"]}}}},"treatment_setting":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Adjuvant","Advanced/Metastatic","Neoadjuvant","Not applicable"],"right":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"],"data":{"added":["Conditioning","Induction","Maintenance","Mobilization","Preventative","Radiosensitization","Salvage"],"deleted":["Not applicable"]}}}},"response_to_treatment":{"description":{"left":"The donor's response to the applied treatment regimen. (Source: RECIST)","right":"The donor's response to the applied treatment regimen."},"meta":{"dependsOn":{"left":"treatment.treatment_type","right":"treatment.response_to_treatment_criteria_method"},"notes":{"left":null,"right":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"]},"codeList":{"left":["Complete response","Disease progression","NED","Partial response","Stable disease"],"right":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"],"data":{"added":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease"],"deleted":["Disease progression","NED"]}}}},"outcome_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"toxicity_type":{"restrictions":{"codeList":{"left":["Hematological","Non-hematological"],"right":["Hematological","Non-hematological","Not applicable","Unknown"],"data":{"added":["Not applicable","Unknown"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n \n /* toxicityType should only be submitted if treatment was terminated early due to acute toxicity ('outcome_of_treatment' is 'Treatment stopped due to acute toxicity'). */\n if (outcomeOfTreatment != \"treatment stopped due to acute toxicity\") {\n result = { valid: false, message: `The 'outcome_of_treatment' field should be 'Treatment stopped due to acute toxicity' if the '${$name}' field is submitted.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"]}}},"hematological_toxicity":{"restrictions":{"codeList":{"left":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5"],"right":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"data":{"added":["Unknown"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n if (($row.toxicity_type != null && !(checkforEmpty($row.toxicity_type)))) { \n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n \n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}},"non-hematological_toxicity":{"restrictions":{"codeList":{"left":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"right":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"data":{"added":["Unknown"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n if (($row.toxicity_type != null && !(checkforEmpty($row.toxicity_type)))) { \n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n \n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}},"adverse_events":{"restrictions":{"codeList":{"left":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"right":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"data":{"added":["None","Unknown"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"clinical_trials_database":{"meta":{"notes":{"left":null,"right":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added."}},"restrictions":{"codeList":{"left":["NCI Clinical Trials","EU Clinical Trials Register"],"right":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"],"data":{"added":["Not applicable","Unknown"],"deleted":[]}}}},"clinical_trial_number":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"]}}}},"created":{"response_to_treatment_criteria_method":{"changeType":"created","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}}},"deleted":{}},"chemotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"created","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{"chemotherapy_dosage_units":{"changeType":"deleted","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate the total actual drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true,"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"created","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{"hormone_drug_dosage_units":{"changeType":"deleted","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true,"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"radiation":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{"radiation_boost":{"changeType":"created","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"created","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}},"deleted":{}},"immunotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"immunotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"displayName":{"left":"Immunotherapy Drug Name","right":"Chemotherapy Drug Name"},"dependsOn":{"left":null,"right":"immunotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"created","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{}},"follow_up":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_follow_up_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"interval_of_followup":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"treatment.submitter_treatment_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"relapse_type":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"relapse_interval":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"method_of_progression_status":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"anatomic_site_progression_or_recurrence":{"description":{"left":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","right":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344."},"meta":{"examples":{"left":"C50.1,C18","right":"C50.1|C18"},"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_t_category":{"meta":{"core":{"left":true,"right":null}}},"recurrence_n_category":{"meta":{"core":{"left":true,"right":null}}},"recurrence_m_category":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["Not applicable"],"deleted":[]}}}},"recurrence_stage_group":{"meta":{"core":{"left":true,"right":null}}},"posttherapy_tumour_staging_system":{"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"posttherapy_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["Not applicable"],"deleted":[]}}}}},"created":{},"deleted":{}},"exposure":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"tobacco_smoking_status":{"restrictions":{"codeList":{"left":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Smoking history not documented"],"right":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"],"data":{"added":["Not applicable"],"deleted":[]}}}},"tobacco_type":{"restrictions":{"codeList":{"left":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"right":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"data":{"added":["Not applicable"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else if ($row.tobacco_smoking_status.toLowerCase() === 'smoking history not documented') {\n result = { valid: false, message: `The 'tobacco_smoking_status' field (smoking status not documented) is inconsistent if donor smoked '${$row.tobacco_type}'.`};\n }\n else if ($row.tobacco_smoking_status.toLowerCase() === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if donor is a lifelong non-smoker.`}\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}}},"pack_years_smoked":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else if ($row.tobacco_smoking_status.toLowerCase() === 'smoking history not documented') {\n result = { valid: false, message: `The 'tobacco_smoking_status' field (smoking status not documented) is inconsistent if donor smoked '${$row.tobacco_type}'.`};\n }\n else if ($row.tobacco_smoking_status.toLowerCase() === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if donor is a lifelong non-smoker.`}\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}}},"alcohol_history":{"restrictions":{"codeList":{"left":["Yes","No","Unknown"],"right":["Yes","No","Not applicable","Unknown"],"data":{"added":["Not applicable"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n noOrUnknownAllowedCategories = [\"none\", \"occasional drinker (< once a month)\", \"unknown\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ((!$field || $field == null || checkforEmpty($field)) && alcoholHistoryCategories.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `If the donor is a '${alcoholConsumptionCategory}', then the 'alcohol_history' field must be submitted as well.`};\n }\n if ((!$field || $field === null || checkforEmpty($field) || $field.trim().toLowerCase() === 'no') && (!(noOrUnknownAllowedCategories.includes(alcoholConsumptionCategory)))) {\n result = {valid:false, message: `If the donor is a '${alcoholConsumptionCategory}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}}},"alcohol_consumption_category":{"restrictions":{"codeList":{"left":["Daily Drinker","None","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"right":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"data":{"added":["Not applicable"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}}},"alcohol_type":{"restrictions":{"codeList":{"left":["Beer","Liquor","Other","Unknown","Wine"],"right":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"data":{"added":["Not applicable"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n exclusionTerms = [\"no\", \"none\", \"unknown\"]; \n requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (exclusionTerms.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field should not be submitted.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n if ($field && $field != null && !(checkforEmpty($field)) && (!$row.alcohol_consumption_category || $row.alcohol_consumption_category === null || checkforEmpty($row.alcohol_consumption_category))) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}},"opiate_use":{"restrictions":{"codeList":{"left":["Never","Unknown","Yes, currently","Yes, only in the past"],"right":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"],"data":{"added":["Not applicable"],"deleted":[]}}}},"hot_drinks_consumption":{"restrictions":{"codeList":{"left":["Never","Unknown","Yes, currently","Yes, only in the past"],"right":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"],"data":{"added":["Not applicable"],"deleted":[]}}}},"red_meat_frequency":{"restrictions":{"codeList":{"left":["Never","Less than once a month","1-3 times a month","Once or twice a week","Most days but not every day","Every day","Unknown"],"right":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"],"data":{"added":["Not applicable"],"deleted":[]}}}},"processed_meat_frequency":{"restrictions":{"codeList":{"left":["Never","Less than once a month","1-3 times a month","Once or twice a week","Most days but not every day","Every day","Unknown"],"right":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"],"data":{"added":["Not applicable"],"deleted":[]}}}},"soft_drinks_frequency":{"restrictions":{"codeList":{"left":["Never","Less than once a month","1-3 times a month","Once or twice a week","Most days but not every day","Every day","Unknown"],"right":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"],"data":{"added":["Not applicable"],"deleted":[]}}}},"exercise_frequency":{"restrictions":{"codeList":{"left":["Never","Less than once a month","1-3 times a month","Once or twice a week","Most days but not every day","Every day","Unknown"],"right":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"],"data":{"added":["Not applicable"],"deleted":[]}}}},"exercise_intensity":{"restrictions":{"codeList":{"left":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Vigorous: Increase in the heart beat substantially with heavy perspiration"],"right":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"data":{"added":["Not applicable","Unknown"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null || !(checkforEmpty($field))) {\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency)) && $row.exercise_frequency.trim().toLowerCase() === \"never\") {\n result = {valid: false, message: `The 'exercise_frequency' field cannot be 'never' if the '${$name}' field is submitted.`};\n }\n } \n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}}},"created":{},"deleted":{}},"family_history":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"family_relative_id":{"meta":{"primaryId":{"left":null,"right":true}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"biomarker":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"treatment.submitter_treatment_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_follow_up_id":{"meta":{"foreignKey":{"left":null,"right":"follow_up.submitter_follow_up_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"test_interval":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}}},"created":{},"deleted":{}},"comorbidity":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"surgery":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"created","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"created","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"created","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"created","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"created","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"created","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"created","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"created","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"created","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"created","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"created","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"created","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"created","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"created","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}},"deleted":{}}}} diff --git a/website/static/data/schemas/diffs/1.14/1.14-diff-1.24.json b/website/static/data/schemas/diffs/1.14/1.14-diff-1.24.json new file mode 100644 index 00000000..e967455b --- /dev/null +++ b/website/static/data/schemas/diffs/1.14/1.14-diff-1.24.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"],"deleted":[]}}}},"submitter_sample_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"primary_site":{"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"data":{"added":["Unknown primary site"],"deleted":[]}}}}},"created":{"lost_to_followup_after_clinical_event_id":{"changeType":"created","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}},"deleted":{}},"specimen":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"pathological_tumour_staging_system":{"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"pathological_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["Not applicable"],"deleted":[]}}}},"specimen_acquisition_interval":{"restrictions":{"range":{"left":{"min":0},"right":null}}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"percent_tumour_cells":{"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"]}}}},"created":{"percent_tumour_cells_measurement_method":{"changeType":"created","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}},"deleted":{}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"clinical_tumour_staging_system":{"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"clinical_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["Not applicable"],"deleted":[]}}}}},"created":{"lymph_nodes_examined_method":{"changeType":"created","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}},"deleted":{}},"treatment":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":["End of life care"],"deleted":[]}}}},"is_primary_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Yes","No","Unknown"],"right":["Yes","No"],"data":{"added":[],"deleted":["Unknown"]}}}},"line_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'unknown') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'unknown'.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"]}}},"treatment_start_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":{"exclusiveMin":0},"right":null}}},"treatment_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"days_per_cycle":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"number_of_cycles":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_intent":{"description":{"left":"Indicate the intended disease outcome for which the treatment is given. (Reference: NCIt C124307)","right":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)"},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Curative","Palliative","Unknown"],"right":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"],"data":{"added":["Diagnostic","Forensic","Guidance","Preventative","Screening","Supportive"],"deleted":["Unknown"]}}}},"treatment_setting":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Adjuvant","Advanced/Metastatic","Neoadjuvant","Not applicable"],"right":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"],"data":{"added":["Conditioning","Induction","Maintenance","Mobilization","Preventative","Radiosensitization","Salvage"],"deleted":["Not applicable"]}}}},"response_to_treatment":{"description":{"left":"The donor's response to the applied treatment regimen. (Source: RECIST)","right":"The donor's response to the applied treatment regimen."},"meta":{"dependsOn":{"left":"treatment.treatment_type","right":"treatment.response_to_treatment_criteria_method"},"notes":{"left":null,"right":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"]},"codeList":{"left":["Complete response","Disease progression","NED","Partial response","Stable disease"],"right":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"],"data":{"added":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease"],"deleted":["Disease progression","NED"]}}}},"outcome_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"adverse_events":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}}},"created":{"response_to_treatment_criteria_method":{"changeType":"created","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}}},"deleted":{}},"chemotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"created","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{"chemotherapy_dosage_units":{"changeType":"deleted","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate the total actual drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true,"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"created","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{"hormone_drug_dosage_units":{"changeType":"deleted","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true,"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"radiation":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{"radiation_boost":{"changeType":"created","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"created","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}},"deleted":{}},"immunotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"immunotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"displayName":{"left":"Immunotherapy Drug Name","right":"Chemotherapy Drug Name"},"dependsOn":{"left":null,"right":"immunotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"created","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{}},"surgery":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"surgery_type":{"restrictions":{"codeList":{"left":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"],"right":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"],"data":{"added":["Hemithyroidectomy","Near-total thyroidectomy","Subtotal thyroidectomy","Total thyroidectomy"],"deleted":[]}}}}},"created":{},"deleted":{}},"follow_up":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_follow_up_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"interval_of_followup":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"treatment.submitter_treatment_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"relapse_type":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"relapse_interval":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"method_of_progression_status":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"anatomic_site_progression_or_recurrence":{"description":{"left":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","right":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344."},"meta":{"examples":{"left":"C50.1,C18","right":"C50.1|C18"},"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_t_category":{"meta":{"core":{"left":true,"right":null}}},"recurrence_n_category":{"meta":{"core":{"left":true,"right":null}}},"recurrence_m_category":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["Not applicable"],"deleted":[]}}}},"recurrence_stage_group":{"meta":{"core":{"left":true,"right":null}}},"posttherapy_tumour_staging_system":{"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"posttherapy_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["Not applicable"],"deleted":[]}}}}},"created":{},"deleted":{}},"exposure":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"family_history":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"family_relative_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"biomarker":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"treatment.submitter_treatment_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_follow_up_id":{"meta":{"foreignKey":{"left":null,"right":"follow_up.submitter_follow_up_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"test_interval":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}}},"created":{},"deleted":{}},"comorbidity":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}}}} diff --git a/website/static/data/schemas/diffs/1.15/1.15-diff-1.24.json b/website/static/data/schemas/diffs/1.15/1.15-diff-1.24.json new file mode 100644 index 00000000..df8ffbee --- /dev/null +++ b/website/static/data/schemas/diffs/1.15/1.15-diff-1.24.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"],"deleted":[]}}}},"submitter_sample_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"primary_site":{"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"data":{"added":["Unknown primary site"],"deleted":[]}}}}},"created":{"lost_to_followup_after_clinical_event_id":{"changeType":"created","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}},"deleted":{}},"specimen":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"pathological_tumour_staging_system":{"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"pathological_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["Not applicable"],"deleted":[]}}}},"specimen_acquisition_interval":{"restrictions":{"range":{"left":{"min":0},"right":null}}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"percent_tumour_cells":{"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"]}}}},"created":{"percent_tumour_cells_measurement_method":{"changeType":"created","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}},"deleted":{}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"clinical_tumour_staging_system":{"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"clinical_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["Not applicable"],"deleted":[]}}}}},"created":{"lymph_nodes_examined_method":{"changeType":"created","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}},"deleted":{}},"treatment":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":["End of life care"],"deleted":[]}}}},"is_primary_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Yes","No","Unknown"],"right":["Yes","No"],"data":{"added":[],"deleted":["Unknown"]}}}},"line_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'unknown') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'unknown'.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"]}}},"treatment_start_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":{"exclusiveMin":0},"right":null}}},"treatment_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"days_per_cycle":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"number_of_cycles":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_intent":{"description":{"left":"Indicate the intended disease outcome for which the treatment is given. (Reference: NCIt C124307)","right":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)"},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Curative","Palliative","Unknown"],"right":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"],"data":{"added":["Diagnostic","Forensic","Guidance","Preventative","Screening","Supportive"],"deleted":["Unknown"]}}}},"treatment_setting":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Adjuvant","Advanced/Metastatic","Neoadjuvant","Not applicable"],"right":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"],"data":{"added":["Conditioning","Induction","Maintenance","Mobilization","Preventative","Radiosensitization","Salvage"],"deleted":["Not applicable"]}}}},"response_to_treatment":{"description":{"left":"The donor's response to the applied treatment regimen. (Source: RECIST)","right":"The donor's response to the applied treatment regimen."},"meta":{"dependsOn":{"left":"treatment.treatment_type","right":"treatment.response_to_treatment_criteria_method"},"notes":{"left":null,"right":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"]},"codeList":{"left":["Complete response","Disease progression","NED","Partial response","Stable disease"],"right":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"],"data":{"added":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease"],"deleted":["Disease progression","NED"]}}}},"outcome_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"adverse_events":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}}},"created":{"response_to_treatment_criteria_method":{"changeType":"created","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}}},"deleted":{}},"chemotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"created","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{"chemotherapy_dosage_units":{"changeType":"deleted","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate the total actual drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true,"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"created","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{"hormone_drug_dosage_units":{"changeType":"deleted","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true,"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"radiation":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{"radiation_boost":{"changeType":"created","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"created","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}},"deleted":{}},"immunotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"immunotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"displayName":{"left":"Immunotherapy Drug Name","right":"Chemotherapy Drug Name"},"dependsOn":{"left":null,"right":"immunotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"created","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{}},"surgery":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"follow_up":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_follow_up_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"interval_of_followup":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"treatment.submitter_treatment_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"relapse_type":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"relapse_interval":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"method_of_progression_status":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"anatomic_site_progression_or_recurrence":{"description":{"left":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","right":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344."},"meta":{"examples":{"left":"C50.1,C18","right":"C50.1|C18"},"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_t_category":{"meta":{"core":{"left":true,"right":null}}},"recurrence_n_category":{"meta":{"core":{"left":true,"right":null}}},"recurrence_m_category":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["Not applicable"],"deleted":[]}}}},"recurrence_stage_group":{"meta":{"core":{"left":true,"right":null}}},"posttherapy_tumour_staging_system":{"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"posttherapy_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["Not applicable"],"deleted":[]}}}}},"created":{},"deleted":{}},"exposure":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"family_history":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"family_relative_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"biomarker":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"treatment.submitter_treatment_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_follow_up_id":{"meta":{"foreignKey":{"left":null,"right":"follow_up.submitter_follow_up_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"test_interval":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}}},"created":{},"deleted":{}},"comorbidity":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}}}} diff --git a/website/static/data/schemas/diffs/1.16/1.16-diff-1.24.json b/website/static/data/schemas/diffs/1.16/1.16-diff-1.24.json new file mode 100644 index 00000000..d5870c1b --- /dev/null +++ b/website/static/data/schemas/diffs/1.16/1.16-diff-1.24.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"],"deleted":[]}}}},"submitter_sample_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{"lost_to_followup_after_clinical_event_id":{"changeType":"created","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}},"deleted":{}},"specimen":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"specimen_acquisition_interval":{"restrictions":{"range":{"left":{"min":0},"right":null}}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"percent_tumour_cells":{"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"]}}}},"created":{"percent_tumour_cells_measurement_method":{"changeType":"created","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}},"deleted":{}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"lymph_nodes_examined_method":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable'];\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"]}}}},"created":{},"deleted":{}},"treatment":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":["End of life care"],"deleted":[]}}}},"is_primary_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_start_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":{"exclusiveMin":0},"right":null}}},"treatment_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"days_per_cycle":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"number_of_cycles":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_intent":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_setting":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"response_to_treatment_criteria_method":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"response_to_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"]},"codeList":{"left":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed stable disease","Progressive disease","Stable disease"],"right":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"],"data":{"added":["Physician assessed progressive disease"],"deleted":[]}}}},"outcome_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"adverse_events":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}}},"created":{},"deleted":{}},"chemotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"chemotherapy_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"data":{"added":["mg"],"deleted":[]}}}},"prescribed_cumulative_drug_dose":{"meta":{"validationDependency":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"]}}},"actual_cumulative_drug_dose":{"meta":{"validationDependency":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"deleted":{}},"hormone_therapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"hormone_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"data":{"added":["mg"],"deleted":[]}}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"deleted":{}},"radiation":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{"radiation_boost":{"changeType":"created","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"created","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}},"deleted":{}},"immunotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"immunotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"displayName":{"left":"Immunotherapy Drug Name","right":"Chemotherapy Drug Name"},"dependsOn":{"left":null,"right":"immunotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"immunotherapy_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"data":{"added":["mg"],"deleted":[]}}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"deleted":{}},"surgery":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"follow_up":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_follow_up_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"interval_of_followup":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"relapse_interval":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"anatomic_site_progression_or_recurrence":{"description":{"left":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","right":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344."},"meta":{"examples":{"left":"C50.1,C18","right":"C50.1|C18"},"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"created":{},"deleted":{}},"exposure":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"family_history":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"family_relative_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"biomarker":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_follow_up_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"test_interval":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}}},"created":{},"deleted":{}},"comorbidity":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}}}} diff --git a/website/static/data/schemas/diffs/1.17/1.17-diff-1.24.json b/website/static/data/schemas/diffs/1.17/1.17-diff-1.24.json new file mode 100644 index 00000000..8ce7ba5e --- /dev/null +++ b/website/static/data/schemas/diffs/1.17/1.17-diff-1.24.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":["Cell line - derived from metastatic tumour","Xenograft - derived from metastatic tumour"],"deleted":[]}}}},"submitter_sample_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{"lost_to_followup_after_clinical_event_id":{"changeType":"created","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}},"deleted":{}},"specimen":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"specimen_acquisition_interval":{"restrictions":{"range":{"left":{"min":0},"right":null}}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"percent_tumour_cells":{"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"]}}}},"created":{},"deleted":{}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"lymph_nodes_examined_method":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"]}}}},"created":{},"deleted":{}},"treatment":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":["End of life care"],"deleted":[]}}}},"is_primary_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_start_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":{"exclusiveMin":0},"right":null}}},"treatment_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"days_per_cycle":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"number_of_cycles":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_intent":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_setting":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"response_to_treatment_criteria_method":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"response_to_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"]},"codeList":{"left":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed stable disease","Progressive disease","Stable disease"],"right":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"],"data":{"added":["Physician assessed progressive disease"],"deleted":[]}}}},"outcome_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"adverse_events":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}}},"created":{},"deleted":{}},"chemotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"chemotherapy_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"data":{"added":["mg"],"deleted":[]}}}},"prescribed_cumulative_drug_dose":{"meta":{"validationDependency":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"]}}},"actual_cumulative_drug_dose":{"meta":{"validationDependency":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"deleted":{}},"hormone_therapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"hormone_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"data":{"added":["mg"],"deleted":[]}}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"deleted":{}},"radiation":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{"radiation_boost":{"changeType":"created","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"created","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}},"deleted":{}},"immunotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"immunotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"displayName":{"left":"Immunotherapy Drug Name","right":"Chemotherapy Drug Name"},"dependsOn":{"left":null,"right":"immunotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"immunotherapy_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"data":{"added":["mg"],"deleted":[]}}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"deleted":{}},"surgery":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"follow_up":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_follow_up_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"interval_of_followup":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"relapse_interval":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}}},"created":{},"deleted":{}},"exposure":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"family_history":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"family_relative_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"biomarker":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_follow_up_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"test_interval":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}}},"created":{},"deleted":{}},"comorbidity":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}}}} diff --git a/website/static/data/schemas/diffs/1.18/1.18-diff-1.24.json b/website/static/data/schemas/diffs/1.18/1.18-diff-1.24.json new file mode 100644 index 00000000..88e2936e --- /dev/null +++ b/website/static/data/schemas/diffs/1.18/1.18-diff-1.24.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":["Cell line - derived from metastatic tumour","Xenograft - derived from metastatic tumour"],"deleted":[]}}}},"submitter_sample_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{"lost_to_followup_after_clinical_event_id":{"changeType":"created","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}},"deleted":{}},"specimen":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"specimen_acquisition_interval":{"restrictions":{"range":{"left":{"min":0},"right":null}}},"percent_tumour_cells":{"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"]}}}},"created":{},"deleted":{}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"treatment":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":["End of life care"],"deleted":[]}}}},"is_primary_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_start_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":{"exclusiveMin":0},"right":null}}},"treatment_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"days_per_cycle":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"number_of_cycles":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_intent":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_setting":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"response_to_treatment_criteria_method":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"response_to_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"]},"codeList":{"left":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed stable disease","Progressive disease","Stable disease"],"right":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"],"data":{"added":["Physician assessed progressive disease"],"deleted":[]}}}},"outcome_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"adverse_events":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}}},"created":{},"deleted":{}},"chemotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"chemotherapy_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"data":{"added":["mg"],"deleted":[]}}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"deleted":{}},"hormone_therapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"hormone_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"data":{"added":["mg"],"deleted":[]}}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"deleted":{}},"radiation":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{"radiation_boost":{"changeType":"created","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"created","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}},"deleted":{}},"immunotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"immunotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"displayName":{"left":"Immunotherapy Drug Name","right":"Chemotherapy Drug Name"},"dependsOn":{"left":null,"right":"immunotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"immunotherapy_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"data":{"added":["mg"],"deleted":[]}}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"deleted":{}},"surgery":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"follow_up":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_follow_up_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"interval_of_followup":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"relapse_interval":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}}},"created":{},"deleted":{}},"exposure":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"family_history":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"family_relative_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"biomarker":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_follow_up_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"test_interval":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}}},"created":{},"deleted":{}},"comorbidity":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}}}} diff --git a/website/static/data/schemas/diffs/1.19/1.19-diff-1.24.json b/website/static/data/schemas/diffs/1.19/1.19-diff-1.24.json new file mode 100644 index 00000000..5d29b1d9 --- /dev/null +++ b/website/static/data/schemas/diffs/1.19/1.19-diff-1.24.json @@ -0,0 +1 @@ +{"schemas":{"specimen":{"updated":{"specimen_acquisition_interval":{"restrictions":{"range":{"left":{"min":0},"right":null}}},"percent_tumour_cells":{"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"]}}}},"created":{},"deleted":{}},"treatment":{"updated":{"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":["End of life care"],"deleted":[]}}}},"is_primary_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_start_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":{"exclusiveMin":0},"right":null}}},"treatment_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"days_per_cycle":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"number_of_cycles":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_intent":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_setting":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"response_to_treatment_criteria_method":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"response_to_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"]}}},"outcome_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"adverse_events":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}}},"created":{},"deleted":{}},"chemotherapy":{"updated":{"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"chemotherapy_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"data":{"added":["mg"],"deleted":[]}}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"deleted":{}},"hormone_therapy":{"updated":{"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"hormone_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"data":{"added":["mg"],"deleted":[]}}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"deleted":{}},"immunotherapy":{"updated":{"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"immunotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"displayName":{"left":"Immunotherapy Drug Name","right":"Chemotherapy Drug Name"},"dependsOn":{"left":null,"right":"immunotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"immunotherapy_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"data":{"added":["mg"],"deleted":[]}}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"deleted":{}},"follow_up":{"updated":{"interval_of_followup":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"relapse_interval":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}}},"created":{},"deleted":{}},"biomarker":{"updated":{"test_interval":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}}},"created":{},"deleted":{}},"radiation":{"updated":{},"created":{"radiation_boost":{"changeType":"created","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"created","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}},"deleted":{}}}} diff --git a/website/static/data/schemas/diffs/1.2/1.2-diff-1.24.json b/website/static/data/schemas/diffs/1.2/1.2-diff-1.24.json new file mode 100644 index 00000000..04d704d8 --- /dev/null +++ b/website/static/data/schemas/diffs/1.2/1.2-diff-1.24.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n const row = $row;\n let result = {valid: true, message: \"Ok\"};\n \n const designation = row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\"){\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when tumour_normal_designation is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when tumour_normal_designation is set to Tumour.\"};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"]}}},"submitter_sample_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased","Unknown"],"right":["Alive","Deceased"],"data":{"added":[],"deleted":["Unknown"]}}}},"cause_of_death":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]}}},"survival_time":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"primary_site":{"meta":{"notes":{"left":null,"right":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"examples":{"left":null,"right":"Breast|Ovary"}},"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Not Reported","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva","Unknown"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"data":{"added":["Unknown primary site"],"deleted":["Not Reported","Unknown"]}}}},"height":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"weight":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"bmi":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"menopause_status":{"description":{"left":"Indicate the donor's menopause status at the time of primary diagnosis. (Codelist reference: NCI CDE ID: 2434914)","right":"Indicate the donor's menopause status at the time of primary diagnosis. (Reference: caDSR CDE ID 2434914)"},"restrictions":{"codeList":{"left":["Indeterminate or unknown","Not applicable","Perimenopausal","Postmenopausal","Premenopausal"],"right":["Not applicable","Perimenopausal","Postmenopausal","Premenopausal","Unknown"],"data":{"added":["Unknown"],"deleted":["Indeterminate or unknown"]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age of menarche, the first occurrence of menstruation.","right":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)"},"restrictions":{}},"number_of_pregnancies":{"description":{"left":"Indicate the number of pregnancies a donor has had.","right":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)"},"restrictions":{}},"number_of_children":{"description":{"left":"Indicate the number of children the donor has birthed.","right":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)"},"restrictions":{}}},"created":{"genetic_disorders":{"changeType":"created","description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},"hrt_type":{"changeType":"created","description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},"hrt_duration":{"changeType":"created","description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},"contraception_type":{"changeType":"created","description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},"contraception_duration":{"changeType":"created","description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},"lost_to_followup_after_clinical_event_id":{"changeType":"created","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}},"deleted":{"prior_malignancy":{"changeType":"deleted","description":"Prior malignancy affecting donor.","name":"prior_malignancy","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy","examples":"C41.1, C16.9, C00.5, D46.9"}},"cancer_type_prior_malignancy":{"changeType":"deleted","description":"The code to represent the cancer type of a prior malignancy using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","name":"cancer_type_prior_malignancy","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"valueType":"string","meta":{"displayName":"Cancer Type Prior Malignancy"}},"age_at_prior_malignancy":{"changeType":"deleted","description":"If donor has history of prior malignancy, indicate age at previous diagnosis, in years.","name":"age_at_prior_malignancy","valueType":"integer","meta":{"displayName":"Age at Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"deleted","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Codelist reference: NCI CDE: 4122391)","name":"laterality_of_prior_malignancy","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality at Prior Malignancy"}}}},"specimen":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null},"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"pathological_tumour_staging_system":{"meta":{"validationDependency":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"pathological_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"pathological_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"pathological_stage_group":{"restrictions":{"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.pathological_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.pathological_tumour_staging_system && $row.pathological_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'pathological_tumour_staging_system' is set to '${\n $row.pathological_tumour_staging_system\n }', 'pathological_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"specimen_storage":{"description":{"left":"Indicate the method of specimen storage for specimens that were not extracted freshly or immediately cultured.","right":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured."},"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"reference_pathology_confirmed":{"description":{"left":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist.","right":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)"}},"tumour_grading_system":{"meta":{"validationDependency":{"left":null,"right":true}}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = \"'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.\";\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"percent_tumour_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of infiltration by tumour cells in a specimen.","right":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)"},"restrictions":{}},"percent_proliferating_cells":{"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_inflammatory_tissue":{"description":{"left":"Indicate a value, in decimals, that represents local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue.","right":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_stromal_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a malignant tumour specimen but are not malignant such as fibroblasts, vascular structures, etc.","right":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_necrosis":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of cell death in a malignant tumour specimen.","right":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)"},"meta":{"core":{"left":true,"right":null},"notes":{"left":"This field is only required if the specimen is a tumour.","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}}},"created":{"specimen_laterality":{"changeType":"created","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"percent_tumour_cells_measurement_method":{"changeType":"created","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}},"deleted":{}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"age_at_diagnosis":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0,"max":90}}}},"number_lymph_nodes_positive":{"description":{"left":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: NCI CDE ID: 6113694)","right":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: caDSR CDE ID 6113694)"},"meta":{"dependsOn":{"left":null,"right":"primary_diagnosis.lymph_nodes_examined_status"},"notes":{"left":null,"right":"This field is only required if 'lymph_nodes_examined_status' is 'Yes'."}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"]},"range":{"left":null,"right":{"min":0}}}},"number_lymph_nodes_examined":{"description":{"left":"The total number of lymph nodes tested for the presence of cancer. (Reference: NCI CDE ID: 3)","right":"The total number of lymph nodes tested for the presence of cancer. (Reference: caDSR CDE ID 3)"},"meta":{"dependsOn":{"left":null,"right":"primary_diagnosis.lymph_nodes_examined_status"},"notes":{"left":null,"right":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'."}},"restrictions":{}},"clinical_tumour_staging_system":{"meta":{"validationDependency":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"required":{"left":true,"right":null},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"clinical_stage_group":{"description":{"left":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.).","right":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage."},"meta":{"examples":{"left":null,"right":"Stage I, Stage IIB"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.clinical_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'clinical_tumour_staging_system' is set to '${\n $row.clinical_tumour_staging_system\n }', 'clinical_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"clinical_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"clinical_n_category":{"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"clinical_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"presenting_symptoms":{"restrictions":{"codeList":{"left":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Loss of Appetite","Nausea","None","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Unknown","Vomiting","Weight Loss"],"right":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Loss of Appetite","Nausea","None","Not Reported","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Swelling in the Neck","Unknown","Vomiting","Weight Loss"],"data":{"added":["Not Reported","Swelling in the Neck"],"deleted":[]}}}},"performance_status":{"description":{"left":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference source: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status).","right":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status)."},"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}}},"created":{"laterality":{"changeType":"created","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_status":{"changeType":"created","name":"lymph_nodes_examined_status","description":"Indicate if lymph nodes were examined for metastases.","valueType":"string","restrictions":{"required":true,"codeList":["Cannot be determined","No","No lymph nodes found in resected specimen","Not applicable","Yes"]},"meta":{"core":true,"displayName":"Lymph Nodes Examined Status"}},"lymph_nodes_examined_method":{"changeType":"created","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}},"deleted":{}},"treatment":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null},"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":["End of life care"],"deleted":[]}}}},"is_primary_treatment":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Yes","No","Unknown"],"right":["Yes","No"],"data":{"added":[],"deleted":["Unknown"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"line_of_treatment":{"meta":{"dependsOn":{"left":null,"right":"treatment.is_primary_treatment"}},"restrictions":{}},"treatment_start_interval":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_duration":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"days_per_cycle":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{}},"number_of_cycles":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{}},"treatment_intent":{"description":{"left":"Indicate the intended disease outcome for which the treatment is given. (Reference: CDISC [NCIt code: C124307])","right":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)"},"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Curative","Palliative","Unknown"],"right":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"],"data":{"added":["Diagnostic","Forensic","Guidance","Preventative","Screening","Supportive"],"deleted":["Unknown"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_setting":{"description":{"left":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: CDISC [NCIt code: C124308])","right":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: NCIt C124308)"},"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Adjuvant","Advanced/Metastatic","Neoadjuvant","Not applicable"],"right":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"],"data":{"added":["Conditioning","Induction","Maintenance","Mobilization","Preventative","Radiosensitization","Salvage"],"deleted":["Not applicable"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"response_to_treatment":{"description":{"left":"The donor's response to the applied treatment regimen. (Source: RECIST)","right":"The donor's response to the applied treatment regimen."},"meta":{"dependsOn":{"left":null,"right":"treatment.response_to_treatment_criteria_method"},"notes":{"left":null,"right":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Complete response","Disease progression","NED","Partial response","Stable disease"],"right":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"],"data":{"added":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease"],"deleted":["Disease progression","NED"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"]}}},"outcome_of_treatment":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"toxicity_type":{"description":{"left":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hemotological toxicity or non-hemotological toxicity.","right":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity."},"meta":{"dependsOn":{"left":null,"right":"treatment.outcome_of_treatment"}},"restrictions":{"codeList":{"left":["Hemotological","Non-hemotological"],"right":["Hematological","Non-hematological","Not applicable","Unknown"],"data":{"added":["Hematological","Non-hematological","Not applicable","Unknown"],"deleted":["Hemotological","Non-hemotological"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"]}}},"adverse_events":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"codeList":{"left":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"right":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"data":{"added":["None","Unknown"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"clinical_trials_database":{"meta":{"notes":{"left":null,"right":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added."}},"restrictions":{"codeList":{"left":["NCI Clinical Trials","EU Clinical Trials Register"],"right":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"],"data":{"added":["Not applicable","Unknown"],"deleted":[]}}}},"clinical_trial_number":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: 'The submitted NCI clinical trial number is in incorrect format.'};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: \"The submitted EudraCT clinical trial number is in incorrect format.\"};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: \"The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database.\"};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: \"'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.\"};\n } \n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"]}}}},"created":{"response_to_treatment_criteria_method":{"changeType":"created","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},"hematological_toxicity":{"changeType":"created","name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"non-hematological_toxicity":{"changeType":"created","name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"age_at_consent_for_treatment":{"changeType":"deleted","name":"age_at_consent_for_treatment","description":"Indicate the age of donor when consent was given for treatment.","valueType":"integer","meta":{"displayName":"Age At Consent For Treatment"}},"hemotological_toxicity":{"changeType":"deleted","name":"hemotological_toxicity","description":"Indicate the hemotological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5"]},"meta":{"displayName":"Hemotological Toxicity","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"chemotherapy":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"description":{"left":"Name of agent or drug administered to patient as part of the treatment regimen.","right":"Name of agent or drug administered to donor as part of the treatment regimen."},"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"created","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"created","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"created","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"created","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}},"deleted":{"chemotherapy_dosage_units":{"changeType":"deleted","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate the total drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"description":{"left":"Name of agent or drug administered to patient as part of the treatment regimen.","right":"Name of agent or drug administered to donor as part of the treatment regimen."},"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"created","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{"hormone_drug_dosage_units":{"changeType":"deleted","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"radiation":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"radiation_therapy_fractions":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"radiation_therapy_dosage":{"valueType":{"left":"integer","right":"number"},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"anatomical_site_irradiated":{"description":{"left":"Indicate localization site where radiation therapy was administered.","right":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)"},"restrictions":{"codeList":{"left":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"right":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"data":{"added":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"],"deleted":["Bone","Extremities","Head-Neck","Peritoneum"]}}}}},"created":{"radiation_boost":{"changeType":"created","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"created","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}},"deleted":{}},"follow_up":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_follow_up_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null},"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null},"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"treatment.submitter_treatment_id"}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"weight_at_followup":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"relapse_type":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"relapse_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `'${$name}' cannot be greater than the 'interval_of_followup'.` }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"]}}},"method_of_progression_status":{"description":{"left":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Codelist reference: NCI CDE ID: 6161031)","right":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Reference: caDSR CDE ID 6161031)"},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_t_category":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"recurrence_n_category":{"meta":{"core":{"left":true,"right":null}}},"recurrence_m_category":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"recurrence_stage_group":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.recurrence_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.recurrence_tumour_staging_system && $row.recurrence_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'recurrence_tumour_staging_system' is set to '${\n $row.recurrence_tumour_staging_system\n }', 'recurrence_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"posttherapy_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"posttherapy_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"posttherapy_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"posttherapy_stage_group":{"restrictions":{"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.posttherapy_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.posttherapy_tumour_staging_system && $row.posttherapy_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'posttherapy_tumour_staging_system' is set to '${\n $row.posttherapy_tumour_staging_system\n }', 'posttherapy_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}}},"created":{"anatomic_site_progression_or_recurrence":{"changeType":"created","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"anatomic_site_progression_or_recurrences":{"changeType":"deleted","description":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1,C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}}}},"immunotherapy":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"immunotherapy_type":{"changeType":"created","name":"immunotherapy_type","valueType":"string","description":"Indicate the type of immunotherapy administered to donor.","meta":{"displayName":"Immunotherapy Type","core":true},"restrictions":{"required":true,"codeList":["Cell-based","Immune checkpoint inhibitors","Monoclonal antibodies other than immune checkpoint inhibitors","Other immunomodulatory substances"]}},"drug_rxnormcui":{"changeType":"created","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"created","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"created","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{}},"surgery":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"created","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"created","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"created","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"created","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"created","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"created","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"created","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"created","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"created","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"created","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"created","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"created","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"created","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"created","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}},"deleted":{}},"exposure":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"created","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"created","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"created","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"created","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"created","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"created","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"created","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"created","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"created","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"created","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"created","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"created","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"created","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}},"deleted":{}},"family_history":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"family_relative_id":{"changeType":"created","description":"Unique identifier of the relative, assigned by the data provider.","name":"family_relative_id","valueType":"string","meta":{"displayName":"Family Relative ID","primaryId":true,"notes":"This field is required to ensure that family members are identified in unique records. Ids can be as simple as an incremented numeral to ensure uniqueness."},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"relative_with_cancer_history":{"changeType":"created","description":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","name":"relative_with_cancer_history","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Relative with Cancer History"}},"relationship_type":{"changeType":"created","description":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","name":"relationship_type","restrictions":{"codeList":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"]},"valueType":"string","meta":{"displayName":"Relationship Type"}},"gender_of_relative":{"changeType":"created","description":"The self-reported gender of related individual.","name":"gender_of_relative","restrictions":{"codeList":["Female","Male","Other","Unknown"]},"valueType":"string","meta":{"displayName":"Gender of Relative"}},"age_of_relative_at_diagnosis":{"changeType":"created","description":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","name":"age_of_relative_at_diagnosis","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","displayName":"Age Of Relative At Diagnosis"}},"cancer_type_code_of_relative":{"changeType":"created","name":"cancer_type_code_of_relative","valueType":"string","description":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"examples":"C41.1,C16.9,C00.5,D46.9","dependsOn":"family_history.relative_with_cancer_history","displayName":"Cancer Type Code (ICD-10) of Relative"}},"relative_vital_status":{"changeType":"created","description":"Relative's last known state of living or deceased.","name":"relative_vital_status","restrictions":{"codeList":["Alive","Deceased","Unknown"]},"valueType":"string","meta":{"displayName":"Vital Status of Relative"}},"cause_of_death_of_relative":{"changeType":"created","description":"Indicate the cause of the death of the relative.","name":"cause_of_death_of_relative","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]},"valueType":"string","meta":{"dependsOn":"family_history.relative_vital_status","displayName":"Cause of Death of Relative"}},"relative_survival_time":{"changeType":"created","description":"Indicate how long, in days, the relative survived from the time they were diagnosed with cancer.","name":"relative_survival_time","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","units":"days","displayName":"Survival Time Of Relative"}}},"deleted":{}},"biomarker":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"created","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"created","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"created","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"created","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"created","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"created","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"created","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"created","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"created","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"created","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"created","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"created","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"created","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"created","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"created","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"created","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"created","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"created","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"created","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}},"deleted":{}},"comorbidity":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"created","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"created","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"created","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"created","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"created","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"created","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}},"deleted":{}}}} diff --git a/website/static/data/schemas/diffs/1.20/1.20-diff-1.24.json b/website/static/data/schemas/diffs/1.20/1.20-diff-1.24.json new file mode 100644 index 00000000..8c3530cf --- /dev/null +++ b/website/static/data/schemas/diffs/1.20/1.20-diff-1.24.json @@ -0,0 +1 @@ +{"schemas":{"specimen":{"updated":{"specimen_acquisition_interval":{"restrictions":{"range":{"left":{"min":0},"right":null}}},"percent_tumour_cells":{"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"]}}}},"created":{},"deleted":{}},"treatment":{"updated":{"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":["End of life care"],"deleted":[]}}}},"treatment_start_interval":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}}},"created":{},"deleted":{}},"chemotherapy":{"updated":{"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"chemotherapy_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"data":{"added":["mg"],"deleted":[]}}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"deleted":{}},"hormone_therapy":{"updated":{"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"hormone_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"data":{"added":["mg"],"deleted":[]}}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"deleted":{}},"immunotherapy":{"updated":{"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"immunotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"displayName":{"left":"Immunotherapy Drug Name","right":"Chemotherapy Drug Name"},"dependsOn":{"left":null,"right":"immunotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"immunotherapy_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"data":{"added":["mg"],"deleted":[]}}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"deleted":{}},"follow_up":{"updated":{"interval_of_followup":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"relapse_interval":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}}},"created":{},"deleted":{}},"biomarker":{"updated":{"test_interval":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}}},"created":{},"deleted":{}},"radiation":{"updated":{},"created":{"radiation_boost":{"changeType":"created","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"created","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}},"deleted":{}}}} diff --git a/website/static/data/schemas/diffs/1.21/1.21-diff-1.24.json b/website/static/data/schemas/diffs/1.21/1.21-diff-1.24.json new file mode 100644 index 00000000..cfff678d --- /dev/null +++ b/website/static/data/schemas/diffs/1.21/1.21-diff-1.24.json @@ -0,0 +1 @@ +{"schemas":{"specimen":{"updated":{"specimen_acquisition_interval":{"restrictions":{"range":{"left":{"min":0},"right":null}}}},"created":{},"deleted":{}},"treatment":{"updated":{"treatment_start_interval":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}}},"created":{},"deleted":{}},"chemotherapy":{"updated":{"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"chemotherapy_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"data":{"added":["mg"],"deleted":[]}}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"deleted":{}},"hormone_therapy":{"updated":{"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"hormone_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"data":{"added":["mg"],"deleted":[]}}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"deleted":{}},"immunotherapy":{"updated":{"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"immunotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"displayName":{"left":"Immunotherapy Drug Name","right":"Chemotherapy Drug Name"},"dependsOn":{"left":null,"right":"immunotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"immunotherapy_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"data":{"added":["mg"],"deleted":[]}}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"deleted":{}},"follow_up":{"updated":{"interval_of_followup":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"relapse_interval":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}}},"created":{},"deleted":{}},"biomarker":{"updated":{"test_interval":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}}},"created":{},"deleted":{}},"radiation":{"updated":{},"created":{"radiation_boost":{"changeType":"created","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"created","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}},"deleted":{}}}} diff --git a/website/static/data/schemas/diffs/1.22/1.22-diff-1.24.json b/website/static/data/schemas/diffs/1.22/1.22-diff-1.24.json new file mode 100644 index 00000000..0713fa33 --- /dev/null +++ b/website/static/data/schemas/diffs/1.22/1.22-diff-1.24.json @@ -0,0 +1 @@ +{"schemas":{"specimen":{"updated":{"specimen_acquisition_interval":{"restrictions":{"range":{"left":{"min":0},"right":null}}}},"created":{},"deleted":{}},"treatment":{"updated":{"treatment_start_interval":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}}},"created":{},"deleted":{}},"chemotherapy":{"updated":{"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"deleted":{}},"hormone_therapy":{"updated":{"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"deleted":{}},"immunotherapy":{"updated":{"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"immunotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"displayName":{"left":"Immunotherapy Drug Name","right":"Chemotherapy Drug Name"},"dependsOn":{"left":null,"right":"immunotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"deleted":{}},"follow_up":{"updated":{"interval_of_followup":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"relapse_interval":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}}},"created":{},"deleted":{}},"biomarker":{"updated":{"test_interval":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}}},"created":{},"deleted":{}},"radiation":{"updated":{},"created":{"radiation_boost":{"changeType":"created","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"created","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}},"deleted":{}}}} diff --git a/website/static/data/schemas/diffs/1.23/1.23-diff-1.24.json b/website/static/data/schemas/diffs/1.23/1.23-diff-1.24.json new file mode 100644 index 00000000..b3d6942a --- /dev/null +++ b/website/static/data/schemas/diffs/1.23/1.23-diff-1.24.json @@ -0,0 +1 @@ +{"schemas":{"treatment":{"updated":{"treatment_start_interval":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}}},"created":{},"deleted":{}},"chemotherapy":{"updated":{"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"deleted":{}},"hormone_therapy":{"updated":{"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"deleted":{}},"immunotherapy":{"updated":{"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"immunotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"displayName":{"left":"Immunotherapy Drug Name","right":"Chemotherapy Drug Name"},"dependsOn":{"left":null,"right":"immunotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"deleted":{}},"follow_up":{"updated":{"interval_of_followup":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"relapse_interval":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}}},"created":{},"deleted":{}},"biomarker":{"updated":{"test_interval":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}}},"created":{},"deleted":{}}}} diff --git a/website/static/data/schemas/diffs/1.24/1.24-diff-0.10.json b/website/static/data/schemas/diffs/1.24/1.24-diff-0.10.json new file mode 100644 index 00000000..a3630428 --- /dev/null +++ b/website/static/data/schemas/diffs/1.24/1.24-diff-0.10.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"program_id":{"meta":{"examples":{"left":"TEST-CA","right":"PACA-AU,BR-CA"},"notes":{"left":"This is the unique id that is assigned to your program. If you have logged into the platform, this is the Program Id that you see in the Program Services area. For example, TEST-CA is a Program ID.","right":"This is the unique id that is assigned to your program. If you have logged into the platform, this is the Program Id that you see in the Submiission area."}}},"gender":{},"specimen_tissue_source":{},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Normal","Normal - tissue adjacent to primary tumour","Primary tumour","Primary tumour - adjacent to normal","Primary tumour - additional new primary","Recurrent tumour","Metastatic tumour","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour - additional metastatic","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line","Cell line - derived from xenograft tumour","Cell line - derived from tumour","Cell line - derived from normal"],"data":{"added":[],"deleted":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n\n const row = $row;\n let result = {valid: true, message: \"Ok\"};\n \n const designation = row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\"){\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when tumour_normal_designation is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when tumour_normal_designation is set to Tumour.\"};\n }\n }\n return result;\n })()"]}}},"sample_type":{}},"created":{},"deleted":{}},"donor":{"updated":{"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased"],"right":["Alive","Deceased","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"cause_of_death":{"restrictions":{"codeList":{"left":["Died of cancer","Died of other reasons","Unknown"],"right":["Died of cancer","Died of other reasons"],"data":{"added":[],"deleted":["Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })()"]}}},"survival_time":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })()"]},"range":{"left":{"exclusiveMin":0},"right":null}}},"height":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"weight":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"bmi":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"menopause_status":{"description":{"left":"Indicate the donor's menopause status at the time of primary diagnosis. (Reference: caDSR CDE ID 2434914)","right":"Indicate the donor's menopause status at the time of primary diagnosis. (Codelist reference: NCI CDE ID: 2434914)"},"restrictions":{"codeList":{"left":["Not applicable","Perimenopausal","Postmenopausal","Premenopausal","Unknown"],"right":["Premenopausal","Perimenopausal","Postmenopausal","Indeterminate or unknown","Not applicable"],"data":{"added":["Indeterminate or unknown"],"deleted":["Unknown"]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)","right":"Indicate the donor's age of menarche, the first occurrence of menstruation."},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"number_of_pregnancies":{"description":{"left":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)","right":"Indicate the number of pregnancies a donor has had."},"restrictions":{"range":{"left":{"min":0},"right":null}}},"number_of_children":{"description":{"left":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)","right":"Indicate the number of children the donor has birthed."},"restrictions":{"range":{"left":{"min":0},"right":null}}}},"created":{"prior_malignancy":{"changeType":"created","description":"Prior malignancy affecting donor.","name":"prior_malignancy","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"cancer_type_prior_malignancy":{"changeType":"created","description":"ICD-10 diagnostic code for type of cancer in a prior malignancy.","name":"cancer_type_prior_malignancy","restrictions":{"regex":"[A-Z]{1}[0-9]{2}.[0-9]{0,3}[A-Z]{0,1}$"},"valueType":"string","meta":{"displayName":"Cancer Type Prior Malignancy"}},"age_at_prior_malignancy":{"changeType":"created","description":"If donor has history of prior malignancy, indicate age at previous diagnosis, in years.","name":"age_at_prior_malignancy","valueType":"integer"},"laterality_of_prior_malignancy":{"changeType":"created","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis.","name":"laterality_of_prior_malignancy","valueType":"string","meta":{"displayName":"Age at Prior Malignancy"}}},"deleted":{"primary_site":{"changeType":"deleted","name":"primary_site","valueType":"string","isArray":true,"description":"The text term used to describe the primary site of disease, as categorized by the World Health Organization's (WHO) International Classification of Diseases for Oncology (ICD-O). This categorization groups cases into general categories.","meta":{"displayName":"Primary Site","core":true,"notes":"To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Breast|Ovary"},"restrictions":{"required":true,"codeList":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"]}},"genetic_disorders":{"changeType":"deleted","description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},"hrt_type":{"changeType":"deleted","description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},"hrt_duration":{"changeType":"deleted","description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},"contraception_type":{"changeType":"deleted","description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},"contraception_duration":{"changeType":"deleted","description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},"lost_to_followup_after_clinical_event_id":{"changeType":"deleted","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}}},"specimen":{"updated":{"pathological_tumour_staging_system":{"meta":{"validationDependency":{"left":true,"right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(\n field =>\n Object.keys(convertedRow).includes(field) &&\n (!convertedRow[field] || checkforEmpty(convertedRow[field])),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"data":{"added":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"deleted":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"]}}}},"pathological_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":null,"data":{"added":[],"deleted":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"]}}}},"pathological_n_category":{"restrictions":{"codeList":{"left":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"],"right":null,"data":{"added":[],"deleted":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"]}}}},"pathological_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":null,"data":{"added":[],"deleted":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"]}}}},"pathological_stage_group":{"description":{"left":"Specify the tumour stage, based on pathological_tumour_staging_system, used to assess the cancer at the time the tumour specimen was resected.","right":"Specify the tumour stage, based on tumour_staging_system, used to assess the cancer at the time the tumour specimen was resected."},"meta":{"notes":{"left":"This field depends on the selected pathological_tumour_staging_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","right":"This field depends on the selected pathological staging system, and is only required if the specimen is a tumour."}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":null,"data":{"added":[],"deleted":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":null}}},"specimen_acquisition_interval":{"meta":{"notes":{"left":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":null},"displayName":{"left":"Specimen Acquisition Interval","right":"Specimen Aquisition Interval"}},"restrictions":{"notes":{"left":null,"right":"The associated Primary Diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}}},"tumour_histological_type":{"description":{"left":"The code to represent the histology (morphology) of neoplasms that is usually obtained from a pathology report, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","right":"The code to represent the histology (morphology) of neoplasms that is usually obtained from a pathology report, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Please refer to the guidelines provided in the ICD-O-3 manual at https://apps.who.int/iris/handle/10665/42344."},"meta":{"validationDependency":{"left":true,"right":null}}},"specimen_anatomic_location":{"description":{"left":"Indicate the ICD-O-3 topography code for the anatomic location of a specimen when it was collected. Refer to the guidelines provided in the ICD-O-3 manual at https://apps.who.int/iris/handle/10665/42344.","right":"Anatomic location of a specimen when it was collected."},"meta":{"examples":{"left":"C50.1,C18","right":null}},"restrictions":{"regex":{"left":"^[C][0-9]{2}(.[0-9]{1})?$","right":null},"codeList":{"right":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear, pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal; distal","Esophageal; mid","Esophageal; proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck, NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es), maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"],"data":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear, pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal; distal","Esophageal; mid","Esophageal; proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck, NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es), maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"]}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation, other","Formalin fixed & paraffin embedded","Formalin fixed, buffered","Formalin fixed, unbuffered","Fresh","Other"],"data":{"added":["Cryopreservation, other","Formalin fixed, buffered","Formalin fixed, unbuffered"],"deleted":["Cryopreservation - other","Formalin fixed - buffered","Formalin fixed - unbuffered","Unknown"]}}}},"specimen_storage":{"description":{"left":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured.","right":"Indicate the method of specimen storage for specimens that were not extracted freshly or immediately cultured."},"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"right":["Cut slide","Frozen, -70 freezer","Frozen, liquid nitrogen","Frozen, vapor phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"data":{"added":["Frozen, -70 freezer","Frozen, liquid nitrogen","Frozen, vapor phase"],"deleted":["Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Unknown"]}}}},"tumour_grading_system":{"meta":{"validationDependency":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["FNCLCC grading system","Four-tier grading system","Gleason grade group system","Grading system for GISTs","Grading system for GNETs","ISUP grading system","Nuclear grading system for DCIS","Scarff-Bloom-Richardson grading system","Three-tier grading system","Two-tier grading system","WHO grading system for CNS tumours"],"right":["Default","Gleason","Nottingham","Brain cancer","ISUP","Lymphoid neoplasms"],"data":{"added":["Default","Gleason","Nottingham","Brain cancer","ISUP","Lymphoid neoplasms"],"deleted":["FNCLCC grading system","Four-tier grading system","Gleason grade group system","Grading system for GISTs","Grading system for GNETs","ISUP grading system","Nuclear grading system for DCIS","Scarff-Bloom-Richardson grading system","Three-tier grading system","Two-tier grading system","WHO grading system for CNS tumours"]}}}},"tumour_grade":{"meta":{"notes":{"left":"This field depends on the selected tumour_grading_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Grading Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-grading-classifications","right":"This field depends on the selected tumour grading system, and is only required if the specimen is a tumour."}},"restrictions":{"codeList":{"left":["Low grade","High grade","GX","G1","G2","G3","G4","Low","High","Grade I","Grade II","Grade III","Grade IV","Grade Group 1","Grade Group 2","Grade Group 3","Grade Group 4","Grade Group 5"],"data":["Low grade","High grade","GX","G1","G2","G3","G4","Low","High","Grade I","Grade II","Grade III","Grade IV","Grade Group 1","Grade Group 2","Grade Group 3","Grade Group 4","Grade Group 5"]},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'default':\n codeList = [\n 'gx - cannot be assessed',\n 'g1 well differentiated/low grade',\n 'g2 moderately differentiated/intermediated grade',\n 'g3 poorly differentiated/high grade',\n 'g4 undifferentiated/high grade',\n ];\n break;\n case 'gleason':\n codeList = [\n 'gleason x: gleason score cannot be determined',\n 'gleason 2–6: the tumor tissue is well differentiated',\n 'gleason 7: the tumor tissue is moderately differentiated',\n 'gleason 8–10: the tumor tissue is poorly differentiated or undifferentiated',\n ];\n break;\n case 'nottingham':\n codeList = [\n 'g1 (low grade or well differentiated)',\n 'g2 (intermediate grade or moderately differentiated)',\n 'g3 (high grade or poorly differentiated)',\n ];\n break;\n case 'brain cancer':\n codeList = ['grade i', 'grade ii', 'grade iii', 'grade iv'];\n break;\n case 'isup for renal cell carcinoma':\n codeList = [\n 'grade 1: tumor cell nucleoli invisible or small and basophilic at 400 x magnification',\n 'grade 2: tumor cell nucleoli conspicuous at 400 x magnification but inconspicuous at 100 x magnification',\n 'grade 3: tumor cell nucleoli eosinophilic and clearly visible at 100 x magnification',\n 'grade 4: tumors showing extreme nuclear pleomorphism and/or containing tumor giant cells and/or the presence of any proportion of tumor showing sarcomatoid and/or rhabdoid dedifferentiation',\n ];\n break;\n case 'lymphoid neoplasms':\n codeList = ['low grade or indolent nhl', 'high grade or aggressive nhl'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })()"]}}},"percent_tumour_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)","right":"Indicate a value, in decimals, that represents the percentage of infiltration by tumour cells in a specimen."},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null},"script":{"left":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"],"right":null}}},"percent_proliferating_cells":{"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_inflammatory_tissue":{"description":{"left":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)","right":"Indicate a value, in decimals, that represents local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_stromal_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)","right":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a malignant tumour specimen but are not malignant such as fibroblasts, vascular structures, etc."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_necrosis":{"description":{"left":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)","right":"Indicate a value, in decimals, that represents the percentage of cell death in a malignant tumour specimen."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}}},"created":{"central_pathology_confirmed":{"changeType":"created","name":"central_pathology_confirmed","description":"Indicate whether the histologic description of tissue or cells was confirmed by a pathology review of frozen or formalin fixed slide(s) completed after the diagnostic pathology review of the tumour sample used to extract analyte(s).","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Central Pathology Confirmed"},"restrictions":{"codeList":["Yes","No","Unknown"]}}},"deleted":{"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate the primary diagnosis event in the clinical timeline that this specimen acquisition was related to.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"specimen_laterality":{"changeType":"deleted","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"reference_pathology_confirmed":{"changeType":"deleted","name":"reference_pathology_confirmed","description":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)","valueType":"string","meta":{"validationDependency":true,"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Reference Pathology Confirmed"},"restrictions":{"codeList":["Yes","No","Unknown"]}},"percent_tumour_cells_measurement_method":{"changeType":"deleted","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}}},"primary_diagnosis":{"updated":{"age_at_diagnosis":{"description":{"left":"Age that the donor was first diagnosed with cancer, in years. This should be based on the earliest diagnosis of cancer.","right":"Age that the donor was first diagnosed with cancer, in years."},"restrictions":{"range":{"left":{"exclusiveMin":0,"max":90},"right":null}}},"cancer_type_code":{"meta":{"examples":{"left":"C41.1,C16.9,C00.5,D46.9","right":"C41.1,C16.9,C00.543A"}},"restrictions":{"regex":{"left":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","right":"^[C][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"}}},"basis_of_diagnosis":{},"number_lymph_nodes_examined":{"description":{"left":"The total number of lymph nodes tested for the presence of cancer. (Reference: caDSR CDE ID 3)","right":"The total number of lymph nodes tested for the presence of cancer. (Reference: NCI CDE ID: 3)"},"meta":{"dependsOn":{"left":"primary_diagnosis.lymph_nodes_examined_status","right":null},"notes":{"left":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":null},"range":{"left":{"min":0},"right":null}}},"number_lymph_nodes_positive":{"description":{"left":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: caDSR CDE ID 6113694)","right":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: NCI CDE ID: 6113694)"},"meta":{"dependsOn":{"left":"primary_diagnosis.lymph_nodes_examined_status","right":null},"notes":{"left":"This field is only required if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":null},"range":{"left":{"min":0},"right":null},"required":{"left":null,"right":true}}},"clinical_tumour_staging_system":{"meta":{"validationDependency":{"left":true,"right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(\n field =>\n Object.keys(convertedRow).includes(field) &&\n (!convertedRow[field] || checkforEmpty(convertedRow[field])),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"data":{"added":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"deleted":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"]}},"required":{"left":null,"right":true}}},"clinical_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":null,"data":{"added":[],"deleted":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"]}}}},"clinical_n_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"],"right":null,"data":{"added":[],"deleted":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"]}}}},"clinical_m_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned.","right":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned."},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":null,"data":{"added":[],"deleted":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"]}}}},"clinical_stage_group":{"description":{"left":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage.","right":"Stage group of the tumour, as assigned by the reporting tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.)."},"meta":{"notes":{"left":"This field is dependent on the selected clinical_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","right":null},"examples":{"left":"Stage I, Stage IIB","right":null}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"presenting_symptoms":{"meta":{"notes":{"left":"To include multiple values, separate values with a pipe delimiter '|' within your file.","right":null},"examples":{"left":"Anemia|Bloating|Diabetes","right":null}},"restrictions":{"codeList":{"left":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Loss of Appetite","Nausea","None","Not Reported","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Swelling in the Neck","Unknown","Vomiting","Weight Loss"],"right":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Nausea","None","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Unknown","Vomiting","Weight Loss"],"data":{"added":[],"deleted":["Loss of Appetite","Not Reported","Swelling in the Neck"]}}}},"performance_status":{"description":{"left":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status).","right":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference source: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status)."},"meta":{"notes":{"left":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction.\nGrade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work).\nGrade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours.\nGrade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours.\nGrade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair","right":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction \n Grade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work) \n Grade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours \n Grade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours \n Grade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair"}},"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"data":{"added":[],"deleted":["Unknown"]}}}}},"created":{"stage_suffix":{"changeType":"created","name":"stage_suffix","description":"If necessary, use this field to add any applicable stage suffixes. Stage suffixes may apply to certain staging systems such as Ann Arbour staging system where the four stages are divided into 4 categories (A, B, X and E).","valueType":"string","meta":{"core":true,"dependsOn":"primary_diagnosis.clinical_tumour_staging_system","displayName":"Stage Suffix"}}},"deleted":{"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Unique identifier of the primary diagnosis event, assigned by the data provider.","meta":{"primaryId":true,"displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"cancer_type_additional_information":{"changeType":"deleted","name":"cancer_type_additional_information","valueType":"string","description":"Additional details related to the cancer type that are not covered by the ICD-10 code provided in the cancer_type field.","meta":{"displayName":"Cancer Type Additional Information"}},"laterality":{"changeType":"deleted","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_status":{"changeType":"deleted","name":"lymph_nodes_examined_status","description":"Indicate if lymph nodes were examined for metastases.","valueType":"string","restrictions":{"required":true,"codeList":["Cannot be determined","No","No lymph nodes found in resected specimen","Not applicable","Yes"]},"meta":{"core":true,"displayName":"Lymph Nodes Examined Status"}},"lymph_nodes_examined_method":{"changeType":"deleted","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}}},"treatment":{"updated":{"treatment_type":{"meta":{"notes":{"left":"Depending on the treatment_type(s) selected, additional treatment details may be required to be submitted. For example, if treatment_type includes 'Chemotherapy', the supplemental Chemotherapy treatment type file is required.\nTo include multiple values, separate values with a pipe delimiter '|' within your file.","right":"Depending on the treatment_type selected, additional treament details may be required to be submitted."},"examples":{"left":"Chemotherapy|Hormonal therapy","right":null}},"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Chemotherapy","Ablation","Bone marrow transplant","Combined chemo+immunotherapy","Combined chemo+radiation therapy","Combined chemo-radiotherapy and surgery","Endoscopic therapy","Hormonal therapy","Immunotherapy","Monoclonal antibodies (for liquid tumours)","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgical resection"],"data":{"added":["Combined chemo+immunotherapy","Combined chemo+radiation therapy","Combined chemo-radiotherapy and surgery","Monoclonal antibodies (for liquid tumours)","Surgical resection"],"deleted":["End of life care","Surgery"]}}}},"is_primary_treatment":{"description":{"left":"Indicate if the treatment was the primary treatment following the initial diagnosis.","right":"Indicate if the treamtment was the primary treatment following the initial diagnosis."},"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"codeList":{"left":["Yes","No"],"right":["Yes","No","Unknown"],"data":{"added":["Unknown"],"deleted":[]}},"required":{"left":null,"right":true}}},"treatment_start_interval":{"description":{"left":"The interval between the primary diagnosis and initiation of treatment, in days.","right":"The interval between primary diagnosis and initiation of treatment, in days."},"meta":{"notes":{"left":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":"The associated Primary Diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis"},"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"treatment_duration":{"description":{"left":"The duration of treatment regimen, in days.","right":"The duration of treatment regimen, in days"},"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null},"required":{"left":null,"right":true}}}},"created":{"age_at_consent_for_treatment":{"changeType":"created","name":"age_at_consent_for_treatment","description":"Indicate the age of donor when consent was given for treatment.","valueType":"integer","meta":{"displayName":"Age At Consent For Treatment"}},"therapeutic_intent":{"changeType":"created","name":"therapeutic_intent","description":"The therapeutic intent, the reason behind the choice of a therapy, of the treatment.","valueType":"string","restrictions":{"required":true,"codeList":["Adjuvant","Concurrent","Curative","Neoadjuvant","Not applicable","Palliative","Unknown"]},"meta":{"core":true,"displayName":"Therapeutic Intent"}},"response_to_therapy":{"changeType":"created","name":"response_to_therapy","description":"The donors's response to the applied treatment regimen. (Source: RECIST)","valueType":"string","restrictions":{"required":true,"codeList":["Complete response","Disease progression","NED","Partial response","Stable disease"]},"meta":{"core":true,"displayName":"Response to Therapy"}}},"deleted":{"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate the primary diagnosis event in the clinical timeline that this treatment was related to.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"line_of_treatment":{"changeType":"deleted","name":"line_of_treatment","description":"Indicate the line of treatment if it is not the primary treatment.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Line Of treatment","dependsOn":"treatment.is_primary_treatment","examples":"2,3,4"}},"days_per_cycle":{"changeType":"deleted","name":"days_per_cycle","description":"Indicate the number of days in a treatment cycle.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Days Per Cycle","dependsOn":"treatment.treatment_type"}},"number_of_cycles":{"changeType":"deleted","name":"number_of_cycles","description":"Indicate the number of treatment cycles.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Number Of Cycles","dependsOn":"treatment.treatment_type"}},"treatment_intent":{"changeType":"deleted","name":"treatment_intent","description":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"]},"meta":{"core":true,"displayName":"Treatment Intent","dependsOn":"treatment.treatment_type"}},"treatment_setting":{"changeType":"deleted","name":"treatment_setting","description":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: NCIt C124308)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"]},"meta":{"core":true,"displayName":"Treatment Setting","dependsOn":"treatment.treatment_type"}},"response_to_treatment_criteria_method":{"changeType":"deleted","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},"response_to_treatment":{"changeType":"deleted","name":"response_to_treatment","description":"The donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"codeList":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"]},"meta":{"core":true,"displayName":"Response To Treatment","dependsOn":"treatment.response_to_treatment_criteria_method","notes":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"outcome_of_treatment":{"changeType":"deleted","name":"outcome_of_treatment","description":"Indicate the donor's outcome of the prescribed treatment.","valueType":"string","restrictions":{"codeList":["Treatment completed as prescribed","Treatment incomplete due to technical or organizational problems","Treatment incomplete because patient died","Patient choice (stopped or interrupted treatment)","Physician decision (stopped or interrupted treatment)","Treatment stopped due to lack of efficacy (disease progression)","Treatment stopped due to acute toxicity","Other","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Outcome Of Treatment","dependsOn":"treatment.treatment_type"}},"toxicity_type":{"changeType":"deleted","name":"toxicity_type","description":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity.","valueType":"string","restrictions":{"codeList":["Hematological","Non-hematological","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Toxicity Type","dependsOn":"treatment.outcome_of_treatment"}},"hematological_toxicity":{"changeType":"deleted","name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"non-hematological_toxicity":{"changeType":"deleted","name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"adverse_events":{"changeType":"deleted","name":"adverse_events","description":"Report any treatment related adverse events. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Adverse Events","dependsOn":"treatment.treatment_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"clinical_trials_database":{"changeType":"deleted","name":"clinical_trials_database","description":"If the donor is a participant in a clinical trial, indicate the clinical trial database where the clinical trial is registered.","valueType":"string","meta":{"display name":"Clinical Trials Database","notes":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added."},"restrictions":{"codeList":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"]}},"clinical_trial_number":{"changeType":"deleted","name":"clinical_trial_number","description":"Based on the clinical_trial_database, indicate the unique NCT or EudraCT clinical trial identifier of which the donor is a participant.","valueType":"string","meta":{"display name":"Clinical Trial Number","dependsOn":"treatment.clinical_trials_database","examples":"2016-002120-83,NCT02465060"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"]}}}},"chemotherapy":{"updated":{},"created":{"chemotherapy_drug_name":{"changeType":"created","name":"chemotherapy_drug_name","description":"Name of agent or drug administered to patient as part of the chemotherapy treatment regimen.","valueType":"string","restrictions":{"required":true,"codeList":["Placeholder list 1","Need list","Still need it"]},"meta":{"validationDependency":true,"core":true,"notes":"This field uses a controlled vocabulary gathered from the DrugBank database of drug names.","examples":"Allopurinol, Dronabinol, Sucralfate, Lapatinib","displayName":"Chemotherapy Drug Name"}},"chemotherapy_dosage_units":{"changeType":"created","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","µg/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate the total drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"integer","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_rxnormcui":{"changeType":"deleted","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"deleted","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"deleted","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"deleted","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"deleted","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"deleted","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}}},"hormone_therapy":{"updated":{},"created":{"hormone_therapy_drug_name":{"changeType":"created","name":"hormone_therapy_drug_name","description":"Name of agent or drug administered to patient as part of the hormone therapy treatment regimen.","valueType":"string","restrictions":{"required":true,"codeList":["Placeholder list 1","Need list","Still need it"]},"meta":{"validationDependency":true,"core":true,"notes":"This field uses a controlled vocabulary gathered from the DrugBank database of drug names.","displayName":"Hormone Therapy Drug Name"}},"hormone_drug_dosage_units":{"changeType":"created","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","µg/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"integer","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dose"}}},"deleted":{"drug_rxnormcui":{"changeType":"deleted","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"deleted","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Hormone Therapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"deleted","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"radiation":{"updated":{"radiation_therapy_fractions":{"description":{"left":"Indicate the total number of fractions delivered as part of treatment.","right":"Indicate the number of total fractions delivered as part of treatment."},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"radiation_therapy_dosage":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"anatomical_site_irradiated":{"description":{"left":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)","right":"Indicate localization site where radiation therapy was administered."},"restrictions":{"codeList":{"left":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"right":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"data":{"added":["Bone","Extremities","Head-Neck","Peritoneum"],"deleted":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"]}}}}},"created":{"application_form":{"changeType":"created","name":"application_form","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal (including Brachytherapy)"]},"meta":{"core":true,"displayName":"Application Form"}}},"deleted":{"radiation_therapy_type":{"changeType":"deleted","name":"radiation_therapy_type","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal"]},"meta":{"core":true,"displayName":"Type of Radiation Therapy","notes":"Internal application includes Brachytherapy."}},"radiation_boost":{"changeType":"deleted","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"deleted","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}}},"immunotherapy":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"immunotherapy_type":{"changeType":"deleted","name":"immunotherapy_type","valueType":"string","description":"Indicate the type of immunotherapy administered to donor.","meta":{"displayName":"Immunotherapy Type","core":true},"restrictions":{"required":true,"codeList":["Cell-based","Immune checkpoint inhibitors","Monoclonal antibodies other than immune checkpoint inhibitors","Other immunomodulatory substances"]}},"drug_rxnormcui":{"changeType":"deleted","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"deleted","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"deleted","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"surgery":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"deleted","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"deleted","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"deleted","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"deleted","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"deleted","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"deleted","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"deleted","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"deleted","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"deleted","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"deleted","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"deleted","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"deleted","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"deleted","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"deleted","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}}},"follow_up":{"updated":{"submitter_follow_up_id":{"description":{"left":"Unique identifier for a follow-up event in a donor's clinical record, assigned by the data provider.","right":"Unique identifier for a follow-up event in a donors clincal record, assigned by the data provider."}},"interval_of_followup":{"meta":{"notes":{"left":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":"The associated Primary Diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}}},"disease_status_at_followup":{"description":{"left":"Indicate the donor's disease status at time of follow-up. (Reference: RECIST)","right":"Indicate the donor's disease status at time of follow-up."},"restrictions":{"codeList":{"left":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Progression NOS","Relapse or recurrence","Stable"],"right":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Relapse","Stable"],"data":{"added":["Relapse"],"deleted":["Progression NOS","Relapse or recurrence"]}}}},"weight_at_followup":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"relapse_type":{"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.","right":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse."}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":null}}},"relapse_interval":{"description":{"left":"If the donor was clinically disease free following primary treatment and then relapse or recurrence or progression (for liquid tumours) occurred afterwards, then this field will indicate the length of disease free interval, in days.","right":"If the donor was clinically disease free following primary treatment and then relapse or progression (for liquid tumours) occurred afterwards, then this field will indicate the length of disease free interval, in days."},"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.","right":"This field is required to be submitted if disease_status_at_followup indicates a progression or relapse value."}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"]}}},"method_of_progression_status":{"description":{"left":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Reference: caDSR CDE ID 6161031)","right":"Indicate the method(s) used to confirm the donor's progression disease status. (Codelist reference: NCI CDE ID: 6161031)"},"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file.","right":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"]},"codeList":{"left":["Biomarker in liquid biopsy (e.g. tumour marker in blood or urine)","Biopsy","Blood draw","Bone marrow aspirate","Core biopsy","Cystoscopy","Cytology","Debulking","Diagnostic imaging","Dilation and curettage procedure","Enucleation","Excisional biopsy","Fine needle aspiration","Imaging","Incisional biopsy","Laparoscopy","Laparotomy","Other","Pap Smear","Pathologic review","Physical exam","Surgical resection","Thoracentesis","Ultrasound guided biopsy"],"right":["Autopsy","Biomarker in liquid biopsy (e.g. tumour marker in blood or urine)","Biopsy","Blood draw","Bone marrow aspirate","Core biopsy","Cystoscopy","Cytology","Debulking","Diagnostic imaging","Dilation and curettage procedure","Enucleation","Excisional biopsy","Fine needle aspiration","Imaging","Incisional biopsy","Laparoscopy","Laparotomy","Other","Pap Smear","Pathologic review","Physical exam","Surgical resection","Thoracentesis","Ultrasound guided biopsy"],"data":{"added":["Autopsy"],"deleted":[]}}}},"recurrence_tumour_staging_system":{"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.","right":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse."},"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"data":{"added":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"deleted":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(\n field =>\n Object.keys(convertedRow).includes(field) &&\n (!convertedRow[field] || checkforEmpty(convertedRow[field])),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"]}}},"recurrence_t_category":{"description":{"left":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":null,"data":{"added":[],"deleted":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"]}}}},"recurrence_n_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"],"right":null,"data":{"added":[],"deleted":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"]}}}},"recurrence_m_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":null,"data":{"added":[],"deleted":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"]}}}},"recurrence_stage_group":{"description":{"left":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) at the time of retreatment for a recurrence or disease progression.","right":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery."},"meta":{"notes":{"left":"This field is dependent on the selected recurrence_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","right":null},"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":null,"data":{"added":[],"deleted":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":null}}},"posttherapy_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(\n field =>\n Object.keys(convertedRow).includes(field) &&\n (!convertedRow[field] || checkforEmpty(convertedRow[field])),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"data":{"added":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"deleted":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"]}}}},"posttherapy_t_category":{"meta":{"dependsOn":{"left":"follow_up.posttherapy_tumour_staging_system","right":"follow_up.post_therapy_tumour_staging_system"}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":null,"data":{"added":[],"deleted":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"]}}}},"posttherapy_n_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"dependsOn":{"left":"follow_up.posttherapy_tumour_staging_system","right":"follow_up.post_therapy_tumour_staging_system"}},"restrictions":{"codeList":{"left":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"],"right":null,"data":{"added":[],"deleted":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"]}}}},"posttherapy_m_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"dependsOn":{"left":"follow_up.posttherapy_tumour_staging_system","right":"follow_up.post_therapy_tumour_staging_system"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":null,"data":{"added":[],"deleted":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"]}}}},"posttherapy_stage_group":{"meta":{"dependsOn":{"left":"follow_up.posttherapy_tumour_staging_system","right":"follow_up.post_therapy_tumour_staging_system"},"notes":{"left":"This field is dependent on the selected posttherapy_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","right":"This field value is dependent on the selected posttherapy_tumour_staging_system."}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":null,"data":{"added":[],"deleted":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":null}}}},"created":{"anatomic_site_progression_or_recurrences":{"changeType":"created","description":"Indicate the anatomic site where disease progression or recurrence occurred. (Codelist reference: NCI CDE ID: 4742851)","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"],"codeList":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear, pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal; distal","Esophageal; mid","Esophageal; proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck, NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es), maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"]},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","notes":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse.","displayName":"Anatomic Site Progression or Recurrences"}}},"deleted":{"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate if the follow-up is related to a specific primary diagnosis event in the clinical timeline.","meta":{"validationDependency":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID","primaryId":true},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"Indicate if the follow-up is related to a specific treatment event in the clinical timeline.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"anatomic_site_progression_or_recurrence":{"changeType":"deleted","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"exposure":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"deleted","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"deleted","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"deleted","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"deleted","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"deleted","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"deleted","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"deleted","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"deleted","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"deleted","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"deleted","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"deleted","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}}},"family_history":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"family_relative_id":{"changeType":"deleted","description":"Unique identifier of the relative, assigned by the data provider.","name":"family_relative_id","valueType":"string","meta":{"displayName":"Family Relative ID","primaryId":true,"notes":"This field is required to ensure that family members are identified in unique records. Ids can be as simple as an incremented numeral to ensure uniqueness."},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"relative_with_cancer_history":{"changeType":"deleted","description":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","name":"relative_with_cancer_history","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Relative with Cancer History"}},"relationship_type":{"changeType":"deleted","description":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","name":"relationship_type","restrictions":{"codeList":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"]},"valueType":"string","meta":{"displayName":"Relationship Type"}},"gender_of_relative":{"changeType":"deleted","description":"The self-reported gender of related individual.","name":"gender_of_relative","restrictions":{"codeList":["Female","Male","Other","Unknown"]},"valueType":"string","meta":{"displayName":"Gender of Relative"}},"age_of_relative_at_diagnosis":{"changeType":"deleted","description":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","name":"age_of_relative_at_diagnosis","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","displayName":"Age Of Relative At Diagnosis"}},"cancer_type_code_of_relative":{"changeType":"deleted","name":"cancer_type_code_of_relative","valueType":"string","description":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"examples":"C41.1,C16.9,C00.5,D46.9","dependsOn":"family_history.relative_with_cancer_history","displayName":"Cancer Type Code (ICD-10) of Relative"}},"relative_vital_status":{"changeType":"deleted","description":"Relative's last known state of living or deceased.","name":"relative_vital_status","restrictions":{"codeList":["Alive","Deceased","Unknown"]},"valueType":"string","meta":{"displayName":"Vital Status of Relative"}},"cause_of_death_of_relative":{"changeType":"deleted","description":"Indicate the cause of the death of the relative.","name":"cause_of_death_of_relative","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]},"valueType":"string","meta":{"dependsOn":"family_history.relative_vital_status","displayName":"Cause of Death of Relative"}},"relative_survival_time":{"changeType":"deleted","description":"Indicate how long, in days, the relative survived from the time they were diagnosed with cancer.","name":"relative_survival_time","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","units":"days","displayName":"Survival Time Of Relative"}}}},"biomarker":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"deleted","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"deleted","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"deleted","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"deleted","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"deleted","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"deleted","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"deleted","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"deleted","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"deleted","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"deleted","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"deleted","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"deleted","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"deleted","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"deleted","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"deleted","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"deleted","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}}},"comorbidity":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"deleted","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"deleted","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"deleted","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"deleted","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"deleted","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"deleted","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}}}}} diff --git a/website/static/data/schemas/diffs/1.24/1.24-diff-0.11.json b/website/static/data/schemas/diffs/1.24/1.24-diff-0.11.json new file mode 100644 index 00000000..aee1ea0d --- /dev/null +++ b/website/static/data/schemas/diffs/1.24/1.24-diff-0.11.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"program_id":{"meta":{"examples":{"left":"TEST-CA","right":"PACA-AU,BR-CA"},"notes":{"left":"This is the unique id that is assigned to your program. If you have logged into the platform, this is the Program Id that you see in the Program Services area. For example, TEST-CA is a Program ID.","right":"This is the unique id that is assigned to your program. If you have logged into the platform, this is the Program Id that you see in the Submiission area."}}},"gender":{},"specimen_tissue_source":{},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Normal","Normal - tissue adjacent to primary tumour","Primary tumour","Primary tumour - adjacent to normal","Primary tumour - additional new primary","Recurrent tumour","Metastatic tumour","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour - additional metastatic","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line","Cell line - derived from xenograft tumour","Cell line - derived from tumour","Cell line - derived from normal"],"data":{"added":[],"deleted":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n\n const row = $row;\n let result = {valid: true, message: \"Ok\"};\n \n const designation = row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\"){\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when tumour_normal_designation is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when tumour_normal_designation is set to Tumour.\"};\n }\n }\n return result;\n })()"]}}},"sample_type":{}},"created":{},"deleted":{}},"donor":{"updated":{"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased"],"right":["Alive","Deceased","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"cause_of_death":{"restrictions":{"codeList":{"left":["Died of cancer","Died of other reasons","Unknown"],"right":["Died of cancer","Died of other reasons"],"data":{"added":[],"deleted":["Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })()"]}}},"survival_time":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })()"]},"range":{"left":{"exclusiveMin":0},"right":null}}},"primary_site":{"meta":{"notes":{"left":"To include multiple values, separate values with a pipe delimiter '|' within your file.","right":null},"examples":{"left":"Breast|Ovary","right":null}},"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva","Unknown","Not Reported"],"data":{"added":["Unknown","Not Reported"],"deleted":["Unknown primary site"]}}}},"height":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"weight":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"bmi":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"menopause_status":{"description":{"left":"Indicate the donor's menopause status at the time of primary diagnosis. (Reference: caDSR CDE ID 2434914)","right":"Indicate the donor's menopause status at the time of primary diagnosis. (Codelist reference: NCI CDE ID: 2434914)"},"restrictions":{"codeList":{"left":["Not applicable","Perimenopausal","Postmenopausal","Premenopausal","Unknown"],"right":["Indeterminate or unknown","Not applicable","Perimenopausal","Postmenopausal","Premenopausal"],"data":{"added":["Indeterminate or unknown"],"deleted":["Unknown"]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)","right":"Indicate the donor's age of menarche, the first occurrence of menstruation."},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"number_of_pregnancies":{"description":{"left":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)","right":"Indicate the number of pregnancies a donor has had."},"restrictions":{"range":{"left":{"min":0},"right":null}}},"number_of_children":{"description":{"left":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)","right":"Indicate the number of children the donor has birthed."},"restrictions":{"range":{"left":{"min":0},"right":null}}}},"created":{"prior_malignancy":{"changeType":"created","description":"Prior malignancy affecting donor.","name":"prior_malignancy","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"cancer_type_prior_malignancy":{"changeType":"created","description":"The ICD-10 diagnostic code (https://icd.who.int/browse10/2019/en) for the type of cancer in a prior malignancy.","name":"cancer_type_prior_malignancy","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"valueType":"string","meta":{"displayName":"Cancer Type Prior Malignancy"}},"age_at_prior_malignancy":{"changeType":"created","description":"If donor has history of prior malignancy, indicate age at previous diagnosis, in years.","name":"age_at_prior_malignancy","valueType":"integer","meta":{"displayName":"Age at Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"created","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis.","name":"laterality_of_prior_malignancy","valueType":"string","meta":{"displayName":"Laterality at Prior Malignancy"}}},"deleted":{"genetic_disorders":{"changeType":"deleted","description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},"hrt_type":{"changeType":"deleted","description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},"hrt_duration":{"changeType":"deleted","description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},"contraception_type":{"changeType":"deleted","description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},"contraception_duration":{"changeType":"deleted","description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},"lost_to_followup_after_clinical_event_id":{"changeType":"deleted","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}}},"specimen":{"updated":{"pathological_tumour_staging_system":{"meta":{"validationDependency":{"left":true,"right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(\n field =>\n Object.keys(convertedRow).includes(field) &&\n (!convertedRow[field] || checkforEmpty(convertedRow[field])),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"data":{"added":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"deleted":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"]}}}},"pathological_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":null,"data":{"added":[],"deleted":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"]}}}},"pathological_n_category":{"restrictions":{"codeList":{"left":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"],"right":null,"data":{"added":[],"deleted":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"]}}}},"pathological_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":null,"data":{"added":[],"deleted":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"]}}}},"pathological_stage_group":{"description":{"left":"Specify the tumour stage, based on pathological_tumour_staging_system, used to assess the cancer at the time the tumour specimen was resected.","right":"Specify the tumour stage, based on tumour_staging_system, used to assess the cancer at the time the tumour specimen was resected."},"meta":{"notes":{"left":"This field depends on the selected pathological_tumour_staging_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","right":"This field depends on the selected pathological staging system, and is only required if the specimen is a tumour."}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":null,"data":{"added":[],"deleted":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":null}}},"specimen_acquisition_interval":{"meta":{"notes":{"left":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":"The associated Primary Diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."},"displayName":{"left":"Specimen Acquisition Interval","right":"Specimen Aquisition Interval"}}},"tumour_histological_type":{"description":{"left":"The code to represent the histology (morphology) of neoplasms that is usually obtained from a pathology report, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","right":"The code to represent the histology (morphology) of neoplasms that is usually obtained from a pathology report, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Please refer to the guidelines provided in the ICD-O-3 manual at https://apps.who.int/iris/handle/10665/42344."},"meta":{"validationDependency":{"left":true,"right":null}}},"specimen_anatomic_location":{"description":{"left":"Indicate the ICD-O-3 topography code for the anatomic location of a specimen when it was collected. Refer to the guidelines provided in the ICD-O-3 manual at https://apps.who.int/iris/handle/10665/42344.","right":"Anatomic location of a specimen when it was collected."},"meta":{"examples":{"left":"C50.1,C18","right":null}},"restrictions":{"regex":{"left":"^[C][0-9]{2}(.[0-9]{1})?$","right":null},"codeList":{"right":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear - pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal - distal","Esophageal - mid","Esophageal - proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es) - maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"],"data":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear - pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal - distal","Esophageal - mid","Esophageal - proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es) - maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"]}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"data":{"added":[],"deleted":["Unknown"]}}}},"specimen_storage":{"description":{"left":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured.","right":"Indicate the method of specimen storage for specimens that were not extracted freshly or immediately cultured."},"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"data":{"added":[],"deleted":["Unknown"]}}}},"tumour_grading_system":{"meta":{"validationDependency":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["FNCLCC grading system","Four-tier grading system","Gleason grade group system","Grading system for GISTs","Grading system for GNETs","ISUP grading system","Nuclear grading system for DCIS","Scarff-Bloom-Richardson grading system","Three-tier grading system","Two-tier grading system","WHO grading system for CNS tumours"],"right":["Default","Gleason","Nottingham","Brain cancer","ISUP","Lymphoid neoplasms"],"data":{"added":["Default","Gleason","Nottingham","Brain cancer","ISUP","Lymphoid neoplasms"],"deleted":["FNCLCC grading system","Four-tier grading system","Gleason grade group system","Grading system for GISTs","Grading system for GNETs","ISUP grading system","Nuclear grading system for DCIS","Scarff-Bloom-Richardson grading system","Three-tier grading system","Two-tier grading system","WHO grading system for CNS tumours"]}}}},"tumour_grade":{"meta":{"notes":{"left":"This field depends on the selected tumour_grading_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Grading Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-grading-classifications","right":"This field depends on the selected tumour grading system, and is only required if the specimen is a tumour."}},"restrictions":{"codeList":{"left":["Low grade","High grade","GX","G1","G2","G3","G4","Low","High","Grade I","Grade II","Grade III","Grade IV","Grade Group 1","Grade Group 2","Grade Group 3","Grade Group 4","Grade Group 5"],"data":["Low grade","High grade","GX","G1","G2","G3","G4","Low","High","Grade I","Grade II","Grade III","Grade IV","Grade Group 1","Grade Group 2","Grade Group 3","Grade Group 4","Grade Group 5"]},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'default':\n codeList = [\n 'gx - cannot be assessed',\n 'g1 well differentiated/low grade',\n 'g2 moderately differentiated/intermediated grade',\n 'g3 poorly differentiated/high grade',\n 'g4 undifferentiated/high grade',\n ];\n break;\n case 'gleason':\n codeList = [\n 'gleason x: gleason score cannot be determined',\n 'gleason 2–6: the tumor tissue is well differentiated',\n 'gleason 7: the tumor tissue is moderately differentiated',\n 'gleason 8–10: the tumor tissue is poorly differentiated or undifferentiated',\n ];\n break;\n case 'nottingham':\n codeList = [\n 'g1 (low grade or well differentiated)',\n 'g2 (intermediate grade or moderately differentiated)',\n 'g3 (high grade or poorly differentiated)',\n ];\n break;\n case 'brain cancer':\n codeList = ['grade i', 'grade ii', 'grade iii', 'grade iv'];\n break;\n case 'isup for renal cell carcinoma':\n codeList = [\n 'grade 1: tumor cell nucleoli invisible or small and basophilic at 400 x magnification',\n 'grade 2: tumor cell nucleoli conspicuous at 400 x magnification but inconspicuous at 100 x magnification',\n 'grade 3: tumor cell nucleoli eosinophilic and clearly visible at 100 x magnification',\n 'grade 4: tumors showing extreme nuclear pleomorphism and/or containing tumor giant cells and/or the presence of any proportion of tumor showing sarcomatoid and/or rhabdoid dedifferentiation',\n ];\n break;\n case 'lymphoid neoplasms':\n codeList = ['low grade or indolent nhl', 'high grade or aggressive nhl'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })()"]}}},"percent_tumour_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)","right":"Indicate a value, in decimals, that represents the percentage of infiltration by tumour cells in a specimen."},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null},"script":{"left":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"],"right":null}}},"percent_proliferating_cells":{"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_inflammatory_tissue":{"description":{"left":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)","right":"Indicate a value, in decimals, that represents local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_stromal_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)","right":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a malignant tumour specimen but are not malignant such as fibroblasts, vascular structures, etc."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_necrosis":{"description":{"left":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)","right":"Indicate a value, in decimals, that represents the percentage of cell death in a malignant tumour specimen."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}}},"created":{"central_pathology_confirmed":{"changeType":"created","name":"central_pathology_confirmed","description":"Indicate whether the histologic description of tissue or cells was confirmed by a pathology review of frozen or formalin fixed slide(s) completed after the diagnostic pathology review of the tumour sample used to extract analyte(s).","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Central Pathology Confirmed"},"restrictions":{"codeList":["Yes","No","Unknown"]}}},"deleted":{"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate the primary diagnosis event in the clinical timeline that this specimen acquisition was related to.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"specimen_laterality":{"changeType":"deleted","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"reference_pathology_confirmed":{"changeType":"deleted","name":"reference_pathology_confirmed","description":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)","valueType":"string","meta":{"validationDependency":true,"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Reference Pathology Confirmed"},"restrictions":{"codeList":["Yes","No","Unknown"]}},"percent_tumour_cells_measurement_method":{"changeType":"deleted","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}}},"primary_diagnosis":{"updated":{"age_at_diagnosis":{"description":{"left":"Age that the donor was first diagnosed with cancer, in years. This should be based on the earliest diagnosis of cancer.","right":"Age that the donor was first diagnosed with cancer, in years."},"restrictions":{"range":{"left":{"exclusiveMin":0,"max":90},"right":null}}},"basis_of_diagnosis":{},"number_lymph_nodes_examined":{"description":{"left":"The total number of lymph nodes tested for the presence of cancer. (Reference: caDSR CDE ID 3)","right":"The total number of lymph nodes tested for the presence of cancer. (Reference: NCI CDE ID: 3)"},"meta":{"dependsOn":{"left":"primary_diagnosis.lymph_nodes_examined_status","right":null},"notes":{"left":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":null},"range":{"left":{"min":0},"right":null}}},"number_lymph_nodes_positive":{"description":{"left":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: caDSR CDE ID 6113694)","right":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: NCI CDE ID: 6113694)"},"meta":{"dependsOn":{"left":"primary_diagnosis.lymph_nodes_examined_status","right":null},"notes":{"left":"This field is only required if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":null},"range":{"left":{"min":0},"right":null},"required":{"left":null,"right":true}}},"clinical_tumour_staging_system":{"meta":{"validationDependency":{"left":true,"right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(\n field =>\n Object.keys(convertedRow).includes(field) &&\n (!convertedRow[field] || checkforEmpty(convertedRow[field])),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"data":{"added":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"deleted":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"]}},"required":{"left":null,"right":true}}},"clinical_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":null,"data":{"added":[],"deleted":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"]}}}},"clinical_n_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"],"right":null,"data":{"added":[],"deleted":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"]}}}},"clinical_m_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned.","right":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned."},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":null,"data":{"added":[],"deleted":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"]}}}},"clinical_stage_group":{"description":{"left":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage.","right":"Stage group of the tumour, as assigned by the reporting tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.)."},"meta":{"notes":{"left":"This field is dependent on the selected clinical_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","right":null},"examples":{"left":"Stage I, Stage IIB","right":null}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"presenting_symptoms":{"meta":{"notes":{"left":"To include multiple values, separate values with a pipe delimiter '|' within your file.","right":null},"examples":{"left":"Anemia|Bloating|Diabetes","right":null}},"restrictions":{"codeList":{"left":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Loss of Appetite","Nausea","None","Not Reported","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Swelling in the Neck","Unknown","Vomiting","Weight Loss"],"right":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Nausea","None","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Unknown","Vomiting","Weight Loss"],"data":{"added":[],"deleted":["Loss of Appetite","Not Reported","Swelling in the Neck"]}}}},"performance_status":{"description":{"left":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status).","right":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference source: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status)."},"meta":{"notes":{"left":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction.\nGrade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work).\nGrade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours.\nGrade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours.\nGrade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair","right":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction \n Grade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work) \n Grade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours \n Grade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours \n Grade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair"}},"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"data":{"added":[],"deleted":["Unknown"]}}}}},"created":{"stage_suffix":{"changeType":"created","name":"stage_suffix","description":"If necessary, use this field to add any applicable stage suffixes. Stage suffixes may apply to certain staging systems such as Ann Arbour staging system where the four stages are divided into 4 categories (A, B, X and E).","valueType":"string","meta":{"core":true,"dependsOn":"primary_diagnosis.clinical_tumour_staging_system","displayName":"Stage Suffix"}}},"deleted":{"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Unique identifier of the primary diagnosis event, assigned by the data provider.","meta":{"primaryId":true,"displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"cancer_type_additional_information":{"changeType":"deleted","name":"cancer_type_additional_information","valueType":"string","description":"Additional details related to the cancer type that are not covered by the ICD-10 code provided in the cancer_type field.","meta":{"displayName":"Cancer Type Additional Information"}},"laterality":{"changeType":"deleted","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_status":{"changeType":"deleted","name":"lymph_nodes_examined_status","description":"Indicate if lymph nodes were examined for metastases.","valueType":"string","restrictions":{"required":true,"codeList":["Cannot be determined","No","No lymph nodes found in resected specimen","Not applicable","Yes"]},"meta":{"core":true,"displayName":"Lymph Nodes Examined Status"}},"lymph_nodes_examined_method":{"changeType":"deleted","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}}},"treatment":{"updated":{"treatment_type":{"meta":{"notes":{"left":"Depending on the treatment_type(s) selected, additional treatment details may be required to be submitted. For example, if treatment_type includes 'Chemotherapy', the supplemental Chemotherapy treatment type file is required.\nTo include multiple values, separate values with a pipe delimiter '|' within your file.","right":"Depending on the treatment_type selected, additional treament details may be required to be submitted."},"examples":{"left":"Chemotherapy|Hormonal therapy","right":null}},"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Chemotherapy","Ablation","Bone marrow transplant","Combined chemo+immunotherapy","Combined chemo+radiation therapy","Combined chemo-radiotherapy and surgery","Endoscopic therapy","Hormonal therapy","Immunotherapy","Monoclonal antibodies (for liquid tumours)","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgical resection"],"data":{"added":["Combined chemo+immunotherapy","Combined chemo+radiation therapy","Combined chemo-radiotherapy and surgery","Monoclonal antibodies (for liquid tumours)","Surgical resection"],"deleted":["End of life care","Surgery"]}}}},"is_primary_treatment":{"description":{"left":"Indicate if the treatment was the primary treatment following the initial diagnosis.","right":"Indicate if the treamtment was the primary treatment following the initial diagnosis."},"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"codeList":{"left":["Yes","No"],"right":["Yes","No","Unknown"],"data":{"added":["Unknown"],"deleted":[]}},"required":{"left":null,"right":true}}},"treatment_start_interval":{"description":{"left":"The interval between the primary diagnosis and initiation of treatment, in days.","right":"The interval between primary diagnosis and initiation of treatment, in days."},"meta":{"notes":{"left":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":"The associated Primary Diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis"},"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"treatment_duration":{"description":{"left":"The duration of treatment regimen, in days.","right":"The duration of treatment regimen, in days"},"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null},"required":{"left":null,"right":true}}}},"created":{"age_at_consent_for_treatment":{"changeType":"created","name":"age_at_consent_for_treatment","description":"Indicate the age of donor when consent was given for treatment.","valueType":"integer","meta":{"displayName":"Age At Consent For Treatment"}},"therapeutic_intent":{"changeType":"created","name":"therapeutic_intent","description":"The therapeutic intent, the reason behind the choice of a therapy, of the treatment.","valueType":"string","restrictions":{"required":true,"codeList":["Adjuvant","Concurrent","Curative","Neoadjuvant","Not applicable","Palliative","Unknown"]},"meta":{"core":true,"displayName":"Therapeutic Intent"}},"response_to_therapy":{"changeType":"created","name":"response_to_therapy","description":"The donors's response to the applied treatment regimen. (Source: RECIST)","valueType":"string","restrictions":{"required":true,"codeList":["Complete response","Disease progression","NED","Partial response","Stable disease"]},"meta":{"core":true,"displayName":"Response to Therapy"}}},"deleted":{"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate the primary diagnosis event in the clinical timeline that this treatment was related to.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"line_of_treatment":{"changeType":"deleted","name":"line_of_treatment","description":"Indicate the line of treatment if it is not the primary treatment.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Line Of treatment","dependsOn":"treatment.is_primary_treatment","examples":"2,3,4"}},"days_per_cycle":{"changeType":"deleted","name":"days_per_cycle","description":"Indicate the number of days in a treatment cycle.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Days Per Cycle","dependsOn":"treatment.treatment_type"}},"number_of_cycles":{"changeType":"deleted","name":"number_of_cycles","description":"Indicate the number of treatment cycles.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Number Of Cycles","dependsOn":"treatment.treatment_type"}},"treatment_intent":{"changeType":"deleted","name":"treatment_intent","description":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"]},"meta":{"core":true,"displayName":"Treatment Intent","dependsOn":"treatment.treatment_type"}},"treatment_setting":{"changeType":"deleted","name":"treatment_setting","description":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: NCIt C124308)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"]},"meta":{"core":true,"displayName":"Treatment Setting","dependsOn":"treatment.treatment_type"}},"response_to_treatment_criteria_method":{"changeType":"deleted","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},"response_to_treatment":{"changeType":"deleted","name":"response_to_treatment","description":"The donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"codeList":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"]},"meta":{"core":true,"displayName":"Response To Treatment","dependsOn":"treatment.response_to_treatment_criteria_method","notes":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"outcome_of_treatment":{"changeType":"deleted","name":"outcome_of_treatment","description":"Indicate the donor's outcome of the prescribed treatment.","valueType":"string","restrictions":{"codeList":["Treatment completed as prescribed","Treatment incomplete due to technical or organizational problems","Treatment incomplete because patient died","Patient choice (stopped or interrupted treatment)","Physician decision (stopped or interrupted treatment)","Treatment stopped due to lack of efficacy (disease progression)","Treatment stopped due to acute toxicity","Other","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Outcome Of Treatment","dependsOn":"treatment.treatment_type"}},"toxicity_type":{"changeType":"deleted","name":"toxicity_type","description":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity.","valueType":"string","restrictions":{"codeList":["Hematological","Non-hematological","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Toxicity Type","dependsOn":"treatment.outcome_of_treatment"}},"hematological_toxicity":{"changeType":"deleted","name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"non-hematological_toxicity":{"changeType":"deleted","name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"adverse_events":{"changeType":"deleted","name":"adverse_events","description":"Report any treatment related adverse events. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Adverse Events","dependsOn":"treatment.treatment_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"clinical_trials_database":{"changeType":"deleted","name":"clinical_trials_database","description":"If the donor is a participant in a clinical trial, indicate the clinical trial database where the clinical trial is registered.","valueType":"string","meta":{"display name":"Clinical Trials Database","notes":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added."},"restrictions":{"codeList":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"]}},"clinical_trial_number":{"changeType":"deleted","name":"clinical_trial_number","description":"Based on the clinical_trial_database, indicate the unique NCT or EudraCT clinical trial identifier of which the donor is a participant.","valueType":"string","meta":{"display name":"Clinical Trial Number","dependsOn":"treatment.clinical_trials_database","examples":"2016-002120-83,NCT02465060"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"]}}}},"chemotherapy":{"updated":{"drug_rxnormcui":{"meta":{"dependsOn":{"left":"chemotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses a controlled vocabulary gathered from the RxNorm database of drug names provided by the NIH (https://www.nlm.nih.gov/research/umls/rxnorm)."}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"description":{"left":"Name of agent or drug administered to donor as part of the treatment regimen.","right":"Name of agent or drug administered to patient as part of the treatment regimen."},"meta":{"dependsOn":{"left":"chemotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses a controlled vocabulary gathered from the RxNorm database of drug names provided by the NIH (https://www.nlm.nih.gov/research/umls/rxnorm)."}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"chemotherapy_dosage_units":{"changeType":"created","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","µg/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate the total drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"integer","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"deleted","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"deleted","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"deleted","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"deleted","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}}},"hormone_therapy":{"updated":{"drug_rxnormcui":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses a controlled vocabulary gathered from the RxNorm database of drug names provided by the NIH (https://www.nlm.nih.gov/research/umls/rxnorm)."}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"description":{"left":"Name of agent or drug administered to donor as part of the treatment regimen.","right":"Name of agent or drug administered to patient as part of the treatment regimen."},"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses a controlled vocabulary gathered from the RxNorm database of drug names provided by the NIH (https://www.nlm.nih.gov/research/umls/rxnorm)."}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"hormone_drug_dosage_units":{"changeType":"created","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","µg/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"integer","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dose"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"deleted","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"radiation":{"updated":{"radiation_therapy_fractions":{"description":{"left":"Indicate the total number of fractions delivered as part of treatment.","right":"Indicate the number of total fractions delivered as part of treatment."},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"radiation_therapy_dosage":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"anatomical_site_irradiated":{"description":{"left":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)","right":"Indicate localization site where radiation therapy was administered."},"restrictions":{"codeList":{"left":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"right":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"data":{"added":["Bone","Extremities","Head-Neck","Peritoneum"],"deleted":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"]}}}}},"created":{"application_form":{"changeType":"created","name":"application_form","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal (including Brachytherapy)"]},"meta":{"core":true,"displayName":"Application Form"}}},"deleted":{"radiation_therapy_type":{"changeType":"deleted","name":"radiation_therapy_type","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal"]},"meta":{"core":true,"displayName":"Type of Radiation Therapy","notes":"Internal application includes Brachytherapy."}},"radiation_boost":{"changeType":"deleted","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"deleted","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}}},"immunotherapy":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"immunotherapy_type":{"changeType":"deleted","name":"immunotherapy_type","valueType":"string","description":"Indicate the type of immunotherapy administered to donor.","meta":{"displayName":"Immunotherapy Type","core":true},"restrictions":{"required":true,"codeList":["Cell-based","Immune checkpoint inhibitors","Monoclonal antibodies other than immune checkpoint inhibitors","Other immunomodulatory substances"]}},"drug_rxnormcui":{"changeType":"deleted","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"deleted","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"deleted","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"surgery":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"deleted","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"deleted","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"deleted","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"deleted","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"deleted","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"deleted","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"deleted","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"deleted","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"deleted","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"deleted","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"deleted","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"deleted","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"deleted","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"deleted","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}}},"follow_up":{"updated":{"submitter_follow_up_id":{"description":{"left":"Unique identifier for a follow-up event in a donor's clinical record, assigned by the data provider.","right":"Unique identifier for a follow-up event in a donors clincal record, assigned by the data provider."}},"interval_of_followup":{"meta":{"notes":{"left":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":"The associated Primary Diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}}},"disease_status_at_followup":{"description":{"left":"Indicate the donor's disease status at time of follow-up. (Reference: RECIST)","right":"Indicate the donor's disease status at time of follow-up."},"restrictions":{"codeList":{"left":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Progression NOS","Relapse or recurrence","Stable"],"right":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Relapse","Stable"],"data":{"added":["Relapse"],"deleted":["Progression NOS","Relapse or recurrence"]}}}},"weight_at_followup":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"relapse_type":{"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.","right":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse."}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":null}}},"relapse_interval":{"description":{"left":"If the donor was clinically disease free following primary treatment and then relapse or recurrence or progression (for liquid tumours) occurred afterwards, then this field will indicate the length of disease free interval, in days.","right":"If the donor was clinically disease free following primary treatment and then relapse or progression (for liquid tumours) occurred afterwards, then this field will indicate the length of disease free interval, in days."},"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.","right":"This field is required to be submitted if disease_status_at_followup indicates a progression or relapse value."}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"]}}},"method_of_progression_status":{"description":{"left":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Reference: caDSR CDE ID 6161031)","right":"Indicate the method(s) used to confirm the donor's progression disease status. (Codelist reference: NCI CDE ID: 6161031)"},"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file.","right":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"]},"codeList":{"left":["Biomarker in liquid biopsy (e.g. tumour marker in blood or urine)","Biopsy","Blood draw","Bone marrow aspirate","Core biopsy","Cystoscopy","Cytology","Debulking","Diagnostic imaging","Dilation and curettage procedure","Enucleation","Excisional biopsy","Fine needle aspiration","Imaging","Incisional biopsy","Laparoscopy","Laparotomy","Other","Pap Smear","Pathologic review","Physical exam","Surgical resection","Thoracentesis","Ultrasound guided biopsy"],"right":["Autopsy","Biomarker in liquid biopsy (e.g. tumour marker in blood or urine)","Biopsy","Blood draw","Bone marrow aspirate","Core biopsy","Cystoscopy","Cytology","Debulking","Diagnostic imaging","Dilation and curettage procedure","Enucleation","Excisional biopsy","Fine needle aspiration","Imaging","Incisional biopsy","Laparoscopy","Laparotomy","Other","Pap Smear","Pathologic review","Physical exam","Surgical resection","Thoracentesis","Ultrasound guided biopsy"],"data":{"added":["Autopsy"],"deleted":[]}}}},"recurrence_tumour_staging_system":{"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.","right":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse."},"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"data":{"added":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"deleted":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(\n field =>\n Object.keys(convertedRow).includes(field) &&\n (!convertedRow[field] || checkforEmpty(convertedRow[field])),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"]}}},"recurrence_t_category":{"description":{"left":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":null,"data":{"added":[],"deleted":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"]}}}},"recurrence_n_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"],"right":null,"data":{"added":[],"deleted":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"]}}}},"recurrence_m_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":null,"data":{"added":[],"deleted":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"]}}}},"recurrence_stage_group":{"description":{"left":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) at the time of retreatment for a recurrence or disease progression.","right":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery."},"meta":{"notes":{"left":"This field is dependent on the selected recurrence_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","right":null},"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":null,"data":{"added":[],"deleted":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":null}}},"posttherapy_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(\n field =>\n Object.keys(convertedRow).includes(field) &&\n (!convertedRow[field] || checkforEmpty(convertedRow[field])),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"data":{"added":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"deleted":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"]}}}},"posttherapy_t_category":{"meta":{"dependsOn":{"left":"follow_up.posttherapy_tumour_staging_system","right":"follow_up.post_therapy_tumour_staging_system"}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":null,"data":{"added":[],"deleted":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"]}}}},"posttherapy_n_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"dependsOn":{"left":"follow_up.posttherapy_tumour_staging_system","right":"follow_up.post_therapy_tumour_staging_system"}},"restrictions":{"codeList":{"left":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"],"right":null,"data":{"added":[],"deleted":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"]}}}},"posttherapy_m_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"dependsOn":{"left":"follow_up.posttherapy_tumour_staging_system","right":"follow_up.post_therapy_tumour_staging_system"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":null,"data":{"added":[],"deleted":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"]}}}},"posttherapy_stage_group":{"meta":{"dependsOn":{"left":"follow_up.posttherapy_tumour_staging_system","right":"follow_up.post_therapy_tumour_staging_system"},"notes":{"left":"This field is dependent on the selected posttherapy_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","right":"This field value is dependent on the selected posttherapy_tumour_staging_system."}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":null,"data":{"added":[],"deleted":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":null}}}},"created":{"anatomic_site_progression_or_recurrences":{"changeType":"created","description":"Indicate the anatomic site where disease progression or recurrence occurred. (Codelist reference: NCI CDE ID: 4742851)","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"],"codeList":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear - pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal - distal","Esophageal - mid","Esophageal - proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es) - maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"]},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","notes":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse.","displayName":"Anatomic Site Progression or Recurrences"}}},"deleted":{"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate if the follow-up is related to a specific primary diagnosis event in the clinical timeline.","meta":{"validationDependency":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID","primaryId":true},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"Indicate if the follow-up is related to a specific treatment event in the clinical timeline.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"anatomic_site_progression_or_recurrence":{"changeType":"deleted","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"exposure":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"deleted","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"deleted","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"deleted","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"deleted","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"deleted","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"deleted","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"deleted","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"deleted","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"deleted","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"deleted","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"deleted","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}}},"family_history":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"family_relative_id":{"changeType":"deleted","description":"Unique identifier of the relative, assigned by the data provider.","name":"family_relative_id","valueType":"string","meta":{"displayName":"Family Relative ID","primaryId":true,"notes":"This field is required to ensure that family members are identified in unique records. Ids can be as simple as an incremented numeral to ensure uniqueness."},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"relative_with_cancer_history":{"changeType":"deleted","description":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","name":"relative_with_cancer_history","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Relative with Cancer History"}},"relationship_type":{"changeType":"deleted","description":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","name":"relationship_type","restrictions":{"codeList":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"]},"valueType":"string","meta":{"displayName":"Relationship Type"}},"gender_of_relative":{"changeType":"deleted","description":"The self-reported gender of related individual.","name":"gender_of_relative","restrictions":{"codeList":["Female","Male","Other","Unknown"]},"valueType":"string","meta":{"displayName":"Gender of Relative"}},"age_of_relative_at_diagnosis":{"changeType":"deleted","description":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","name":"age_of_relative_at_diagnosis","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","displayName":"Age Of Relative At Diagnosis"}},"cancer_type_code_of_relative":{"changeType":"deleted","name":"cancer_type_code_of_relative","valueType":"string","description":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"examples":"C41.1,C16.9,C00.5,D46.9","dependsOn":"family_history.relative_with_cancer_history","displayName":"Cancer Type Code (ICD-10) of Relative"}},"relative_vital_status":{"changeType":"deleted","description":"Relative's last known state of living or deceased.","name":"relative_vital_status","restrictions":{"codeList":["Alive","Deceased","Unknown"]},"valueType":"string","meta":{"displayName":"Vital Status of Relative"}},"cause_of_death_of_relative":{"changeType":"deleted","description":"Indicate the cause of the death of the relative.","name":"cause_of_death_of_relative","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]},"valueType":"string","meta":{"dependsOn":"family_history.relative_vital_status","displayName":"Cause of Death of Relative"}},"relative_survival_time":{"changeType":"deleted","description":"Indicate how long, in days, the relative survived from the time they were diagnosed with cancer.","name":"relative_survival_time","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","units":"days","displayName":"Survival Time Of Relative"}}}},"biomarker":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"deleted","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"deleted","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"deleted","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"deleted","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"deleted","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"deleted","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"deleted","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"deleted","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"deleted","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"deleted","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"deleted","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"deleted","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"deleted","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"deleted","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"deleted","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"deleted","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}}},"comorbidity":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"deleted","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"deleted","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"deleted","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"deleted","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"deleted","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"deleted","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}}}}} diff --git a/website/static/data/schemas/diffs/1.24/1.24-diff-0.12.json b/website/static/data/schemas/diffs/1.24/1.24-diff-0.12.json new file mode 100644 index 00000000..38d60143 --- /dev/null +++ b/website/static/data/schemas/diffs/1.24/1.24-diff-0.12.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"program_id":{"meta":{"examples":{"left":"TEST-CA","right":"PACA-AU,BR-CA"},"notes":{"left":"This is the unique id that is assigned to your program. If you have logged into the platform, this is the Program Id that you see in the Program Services area. For example, TEST-CA is a Program ID.","right":"This is the unique id that is assigned to your program. If you have logged into the platform, this is the Program Id that you see in the Submission area. For example, PACA-CA is a Program ID."}}},"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"gender":{},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"specimen_tissue_source":{},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Normal","Normal - tissue adjacent to primary tumour","Primary tumour","Primary tumour - adjacent to normal","Primary tumour - additional new primary","Recurrent tumour","Metastatic tumour","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour - additional metastatic","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line","Cell line - derived from xenograft tumour","Cell line - derived from tumour","Cell line - derived from normal"],"data":{"added":[],"deleted":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n\n const row = $row;\n let result = {valid: true, message: \"Ok\"};\n \n const designation = row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\"){\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when tumour_normal_designation is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when tumour_normal_designation is set to Tumour.\"};\n }\n }\n return result;\n })()"]}}},"submitter_sample_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"sample_type":{}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased"],"right":["Alive","Deceased","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"cause_of_death":{"restrictions":{"codeList":{"left":["Died of cancer","Died of other reasons","Unknown"],"right":["Died of cancer","Died of other reasons"],"data":{"added":[],"deleted":["Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })()"]}}},"survival_time":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })()"]},"range":{"left":{"exclusiveMin":0},"right":null}}},"primary_site":{"meta":{"notes":{"left":"To include multiple values, separate values with a pipe delimiter '|' within your file.","right":null},"examples":{"left":"Breast|Ovary","right":null}},"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva","Unknown","Not Reported"],"data":{"added":["Unknown","Not Reported"],"deleted":["Unknown primary site"]}}}},"height":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"weight":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"bmi":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"menopause_status":{"description":{"left":"Indicate the donor's menopause status at the time of primary diagnosis. (Reference: caDSR CDE ID 2434914)","right":"Indicate the donor's menopause status at the time of primary diagnosis. (Codelist reference: NCI CDE ID: 2434914)"},"restrictions":{"codeList":{"left":["Not applicable","Perimenopausal","Postmenopausal","Premenopausal","Unknown"],"right":["Indeterminate or unknown","Not applicable","Perimenopausal","Postmenopausal","Premenopausal"],"data":{"added":["Indeterminate or unknown"],"deleted":["Unknown"]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)","right":"Indicate the donor's age of menarche, the first occurrence of menstruation."},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"number_of_pregnancies":{"description":{"left":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)","right":"Indicate the number of pregnancies a donor has had."},"restrictions":{"range":{"left":{"min":0},"right":null}}},"number_of_children":{"description":{"left":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)","right":"Indicate the number of children the donor has birthed."},"restrictions":{"range":{"left":{"min":0},"right":null}}}},"created":{"prior_malignancy":{"changeType":"created","description":"Prior malignancy affecting donor.","name":"prior_malignancy","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy","examples":"C41.1, C16.9, C00.5, D46.9"}},"cancer_type_prior_malignancy":{"changeType":"created","description":"The code to represent the cancer type of a prior malignancy using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","name":"cancer_type_prior_malignancy","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"valueType":"string","meta":{"displayName":"Cancer Type Prior Malignancy"}},"age_at_prior_malignancy":{"changeType":"created","description":"If donor has history of prior malignancy, indicate age at previous diagnosis, in years.","name":"age_at_prior_malignancy","valueType":"integer","meta":{"displayName":"Age at Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"created","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis.","name":"laterality_of_prior_malignancy","valueType":"string","meta":{"displayName":"Laterality at Prior Malignancy"}}},"deleted":{"genetic_disorders":{"changeType":"deleted","description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},"hrt_type":{"changeType":"deleted","description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},"hrt_duration":{"changeType":"deleted","description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},"contraception_type":{"changeType":"deleted","description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},"contraception_duration":{"changeType":"deleted","description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},"lost_to_followup_after_clinical_event_id":{"changeType":"deleted","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}}},"specimen":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"description":{"left":"Indicate the primary diagnosis event in the clinical timeline that this specimen acquisition was related to.","right":"Indicate the primary diagnosis event in the clinical timeline that this specimen aquisition was related to."},"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"pathological_tumour_staging_system":{"meta":{"validationDependency":{"left":true,"right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"data":{"added":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"deleted":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"]}}}},"pathological_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":null,"data":{"added":[],"deleted":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"]}}}},"pathological_n_category":{"restrictions":{"codeList":{"left":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"],"right":null,"data":{"added":[],"deleted":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"]}}}},"pathological_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":null,"data":{"added":[],"deleted":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"]}}}},"pathological_stage_group":{"description":{"left":"Specify the tumour stage, based on pathological_tumour_staging_system, used to assess the cancer at the time the tumour specimen was resected.","right":"Specify the tumour stage, based on tumour_staging_system, used to assess the cancer at the time the tumour specimen was resected."},"meta":{"notes":{"left":"This field depends on the selected pathological_tumour_staging_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","right":"This field depends on the selected pathological staging system, and is only required if the specimen is a tumour."}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":null,"data":{"added":[],"deleted":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":null}}},"specimen_acquisition_interval":{"meta":{"notes":{"left":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":"The associated Primary Diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."},"displayName":{"left":"Specimen Acquisition Interval","right":"Specimen Aquisition Interval"}}},"tumour_histological_type":{"description":{"left":"The code to represent the histology (morphology) of neoplasms that is usually obtained from a pathology report, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","right":"The code to represent the histology (morphology) of neoplasms that is usually obtained from a pathology report, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Please refer to the guidelines provided in the ICD-O-3 manual at https://apps.who.int/iris/handle/10665/42344."},"meta":{"validationDependency":{"left":true,"right":null}}},"specimen_anatomic_location":{"description":{"left":"Indicate the ICD-O-3 topography code for the anatomic location of a specimen when it was collected. Refer to the guidelines provided in the ICD-O-3 manual at https://apps.who.int/iris/handle/10665/42344.","right":"Anatomic location of a specimen when it was collected."},"meta":{"examples":{"left":"C50.1,C18","right":null}},"restrictions":{"regex":{"left":"^[C][0-9]{2}(.[0-9]{1})?$","right":null},"codeList":{"right":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear - pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal - distal","Esophageal - mid","Esophageal - proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es) - maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"],"data":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear - pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal - distal","Esophageal - mid","Esophageal - proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es) - maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"]}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"data":{"added":[],"deleted":["Unknown"]}}}},"specimen_storage":{"description":{"left":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured.","right":"Indicate the method of specimen storage for specimens that were not extracted freshly or immediately cultured."},"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"data":{"added":[],"deleted":["Unknown"]}}}},"tumour_grading_system":{"meta":{"validationDependency":{"left":true,"right":null}}},"tumour_grade":{"meta":{"notes":{"left":"This field depends on the selected tumour_grading_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Grading Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-grading-classifications","right":"This field depends on the selected tumour grading system, and is only required if the specimen is a tumour."}},"restrictions":{"codeList":{"left":["Low grade","High grade","GX","G1","G2","G3","G4","Low","High","Grade I","Grade II","Grade III","Grade IV","Grade Group 1","Grade Group 2","Grade Group 3","Grade Group 4","Grade Group 5"],"right":["Low grade","High grade","GX","G1","G2","G3","G4","Low","High","I","II","III","IV","1","2","3","4","5"],"data":{"added":["I","II","III","IV","1","2","3","4","5"],"deleted":["Grade I","Grade II","Grade III","Grade IV","Grade Group 1","Grade Group 2","Grade Group 3","Grade Group 4","Grade Group 5"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'i',\n 'ii',\n 'iii',\n 'iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n '1',\n '2',\n '3',\n '4',\n '5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })()"]}}},"percent_tumour_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)","right":"Indicate a value, in decimals, that represents the percentage of infiltration by tumour cells in a specimen."},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null},"script":{"left":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"],"right":null}}},"percent_proliferating_cells":{"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_inflammatory_tissue":{"description":{"left":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)","right":"Indicate a value, in decimals, that represents local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_stromal_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)","right":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a malignant tumour specimen but are not malignant such as fibroblasts, vascular structures, etc."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_necrosis":{"description":{"left":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)","right":"Indicate a value, in decimals, that represents the percentage of cell death in a malignant tumour specimen."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}}},"created":{"central_pathology_confirmed":{"changeType":"created","name":"central_pathology_confirmed","description":"Indicate whether the histologic description of tissue or cells was confirmed by a pathology review of frozen or formalin fixed slide(s) completed after the diagnostic pathology review of the tumour sample used to extract analyte(s).","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Central Pathology Confirmed"},"restrictions":{"codeList":["Yes","No","Unknown"]}}},"deleted":{"specimen_laterality":{"changeType":"deleted","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"reference_pathology_confirmed":{"changeType":"deleted","name":"reference_pathology_confirmed","description":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)","valueType":"string","meta":{"validationDependency":true,"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Reference Pathology Confirmed"},"restrictions":{"codeList":["Yes","No","Unknown"]}},"percent_tumour_cells_measurement_method":{"changeType":"deleted","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"age_at_diagnosis":{"description":{"left":"Age that the donor was first diagnosed with cancer, in years. This should be based on the earliest diagnosis of cancer.","right":"Age that the donor was first diagnosed with cancer, in years."},"restrictions":{"range":{"left":{"exclusiveMin":0,"max":90},"right":null}}},"basis_of_diagnosis":{},"number_lymph_nodes_examined":{"description":{"left":"The total number of lymph nodes tested for the presence of cancer. (Reference: caDSR CDE ID 3)","right":"The total number of lymph nodes tested for the presence of cancer. (Reference: NCI CDE ID: 3)"},"meta":{"dependsOn":{"left":"primary_diagnosis.lymph_nodes_examined_status","right":null},"notes":{"left":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":null},"range":{"left":{"min":0},"right":null}}},"number_lymph_nodes_positive":{"description":{"left":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: caDSR CDE ID 6113694)","right":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: NCI CDE ID: 6113694)"},"meta":{"dependsOn":{"left":"primary_diagnosis.lymph_nodes_examined_status","right":null},"notes":{"left":"This field is only required if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":null},"range":{"left":{"min":0},"right":null},"required":{"left":null,"right":true}}},"clinical_tumour_staging_system":{"meta":{"validationDependency":{"left":true,"right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"data":{"added":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"deleted":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"]}},"required":{"left":null,"right":true}}},"clinical_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":null,"data":{"added":[],"deleted":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"]}}}},"clinical_n_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"],"right":null,"data":{"added":[],"deleted":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"]}}}},"clinical_m_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned.","right":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned."},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":null,"data":{"added":[],"deleted":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"]}}}},"clinical_stage_group":{"description":{"left":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage.","right":"Stage group of the tumour, as assigned by the reporting tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.)."},"meta":{"notes":{"left":"This field is dependent on the selected clinical_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","right":null},"examples":{"left":"Stage I, Stage IIB","right":null}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"presenting_symptoms":{"meta":{"notes":{"left":"To include multiple values, separate values with a pipe delimiter '|' within your file.","right":"To include multiple values, separate values with a comma ',' within your file."},"examples":{"left":"Anemia|Bloating|Diabetes","right":"Anemia,Bloating,Diabetes"}},"restrictions":{"codeList":{"left":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Loss of Appetite","Nausea","None","Not Reported","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Swelling in the Neck","Unknown","Vomiting","Weight Loss"],"right":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Nausea","None","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Unknown","Vomiting","Weight Loss"],"data":{"added":[],"deleted":["Loss of Appetite","Not Reported","Swelling in the Neck"]}}}},"performance_status":{"description":{"left":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status).","right":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference source: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status)."},"meta":{"notes":{"left":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction.\nGrade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work).\nGrade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours.\nGrade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours.\nGrade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair","right":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction \n Grade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work) \n Grade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours \n Grade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours \n Grade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair"}},"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"data":{"added":[],"deleted":["Unknown"]}}}}},"created":{"stage_suffix":{"changeType":"created","name":"stage_suffix","description":"If necessary, use this field to add any applicable stage suffixes. Stage suffixes may apply to certain staging systems such as Ann Arbour staging system where the four stages are divided into 4 categories (A, B, X and E).","valueType":"string","meta":{"core":true,"dependsOn":"primary_diagnosis.clinical_tumour_staging_system","displayName":"Stage Suffix"}}},"deleted":{"cancer_type_additional_information":{"changeType":"deleted","name":"cancer_type_additional_information","valueType":"string","description":"Additional details related to the cancer type that are not covered by the ICD-10 code provided in the cancer_type field.","meta":{"displayName":"Cancer Type Additional Information"}},"laterality":{"changeType":"deleted","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_status":{"changeType":"deleted","name":"lymph_nodes_examined_status","description":"Indicate if lymph nodes were examined for metastases.","valueType":"string","restrictions":{"required":true,"codeList":["Cannot be determined","No","No lymph nodes found in resected specimen","Not applicable","Yes"]},"meta":{"core":true,"displayName":"Lymph Nodes Examined Status"}},"lymph_nodes_examined_method":{"changeType":"deleted","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}}},"treatment":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"treatment_type":{"meta":{"notes":{"left":"Depending on the treatment_type(s) selected, additional treatment details may be required to be submitted. For example, if treatment_type includes 'Chemotherapy', the supplemental Chemotherapy treatment type file is required.\nTo include multiple values, separate values with a pipe delimiter '|' within your file.","right":"Depending on the treatment_type selected, additional treament details may be required to be submitted. Depending on the treatment_type selected, additional treatment details may be required to be submitted. For example, if treatment_type includes 'Chemotherapy', the supplemental Chemotherapy treatment type file is required."},"examples":{"left":"Chemotherapy|Hormonal therapy","right":null}},"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Chemotherapy","Ablation","Bone marrow transplant","Combined chemo+immunotherapy","Combined chemo+radiation therapy","Combined chemo-radiotherapy and surgery","Endoscopic therapy","Hormonal therapy","Immunotherapy","Monoclonal antibodies (for liquid tumours)","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgical resection"],"data":{"added":["Combined chemo+immunotherapy","Combined chemo+radiation therapy","Combined chemo-radiotherapy and surgery","Monoclonal antibodies (for liquid tumours)","Surgical resection"],"deleted":["End of life care","Surgery"]}}}},"is_primary_treatment":{"description":{"left":"Indicate if the treatment was the primary treatment following the initial diagnosis.","right":"Indicate if the treamtment was the primary treatment following the initial diagnosis."},"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"codeList":{"left":["Yes","No"],"right":["Yes","No","Unknown"],"data":{"added":["Unknown"],"deleted":[]}},"required":{"left":null,"right":true}}},"treatment_start_interval":{"description":{"left":"The interval between the primary diagnosis and initiation of treatment, in days.","right":"The interval between primary diagnosis and initiation of treatment, in days."},"meta":{"notes":{"left":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":"The associated Primary Diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."},"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"treatment_duration":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null},"required":{"left":null,"right":true}}}},"created":{"age_at_consent_for_treatment":{"changeType":"created","name":"age_at_consent_for_treatment","description":"Indicate the age of donor when consent was given for treatment.","valueType":"integer","meta":{"displayName":"Age At Consent For Treatment"}},"therapeutic_intent":{"changeType":"created","name":"therapeutic_intent","description":"The therapeutic intent, the reason behind the choice of a therapy, of the treatment.","valueType":"string","restrictions":{"required":true,"codeList":["Adjuvant","Concurrent","Curative","Neoadjuvant","Not applicable","Palliative","Unknown"]},"meta":{"core":true,"displayName":"Therapeutic Intent"}},"response_to_therapy":{"changeType":"created","name":"response_to_therapy","description":"The donors's response to the applied treatment regimen. (Source: RECIST)","valueType":"string","restrictions":{"required":true,"codeList":["Complete response","Disease progression","NED","Partial response","Stable disease"]},"meta":{"core":true,"displayName":"Response to Therapy"}}},"deleted":{"line_of_treatment":{"changeType":"deleted","name":"line_of_treatment","description":"Indicate the line of treatment if it is not the primary treatment.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Line Of treatment","dependsOn":"treatment.is_primary_treatment","examples":"2,3,4"}},"days_per_cycle":{"changeType":"deleted","name":"days_per_cycle","description":"Indicate the number of days in a treatment cycle.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Days Per Cycle","dependsOn":"treatment.treatment_type"}},"number_of_cycles":{"changeType":"deleted","name":"number_of_cycles","description":"Indicate the number of treatment cycles.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Number Of Cycles","dependsOn":"treatment.treatment_type"}},"treatment_intent":{"changeType":"deleted","name":"treatment_intent","description":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"]},"meta":{"core":true,"displayName":"Treatment Intent","dependsOn":"treatment.treatment_type"}},"treatment_setting":{"changeType":"deleted","name":"treatment_setting","description":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: NCIt C124308)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"]},"meta":{"core":true,"displayName":"Treatment Setting","dependsOn":"treatment.treatment_type"}},"response_to_treatment_criteria_method":{"changeType":"deleted","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},"response_to_treatment":{"changeType":"deleted","name":"response_to_treatment","description":"The donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"codeList":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"]},"meta":{"core":true,"displayName":"Response To Treatment","dependsOn":"treatment.response_to_treatment_criteria_method","notes":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"outcome_of_treatment":{"changeType":"deleted","name":"outcome_of_treatment","description":"Indicate the donor's outcome of the prescribed treatment.","valueType":"string","restrictions":{"codeList":["Treatment completed as prescribed","Treatment incomplete due to technical or organizational problems","Treatment incomplete because patient died","Patient choice (stopped or interrupted treatment)","Physician decision (stopped or interrupted treatment)","Treatment stopped due to lack of efficacy (disease progression)","Treatment stopped due to acute toxicity","Other","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Outcome Of Treatment","dependsOn":"treatment.treatment_type"}},"toxicity_type":{"changeType":"deleted","name":"toxicity_type","description":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity.","valueType":"string","restrictions":{"codeList":["Hematological","Non-hematological","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Toxicity Type","dependsOn":"treatment.outcome_of_treatment"}},"hematological_toxicity":{"changeType":"deleted","name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"non-hematological_toxicity":{"changeType":"deleted","name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"adverse_events":{"changeType":"deleted","name":"adverse_events","description":"Report any treatment related adverse events. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Adverse Events","dependsOn":"treatment.treatment_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"clinical_trials_database":{"changeType":"deleted","name":"clinical_trials_database","description":"If the donor is a participant in a clinical trial, indicate the clinical trial database where the clinical trial is registered.","valueType":"string","meta":{"display name":"Clinical Trials Database","notes":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added."},"restrictions":{"codeList":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"]}},"clinical_trial_number":{"changeType":"deleted","name":"clinical_trial_number","description":"Based on the clinical_trial_database, indicate the unique NCT or EudraCT clinical trial identifier of which the donor is a participant.","valueType":"string","meta":{"display name":"Clinical Trial Number","dependsOn":"treatment.clinical_trials_database","examples":"2016-002120-83,NCT02465060"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"]}}}},"chemotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"dependsOn":{"left":"chemotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses a controlled vocabulary gathered from the RxNorm database of drug names provided by the NIH (https://www.nlm.nih.gov/research/umls/rxnorm)."}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"description":{"left":"Name of agent or drug administered to donor as part of the treatment regimen.","right":"Name of agent or drug administered to patient as part of the treatment regimen."},"meta":{"dependsOn":{"left":"chemotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses a controlled vocabulary gathered from the RxNorm database of drug names provided by the NIH (https://www.nlm.nih.gov/research/umls/rxnorm)."}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"chemotherapy_dosage_units":{"changeType":"created","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate the total drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"deleted","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"deleted","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"deleted","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"deleted","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses a controlled vocabulary gathered from the RxNorm database of drug names provided by the NIH (https://www.nlm.nih.gov/research/umls/rxnorm)."}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"description":{"left":"Name of agent or drug administered to donor as part of the treatment regimen.","right":"Name of agent or drug administered to patient as part of the treatment regimen."},"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses a controlled vocabulary gathered from the RxNorm database of drug names provided by the NIH (https://www.nlm.nih.gov/research/umls/rxnorm)."}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"hormone_drug_dosage_units":{"changeType":"created","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"deleted","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"radiation":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"radiation_therapy_fractions":{"description":{"left":"Indicate the total number of fractions delivered as part of treatment.","right":"Indicate the number of total fractions delivered as part of treatment."},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"radiation_therapy_dosage":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"anatomical_site_irradiated":{"description":{"left":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)","right":"Indicate localization site where radiation therapy was administered."},"restrictions":{"codeList":{"left":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"right":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"data":{"added":["Bone","Extremities","Head-Neck","Peritoneum"],"deleted":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"]}}}}},"created":{"application_form":{"changeType":"created","name":"application_form","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal"]},"meta":{"core":true,"displayName":"Application Form","notes":"Internal application includes Brachytherapy."}}},"deleted":{"radiation_therapy_type":{"changeType":"deleted","name":"radiation_therapy_type","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal"]},"meta":{"core":true,"displayName":"Type of Radiation Therapy","notes":"Internal application includes Brachytherapy."}},"radiation_boost":{"changeType":"deleted","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"deleted","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}}},"immunotherapy":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"immunotherapy_type":{"changeType":"deleted","name":"immunotherapy_type","valueType":"string","description":"Indicate the type of immunotherapy administered to donor.","meta":{"displayName":"Immunotherapy Type","core":true},"restrictions":{"required":true,"codeList":["Cell-based","Immune checkpoint inhibitors","Monoclonal antibodies other than immune checkpoint inhibitors","Other immunomodulatory substances"]}},"drug_rxnormcui":{"changeType":"deleted","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"deleted","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"deleted","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"surgery":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"deleted","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"deleted","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"deleted","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"deleted","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"deleted","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"deleted","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"deleted","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"deleted","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"deleted","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"deleted","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"deleted","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"deleted","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"deleted","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"deleted","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}}},"follow_up":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_follow_up_id":{"description":{"left":"Unique identifier for a follow-up event in a donor's clinical record, assigned by the data provider.","right":"Unique identifier for a follow-up event in a donors clincal record, assigned by the data provider."},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"interval_of_followup":{"meta":{"notes":{"left":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":"The associated Primary Diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}}},"disease_status_at_followup":{"description":{"left":"Indicate the donor's disease status at time of follow-up. (Reference: RECIST)","right":"Indicate the donor's disease status at time of follow-up."},"restrictions":{"codeList":{"left":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Progression NOS","Relapse or recurrence","Stable"],"right":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Relapse","Stable"],"data":{"added":["Relapse"],"deleted":["Progression NOS","Relapse or recurrence"]}}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"treatment.submitter_treatment_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"weight_at_followup":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"relapse_type":{"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.","right":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse."}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":null}}},"relapse_interval":{"description":{"left":"If the donor was clinically disease free following primary treatment and then relapse or recurrence or progression (for liquid tumours) occurred afterwards, then this field will indicate the length of disease free interval, in days.","right":"If the donor was clinically disease free following primary treatment and then relapse or progression (for liquid tumours) occurred afterwards, then this field will indicate the length of disease free interval, in days."},"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.","right":"This field is required to be submitted if disease_status_at_followup indicates a progression or relapse value."}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"]}}},"method_of_progression_status":{"description":{"left":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Reference: caDSR CDE ID 6161031)","right":"Indicate the method(s) used to confirm the donor's progression disease status. (Codelist reference: NCI CDE ID: 6161031)"},"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file.","right":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"]}}},"recurrence_tumour_staging_system":{"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.","right":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse."},"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"data":{"added":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"deleted":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"]}}},"recurrence_t_category":{"description":{"left":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":null,"data":{"added":[],"deleted":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"]}}}},"recurrence_n_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"],"right":null,"data":{"added":[],"deleted":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"]}}}},"recurrence_m_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":null,"data":{"added":[],"deleted":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"]}}}},"recurrence_stage_group":{"description":{"left":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) at the time of retreatment for a recurrence or disease progression.","right":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery."},"meta":{"notes":{"left":"This field is dependent on the selected recurrence_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","right":null},"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":null,"data":{"added":[],"deleted":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":null}}},"posttherapy_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"data":{"added":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"deleted":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"]}}}},"posttherapy_t_category":{"meta":{"dependsOn":{"left":"follow_up.posttherapy_tumour_staging_system","right":"follow_up.post_therapy_tumour_staging_system"}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":null,"data":{"added":[],"deleted":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"]}}}},"posttherapy_n_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"dependsOn":{"left":"follow_up.posttherapy_tumour_staging_system","right":"follow_up.post_therapy_tumour_staging_system"}},"restrictions":{"codeList":{"left":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"],"right":null,"data":{"added":[],"deleted":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"]}}}},"posttherapy_m_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"dependsOn":{"left":"follow_up.posttherapy_tumour_staging_system","right":"follow_up.post_therapy_tumour_staging_system"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":null,"data":{"added":[],"deleted":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"]}}}},"posttherapy_stage_group":{"meta":{"dependsOn":{"left":"follow_up.posttherapy_tumour_staging_system","right":"follow_up.post_therapy_tumour_staging_system"},"notes":{"left":"This field is dependent on the selected posttherapy_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","right":"This field is required only if the selected posttherapy_tumour_staging_system is any edition of the AJCC cancer staging system."}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":null,"data":{"added":[],"deleted":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":null}}}},"created":{"anatomic_site_progression_or_recurrences":{"changeType":"created","description":"Indicate the anatomic site where disease progression or recurrence occurred. (Codelist reference: NCI CDE ID: 4742851)","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"],"codeList":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear - pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal - distal","Esophageal - mid","Esophageal - proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es) - maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"]},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","notes":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse.","displayName":"Anatomic Site Progression or Recurrences"}}},"deleted":{"anatomic_site_progression_or_recurrence":{"changeType":"deleted","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"exposure":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"deleted","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"deleted","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"deleted","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"deleted","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"deleted","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"deleted","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"deleted","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"deleted","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"deleted","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"deleted","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"deleted","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}}},"family_history":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"family_relative_id":{"changeType":"deleted","description":"Unique identifier of the relative, assigned by the data provider.","name":"family_relative_id","valueType":"string","meta":{"displayName":"Family Relative ID","primaryId":true,"notes":"This field is required to ensure that family members are identified in unique records. Ids can be as simple as an incremented numeral to ensure uniqueness."},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"relative_with_cancer_history":{"changeType":"deleted","description":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","name":"relative_with_cancer_history","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Relative with Cancer History"}},"relationship_type":{"changeType":"deleted","description":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","name":"relationship_type","restrictions":{"codeList":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"]},"valueType":"string","meta":{"displayName":"Relationship Type"}},"gender_of_relative":{"changeType":"deleted","description":"The self-reported gender of related individual.","name":"gender_of_relative","restrictions":{"codeList":["Female","Male","Other","Unknown"]},"valueType":"string","meta":{"displayName":"Gender of Relative"}},"age_of_relative_at_diagnosis":{"changeType":"deleted","description":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","name":"age_of_relative_at_diagnosis","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","displayName":"Age Of Relative At Diagnosis"}},"cancer_type_code_of_relative":{"changeType":"deleted","name":"cancer_type_code_of_relative","valueType":"string","description":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"examples":"C41.1,C16.9,C00.5,D46.9","dependsOn":"family_history.relative_with_cancer_history","displayName":"Cancer Type Code (ICD-10) of Relative"}},"relative_vital_status":{"changeType":"deleted","description":"Relative's last known state of living or deceased.","name":"relative_vital_status","restrictions":{"codeList":["Alive","Deceased","Unknown"]},"valueType":"string","meta":{"displayName":"Vital Status of Relative"}},"cause_of_death_of_relative":{"changeType":"deleted","description":"Indicate the cause of the death of the relative.","name":"cause_of_death_of_relative","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]},"valueType":"string","meta":{"dependsOn":"family_history.relative_vital_status","displayName":"Cause of Death of Relative"}},"relative_survival_time":{"changeType":"deleted","description":"Indicate how long, in days, the relative survived from the time they were diagnosed with cancer.","name":"relative_survival_time","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","units":"days","displayName":"Survival Time Of Relative"}}}},"biomarker":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"deleted","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"deleted","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"deleted","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"deleted","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"deleted","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"deleted","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"deleted","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"deleted","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"deleted","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"deleted","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"deleted","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"deleted","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"deleted","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"deleted","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"deleted","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"deleted","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}}},"comorbidity":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"deleted","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"deleted","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"deleted","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"deleted","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"deleted","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"deleted","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}}}}} diff --git a/website/static/data/schemas/diffs/1.24/1.24-diff-0.14.json b/website/static/data/schemas/diffs/1.24/1.24-diff-0.14.json new file mode 100644 index 00000000..37d03cd3 --- /dev/null +++ b/website/static/data/schemas/diffs/1.24/1.24-diff-0.14.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"program_id":{"meta":{"examples":{"left":"TEST-CA","right":"PACA-AU,BR-CA"},"notes":{"left":"This is the unique id that is assigned to your program. If you have logged into the platform, this is the Program Id that you see in the Program Services area. For example, TEST-CA is a Program ID.","right":"This is the unique id that is assigned to your program. If you have logged into the platform, this is the Program Id that you see in the Submission area. For example, PACA-CA is a Program ID."}}},"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":[],"deleted":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\r\n\r\n const row = $row;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n const designation = row.tumour_normal_designation.trim().toLowerCase();\r\n const specimen_type = $field.trim().toLowerCase();\r\n \r\n if (designation === \"normal\"){\r\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\r\n if (!validTypes.includes(specimen_type)){\r\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when tumour_normal_designation is set to Normal.\"};\r\n }\r\n }\r\n else if (designation === \"tumour\") {\r\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\r\n if (invalidTypes.includes(specimen_type)){\r\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when tumour_normal_designation is set to Tumour.\"};\r\n }\r\n }\r\n return result;\r\n })()"]}}},"submitter_sample_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased"],"right":["Alive","Deceased","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"cause_of_death":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate() {\r\n let result = {valid: true, message: \"Ok\"};\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n const vitalStatus = $row.vital_status.trim().toLowerCase();\r\n \r\n if (!currField && vitalStatus === \"deceased\"){\r\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\r\n }\r\n else if (currField && vitalStatus != \"deceased\"){\r\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\r\n }\r\n return result;\r\n })()"]}}},"survival_time":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate() {\r\n let result = {valid: true, message: \"Ok\"};\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n const vitalStatus = $row.vital_status.trim().toLowerCase();\r\n \r\n if (!currField && vitalStatus === \"deceased\"){\r\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\r\n }\r\n else if (currField && vitalStatus != \"deceased\"){\r\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\r\n }\r\n return result;\r\n })()"]},"range":{"left":{"exclusiveMin":0},"right":null}}},"primary_site":{"meta":{"notes":{"left":"To include multiple values, separate values with a pipe delimiter '|' within your file.","right":null},"examples":{"left":"Breast|Ovary","right":null}},"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Not Reported","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva","Unknown"],"data":{"added":["Not Reported","Unknown"],"deleted":["Unknown primary site"]}}}},"height":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"weight":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"bmi":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"menopause_status":{"description":{"left":"Indicate the donor's menopause status at the time of primary diagnosis. (Reference: caDSR CDE ID 2434914)","right":"Indicate the donor's menopause status at the time of primary diagnosis. (Codelist reference: NCI CDE ID: 2434914)"},"restrictions":{"codeList":{"left":["Not applicable","Perimenopausal","Postmenopausal","Premenopausal","Unknown"],"right":["Indeterminate or unknown","Not applicable","Perimenopausal","Postmenopausal","Premenopausal"],"data":{"added":["Indeterminate or unknown"],"deleted":["Unknown"]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)","right":"Indicate the donor's age of menarche, the first occurrence of menstruation."},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"number_of_pregnancies":{"description":{"left":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)","right":"Indicate the number of pregnancies a donor has had."},"restrictions":{"range":{"left":{"min":0},"right":null}}},"number_of_children":{"description":{"left":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)","right":"Indicate the number of children the donor has birthed."},"restrictions":{"range":{"left":{"min":0},"right":null}}}},"created":{"prior_malignancy":{"changeType":"created","description":"Prior malignancy affecting donor.","name":"prior_malignancy","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy","examples":"C41.1, C16.9, C00.5, D46.9"}},"cancer_type_prior_malignancy":{"changeType":"created","description":"The code to represent the cancer type of a prior malignancy using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","name":"cancer_type_prior_malignancy","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"valueType":"string","meta":{"displayName":"Cancer Type Prior Malignancy"}},"age_at_prior_malignancy":{"changeType":"created","description":"If donor has history of prior malignancy, indicate age at previous diagnosis, in years.","name":"age_at_prior_malignancy","valueType":"integer","meta":{"displayName":"Age at Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"created","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Codelist reference: NCI CDE: 4122391)","name":"laterality_of_prior_malignancy","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality at Prior Malignancy"}}},"deleted":{"genetic_disorders":{"changeType":"deleted","description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},"hrt_type":{"changeType":"deleted","description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},"hrt_duration":{"changeType":"deleted","description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},"contraception_type":{"changeType":"deleted","description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},"contraception_duration":{"changeType":"deleted","description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},"lost_to_followup_after_clinical_event_id":{"changeType":"deleted","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}}},"specimen":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"description":{"left":"Indicate the primary diagnosis event in the clinical timeline that this specimen acquisition was related to.","right":"Indicate the primary diagnosis event in the clinical timeline that this specimen aquisition was related to."},"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"pathological_tumour_staging_system":{"meta":{"validationDependency":{"left":true,"right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n /* This is not a required field, so first ensure that it exists */\r\n if ($field) {\r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })()"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"pathological_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"pathological_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"pathological_stage_group":{"description":{"left":"Specify the tumour stage, based on pathological_tumour_staging_system, used to assess the cancer at the time the tumour specimen was resected.","right":"Specify the tumour stage, based on tumour_staging_system, used to assess the cancer at the time the tumour specimen was resected."},"meta":{"notes":{"left":"This field depends on the selected pathological_tumour_staging_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","right":"This field depends on the selected pathological staging system, and is only required if the specimen is a tumour."}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.pathological_tumour_staging_system && $field) {\r\n let codeList = [];\r\n switch ($row.pathological_tumour_staging_system && $row.pathological_tumour_staging_system.trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb',\r\n 'stage ive',\r\n 'stage ivs'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When 'pathological_tumour_staging_system' is set to '${\r\n $row.pathological_tumour_staging_system\r\n }', 'pathological_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })()"]}}},"specimen_acquisition_interval":{"meta":{"notes":{"left":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":"The associated Primary Diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."},"displayName":{"left":"Specimen Acquisition Interval","right":"Specimen Aquisition Interval"}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"data":{"added":[],"deleted":["Unknown"]}}}},"specimen_storage":{"description":{"left":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured.","right":"Indicate the method of specimen storage for specimens that were not extracted freshly or immediately cultured."},"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"data":{"added":[],"deleted":["Unknown"]}}}},"reference_pathology_confirmed":{"description":{"left":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)","right":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. This only applies to clinical studies."}},"tumour_grading_system":{"meta":{"validationDependency":{"left":true,"right":null}}},"tumour_grade":{"meta":{"notes":{"left":"This field depends on the selected tumour_grading_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Grading Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-grading-classifications","right":"This field depends on the selected tumour grading system, and is only required if the specimen is a tumour."}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.tumour_grading_system && $field) {\r\n let codeList = [];\r\n const tieredGradingList = ['gx','g1','g2','g3'];\r\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\r\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\r\n case 'two-tier grading system':\r\n codeList = [\r\n 'low grade',\r\n 'high grade',\r\n ];\r\n break;\r\n case 'three-tier grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'four-tier grading system':\r\n codeList = [\r\n 'gx',\r\n 'g1',\r\n 'g2',\r\n 'g3',\r\n 'g4',\r\n ];\r\n break;\r\n case 'grading system for gists':\r\n codeList = [\r\n 'low',\r\n 'high',\r\n ];\r\n break;\r\n case 'grading system for gnets':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'isup grading system':\r\n codeList = [\r\n 'gx',\r\n 'g1',\r\n 'g2',\r\n 'g3',\r\n 'g4',\r\n ];\r\n break;\r\n case 'who grading system for cns tumours':\r\n codeList = [\r\n 'grade i',\r\n 'grade ii',\r\n 'grade iii',\r\n 'grade iv',\r\n ];\r\n break;\r\n case 'fnclcc grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'gleason grade group system':\r\n codeList = [\r\n 'grade group 1',\r\n 'grade group 2',\r\n 'grade group 3',\r\n 'grade group 4',\r\n 'grade group 5',\r\n ];\r\n break;\r\n case 'scarff-bloom-richardson grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'nuclear grading system for dcis':\r\n codeList = tieredGradingList;\r\n break;\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase())) {\r\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\r\n $row.tumour_grading_system\r\n }', 'tumour_grade' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\r\n result.valid = false;\r\n const msg = \"'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.\";\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })()"]}}},"percent_tumour_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)","right":"Indicate a value, in decimals, that represents the percentage of infiltration by tumour cells in a specimen."},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null},"script":{"left":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"],"right":null}}},"percent_proliferating_cells":{"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_inflammatory_tissue":{"description":{"left":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)","right":"Indicate a value, in decimals, that represents local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_stromal_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)","right":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a malignant tumour specimen but are not malignant such as fibroblasts, vascular structures, etc."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_necrosis":{"description":{"left":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)","right":"Indicate a value, in decimals, that represents the percentage of cell death in a malignant tumour specimen."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}}},"created":{},"deleted":{"specimen_laterality":{"changeType":"deleted","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"percent_tumour_cells_measurement_method":{"changeType":"deleted","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"age_at_diagnosis":{"description":{"left":"Age that the donor was first diagnosed with cancer, in years. This should be based on the earliest diagnosis of cancer.","right":"Age that the donor was first diagnosed with cancer, in years."},"restrictions":{"range":{"left":{"exclusiveMin":0,"max":90},"right":null}}},"number_lymph_nodes_examined":{"description":{"left":"The total number of lymph nodes tested for the presence of cancer. (Reference: caDSR CDE ID 3)","right":"The total number of lymph nodes tested for the presence of cancer. (Reference: NCI CDE ID: 3)"},"meta":{"dependsOn":{"left":"primary_diagnosis.lymph_nodes_examined_status","right":null},"notes":{"left":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":null},"range":{"left":{"min":0},"right":null}}},"number_lymph_nodes_positive":{"description":{"left":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: caDSR CDE ID 6113694)","right":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: NCI CDE ID: 6113694)"},"meta":{"dependsOn":{"left":"primary_diagnosis.lymph_nodes_examined_status","right":null},"notes":{"left":"This field is only required if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":null},"range":{"left":{"min":0},"right":null},"required":{"left":null,"right":true}}},"clinical_tumour_staging_system":{"meta":{"validationDependency":{"left":true,"right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n /* This is not a required field, so first ensure that it exists */\r\n if ($field) {\r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })()"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}},"required":{"left":null,"right":true}}},"clinical_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"clinical_n_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null}}},"clinical_m_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned.","right":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned."},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"clinical_stage_group":{"description":{"left":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage.","right":"Stage group of the tumour, as assigned by the reporting tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.)."},"meta":{"notes":{"left":"This field is dependent on the selected clinical_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","right":"This field is dependent on the selected clinical_tumour_staging_system"},"examples":{"left":"Stage I, Stage IIB","right":null}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.clinical_tumour_staging_system && $field) {\r\n let codeList = [];\r\n switch ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system.trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb',\r\n 'stage ive',\r\n 'stage ivs'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When 'clinical_tumour_staging_system' is set to '${\r\n $row.clinical_tumour_staging_system\r\n }', 'clinical_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })()"]}}},"presenting_symptoms":{"restrictions":{"codeList":{"left":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Loss of Appetite","Nausea","None","Not Reported","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Swelling in the Neck","Unknown","Vomiting","Weight Loss"],"right":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Nausea","None","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Unknown","Vomiting","Weight Loss"],"data":{"added":[],"deleted":["Loss of Appetite","Not Reported","Swelling in the Neck"]}}}},"performance_status":{"description":{"left":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status).","right":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference source: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status)."},"meta":{"notes":{"left":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction.\nGrade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work).\nGrade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours.\nGrade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours.\nGrade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair","right":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction \n Grade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work) \n Grade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours \n Grade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours \n Grade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair"}},"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"data":{"added":[],"deleted":["Unknown"]}}}}},"created":{},"deleted":{"cancer_type_additional_information":{"changeType":"deleted","name":"cancer_type_additional_information","valueType":"string","description":"Additional details related to the cancer type that are not covered by the ICD-10 code provided in the cancer_type field.","meta":{"displayName":"Cancer Type Additional Information"}},"laterality":{"changeType":"deleted","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_status":{"changeType":"deleted","name":"lymph_nodes_examined_status","description":"Indicate if lymph nodes were examined for metastases.","valueType":"string","restrictions":{"required":true,"codeList":["Cannot be determined","No","No lymph nodes found in resected specimen","Not applicable","Yes"]},"meta":{"core":true,"displayName":"Lymph Nodes Examined Status"}},"lymph_nodes_examined_method":{"changeType":"deleted","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}}},"treatment":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"treatment_type":{"meta":{"notes":{"left":"Depending on the treatment_type(s) selected, additional treatment details may be required to be submitted. For example, if treatment_type includes 'Chemotherapy', the supplemental Chemotherapy treatment type file is required.\nTo include multiple values, separate values with a pipe delimiter '|' within your file.","right":"Depending on the treatment_type selected, additional treatment details may be required to be submitted. For example, if treatment_type includes 'Chemotherapy', the supplemental Chemotherapy treatment type file is required."},"examples":{"left":"Chemotherapy|Hormonal therapy","right":null}},"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Combined chemotherapy and immunotherapy","Combined chemotherapy and radiation therapy","Combined chemotherapy, radiation therapy and surgery","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":["Combined chemotherapy and immunotherapy","Combined chemotherapy and radiation therapy","Combined chemotherapy, radiation therapy and surgery"],"deleted":["End of life care"]}}}},"is_primary_treatment":{"description":{"left":"Indicate if the treatment was the primary treatment following the initial diagnosis.","right":"Indicate if the treamtment was the primary treatment following the initial diagnosis."},"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"codeList":{"left":["Yes","No"],"right":["Yes","No","Unknown"],"data":{"added":["Unknown"],"deleted":[]}},"required":{"left":null,"right":true}}},"line_of_treatment":{"meta":{"dependsOn":{"left":"treatment.is_primary_treatment","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"],"right":null}}},"treatment_start_interval":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"treatment_duration":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null},"required":{"left":null,"right":true}}},"days_per_cycle":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null}}},"number_of_cycles":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null}}},"toxicity_type":{"description":{"left":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity.","right":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hemotological toxicity or non-hemotological toxicity."},"meta":{"dependsOn":{"left":"treatment.outcome_of_treatment","right":null}},"restrictions":{"codeList":{"left":["Hematological","Non-hematological","Not applicable","Unknown"],"right":["Hemotological","Non-hemotological"],"data":{"added":["Hemotological","Non-hemotological"],"deleted":["Hematological","Non-hematological","Not applicable","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"],"right":null}}},"adverse_events":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null},"notes":{"left":"To include multiple values, separate values with a pipe delimiter '|' within your file.","right":null}},"restrictions":{"codeList":{"left":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"right":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"data":{"added":[],"deleted":["None","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null}}},"clinical_trials_database":{"meta":{"notes":{"left":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added.","right":null}},"restrictions":{"codeList":{"left":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"],"right":["NCI Clinical Trials","EU Clinical Trials Register"],"data":{"added":[],"deleted":["Not applicable","Unknown"]}}}},"clinical_trial_number":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"],"right":["(function validate() {\r\n let result = {valid: true, message: \"Ok\"};\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n //regex check for clinical trial number\r\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\r\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\r\n\r\n // list of valid clinical trial databases\r\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\r\n \r\n if ($row.clinical_trials_database && $field) {\r\n const trialNumber = $field.trim();\r\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\r\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\r\n result = {valid: false, message: 'The submitted NCI clinical trial number is in incorrect format.'};\r\n }\r\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\r\n result = {valid: false, message: \"The submitted EudraCT clinical trial number is in incorrect format.\"};\r\n }\r\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\r\n result = {valid: false, message: \"The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database.\"};\r\n }\r\n }\r\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\r\n result = {valid: true, message: \"Ok\"};\r\n }\r\n else if ($row.clinical_trials_database && !$field) {\r\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\r\n result = {valid: false, message: \"'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.\"};\r\n } \r\n }\r\n return result;\r\n })()"]}}}},"created":{"age_at_consent_for_treatment":{"changeType":"created","name":"age_at_consent_for_treatment","description":"Indicate the age of donor when consent was given for treatment.","valueType":"integer","meta":{"displayName":"Age At Consent For Treatment"}},"therapeutic_intent":{"changeType":"created","name":"therapeutic_intent","description":"The therapeutic intent, the reason behind the choice of a therapy, of the treatment.","valueType":"string","restrictions":{"required":true,"codeList":["Adjuvant","Concurrent","Curative","Neoadjuvant","Not applicable","Palliative","Unknown"]},"meta":{"core":true,"displayName":"Therapeutic Intent"}},"response_to_therapy":{"changeType":"created","name":"response_to_therapy","description":"The donors's response to the applied treatment regimen. (Source: RECIST)","valueType":"string","restrictions":{"required":true,"codeList":["Complete response","Disease progression","NED","Partial response","Stable disease"]},"meta":{"core":true,"displayName":"Response To Therapy"}},"outcome_of_therapy":{"changeType":"created","name":"outcome_of_therapy","description":"Indicate the donor's outcome of the prescribed treatment.","valueType":"string","restrictions":{"codeList":["Treatment completed as prescribed","Treatment incomplete due to technical or organizational problems","Treatment incomplete because patient died","Patient choice (stopped or interrupted treatment)","Physician decision (stopped or interrupted treatment)","Treatment stopped due to lack of efficacy (disease progression)","Treatment stopped due to acute toxicity","Other","Not applicable","Unknown"]},"meta":{"displayName":"Outcome Of Therapy"}},"hemotological_toxicity":{"changeType":"created","name":"hemotological_toxicity","description":"Indicate the hemotological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5"]},"meta":{"displayName":"Hemotological Toxicity"}}},"deleted":{"treatment_intent":{"changeType":"deleted","name":"treatment_intent","description":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"]},"meta":{"core":true,"displayName":"Treatment Intent","dependsOn":"treatment.treatment_type"}},"treatment_setting":{"changeType":"deleted","name":"treatment_setting","description":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: NCIt C124308)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"]},"meta":{"core":true,"displayName":"Treatment Setting","dependsOn":"treatment.treatment_type"}},"response_to_treatment_criteria_method":{"changeType":"deleted","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},"response_to_treatment":{"changeType":"deleted","name":"response_to_treatment","description":"The donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"codeList":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"]},"meta":{"core":true,"displayName":"Response To Treatment","dependsOn":"treatment.response_to_treatment_criteria_method","notes":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"outcome_of_treatment":{"changeType":"deleted","name":"outcome_of_treatment","description":"Indicate the donor's outcome of the prescribed treatment.","valueType":"string","restrictions":{"codeList":["Treatment completed as prescribed","Treatment incomplete due to technical or organizational problems","Treatment incomplete because patient died","Patient choice (stopped or interrupted treatment)","Physician decision (stopped or interrupted treatment)","Treatment stopped due to lack of efficacy (disease progression)","Treatment stopped due to acute toxicity","Other","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Outcome Of Treatment","dependsOn":"treatment.treatment_type"}},"hematological_toxicity":{"changeType":"deleted","name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"non-hematological_toxicity":{"changeType":"deleted","name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"chemotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"dependsOn":{"left":"chemotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"description":{"left":"Name of agent or drug administered to donor as part of the treatment regimen.","right":"Name of agent or drug administered to patient as part of the treatment regimen."},"meta":{"dependsOn":{"left":"chemotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"chemotherapy_dosage_units":{"changeType":"created","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate the total drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"deleted","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"deleted","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"deleted","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"deleted","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"description":{"left":"Name of agent or drug administered to donor as part of the treatment regimen.","right":"Name of agent or drug administered to patient as part of the treatment regimen."},"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"hormone_drug_dosage_units":{"changeType":"created","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"deleted","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"radiation":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"radiation_therapy_fractions":{"description":{"left":"Indicate the total number of fractions delivered as part of treatment.","right":"Indicate the number of total fractions delivered as part of treatment."},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"radiation_therapy_dosage":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"anatomical_site_irradiated":{"description":{"left":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)","right":"Indicate localization site where radiation therapy was administered."},"restrictions":{"codeList":{"left":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"right":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"data":{"added":["Bone","Extremities","Head-Neck","Peritoneum"],"deleted":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"]}}}}},"created":{"radiation_treatment_type":{"changeType":"created","name":"radiation_treatment_type","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal"]},"meta":{"core":true,"displayName":"Application Form","notes":"Internal application includes Brachytherapy."}}},"deleted":{"radiation_therapy_type":{"changeType":"deleted","name":"radiation_therapy_type","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal"]},"meta":{"core":true,"displayName":"Type of Radiation Therapy","notes":"Internal application includes Brachytherapy."}},"radiation_boost":{"changeType":"deleted","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"deleted","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}}},"immunotherapy":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"immunotherapy_type":{"changeType":"deleted","name":"immunotherapy_type","valueType":"string","description":"Indicate the type of immunotherapy administered to donor.","meta":{"displayName":"Immunotherapy Type","core":true},"restrictions":{"required":true,"codeList":["Cell-based","Immune checkpoint inhibitors","Monoclonal antibodies other than immune checkpoint inhibitors","Other immunomodulatory substances"]}},"drug_rxnormcui":{"changeType":"deleted","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"deleted","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"deleted","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"surgery":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"deleted","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"deleted","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"deleted","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"deleted","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"deleted","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"deleted","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"deleted","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"deleted","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"deleted","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"deleted","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"deleted","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"deleted","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"deleted","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"deleted","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}}},"follow_up":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_follow_up_id":{"description":{"left":"Unique identifier for a follow-up event in a donor's clinical record, assigned by the data provider.","right":"Unique identifier for a follow-up event in a donors clincal record, assigned by the data provider."},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"interval_of_followup":{"meta":{"notes":{"left":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":"The associated Primary Diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}}},"disease_status_at_followup":{"description":{"left":"Indicate the donor's disease status at time of follow-up. (Reference: RECIST)","right":"Indicate the donor's disease status at time of follow-up."},"restrictions":{"codeList":{"left":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Progression NOS","Relapse or recurrence","Stable"],"right":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Relapse or recurrence","Stable"],"data":{"added":[],"deleted":["Progression NOS"]}}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"treatment.submitter_treatment_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"weight_at_followup":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"relapse_type":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })()"]}}},"relapse_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })()"]}}},"method_of_progression_status":{"description":{"left":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Reference: caDSR CDE ID 6161031)","right":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Codelist reference: NCI CDE ID: 6161031)"},"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })()"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n /* This is not a required field, so first ensure that it exists */\r\n if ($field) {\r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })()","(function validate() {\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })()"]}}},"recurrence_t_category":{"description":{"left":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"recurrence_n_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":null,"right":true}}},"recurrence_m_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"recurrence_stage_group":{"description":{"left":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) at the time of retreatment for a recurrence or disease progression.","right":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery."},"meta":{"notes":{"left":"This field is dependent on the selected recurrence_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","right":"This field is dependent on the selected recurrence_tumour_staging_system."},"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.recurrence_tumour_staging_system && $field) {\r\n let codeList = [];\r\n switch ($row.recurrence_tumour_staging_system && $row.recurrence_tumour_staging_system.trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb',\r\n 'stage ive',\r\n 'stage ivs'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When 'recurrence_tumour_staging_system' is set to '${\r\n $row.recurrence_tumour_staging_system\r\n }', 'recurrence_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })()"]}}},"posttherapy_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n /* This is not a required field, so first ensure that it exists */\r\n if ($field) {\r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })()"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"posttherapy_t_category":{"meta":{"dependsOn":{"left":"follow_up.posttherapy_tumour_staging_system","right":"follow_up.post_therapy_tumour_staging_system"}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"posttherapy_n_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"dependsOn":{"left":"follow_up.posttherapy_tumour_staging_system","right":"follow_up.post_therapy_tumour_staging_system"}}},"posttherapy_m_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"dependsOn":{"left":"follow_up.posttherapy_tumour_staging_system","right":"follow_up.post_therapy_tumour_staging_system"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"posttherapy_stage_group":{"meta":{"dependsOn":{"left":"follow_up.posttherapy_tumour_staging_system","right":"follow_up.post_therapy_tumour_staging_system"},"notes":{"left":"This field is dependent on the selected posttherapy_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","right":"This field is dependent on the selected posttherapy_tumour_staging_system."}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.posttherapy_tumour_staging_system && $field) {\r\n let codeList = [];\r\n switch ($row.posttherapy_tumour_staging_system && $row.posttherapy_tumour_staging_system.trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb',\r\n 'stage ive',\r\n 'stage ivs'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When 'posttherapy_tumour_staging_system' is set to '${\r\n $row.posttherapy_tumour_staging_system\r\n }', 'posttherapy_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })()"]}}}},"created":{"anatomic_site_progression_or_recurrences":{"changeType":"created","description":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate() {\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })()"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1,C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}}},"deleted":{"anatomic_site_progression_or_recurrence":{"changeType":"deleted","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"exposure":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"deleted","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"deleted","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"deleted","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"deleted","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"deleted","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"deleted","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"deleted","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"deleted","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"deleted","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"deleted","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"deleted","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}}},"family_history":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"family_relative_id":{"changeType":"deleted","description":"Unique identifier of the relative, assigned by the data provider.","name":"family_relative_id","valueType":"string","meta":{"displayName":"Family Relative ID","primaryId":true,"notes":"This field is required to ensure that family members are identified in unique records. Ids can be as simple as an incremented numeral to ensure uniqueness."},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"relative_with_cancer_history":{"changeType":"deleted","description":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","name":"relative_with_cancer_history","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Relative with Cancer History"}},"relationship_type":{"changeType":"deleted","description":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","name":"relationship_type","restrictions":{"codeList":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"]},"valueType":"string","meta":{"displayName":"Relationship Type"}},"gender_of_relative":{"changeType":"deleted","description":"The self-reported gender of related individual.","name":"gender_of_relative","restrictions":{"codeList":["Female","Male","Other","Unknown"]},"valueType":"string","meta":{"displayName":"Gender of Relative"}},"age_of_relative_at_diagnosis":{"changeType":"deleted","description":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","name":"age_of_relative_at_diagnosis","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","displayName":"Age Of Relative At Diagnosis"}},"cancer_type_code_of_relative":{"changeType":"deleted","name":"cancer_type_code_of_relative","valueType":"string","description":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"examples":"C41.1,C16.9,C00.5,D46.9","dependsOn":"family_history.relative_with_cancer_history","displayName":"Cancer Type Code (ICD-10) of Relative"}},"relative_vital_status":{"changeType":"deleted","description":"Relative's last known state of living or deceased.","name":"relative_vital_status","restrictions":{"codeList":["Alive","Deceased","Unknown"]},"valueType":"string","meta":{"displayName":"Vital Status of Relative"}},"cause_of_death_of_relative":{"changeType":"deleted","description":"Indicate the cause of the death of the relative.","name":"cause_of_death_of_relative","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]},"valueType":"string","meta":{"dependsOn":"family_history.relative_vital_status","displayName":"Cause of Death of Relative"}},"relative_survival_time":{"changeType":"deleted","description":"Indicate how long, in days, the relative survived from the time they were diagnosed with cancer.","name":"relative_survival_time","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","units":"days","displayName":"Survival Time Of Relative"}}}},"biomarker":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"deleted","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"deleted","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"deleted","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"deleted","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"deleted","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"deleted","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"deleted","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"deleted","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"deleted","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"deleted","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"deleted","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"deleted","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"deleted","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"deleted","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"deleted","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"deleted","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}}},"comorbidity":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"deleted","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"deleted","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"deleted","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"deleted","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"deleted","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"deleted","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}}}}} diff --git a/website/static/data/schemas/diffs/1.24/1.24-diff-0.15.json b/website/static/data/schemas/diffs/1.24/1.24-diff-0.15.json new file mode 100644 index 00000000..51387af7 --- /dev/null +++ b/website/static/data/schemas/diffs/1.24/1.24-diff-0.15.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"program_id":{"meta":{"examples":{"left":"TEST-CA","right":"PACA-AU,BR-CA"},"notes":{"left":"This is the unique id that is assigned to your program. If you have logged into the platform, this is the Program Id that you see in the Program Services area. For example, TEST-CA is a Program ID.","right":"This is the unique id that is assigned to your program. If you have logged into the platform, this is the Program Id that you see in the Submission area. For example, PACA-CA is a Program ID."}}},"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":[],"deleted":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n\n const row = $row;\n let result = {valid: true, message: \"Ok\"};\n \n const designation = row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\"){\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when tumour_normal_designation is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when tumour_normal_designation is set to Tumour.\"};\n }\n }\n return result;\n })()"]}}},"submitter_sample_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased"],"right":["Alive","Deceased","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"cause_of_death":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })()"]}}},"survival_time":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })()"]},"range":{"left":{"exclusiveMin":0},"right":null}}},"primary_site":{"meta":{"notes":{"left":"To include multiple values, separate values with a pipe delimiter '|' within your file.","right":null},"examples":{"left":"Breast|Ovary","right":null}},"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Not Reported","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva","Unknown"],"data":{"added":["Not Reported","Unknown"],"deleted":["Unknown primary site"]}}}},"height":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"weight":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"bmi":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"menopause_status":{"description":{"left":"Indicate the donor's menopause status at the time of primary diagnosis. (Reference: caDSR CDE ID 2434914)","right":"Indicate the donor's menopause status at the time of primary diagnosis. (Codelist reference: NCI CDE ID: 2434914)"},"restrictions":{"codeList":{"left":["Not applicable","Perimenopausal","Postmenopausal","Premenopausal","Unknown"],"right":["Indeterminate or unknown","Not applicable","Perimenopausal","Postmenopausal","Premenopausal"],"data":{"added":["Indeterminate or unknown"],"deleted":["Unknown"]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)","right":"Indicate the donor's age of menarche, the first occurrence of menstruation."},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"number_of_pregnancies":{"description":{"left":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)","right":"Indicate the number of pregnancies a donor has had."},"restrictions":{"range":{"left":{"min":0},"right":null}}},"number_of_children":{"description":{"left":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)","right":"Indicate the number of children the donor has birthed."},"restrictions":{"range":{"left":{"min":0},"right":null}}}},"created":{"prior_malignancy":{"changeType":"created","description":"Prior malignancy affecting donor.","name":"prior_malignancy","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy","examples":"C41.1, C16.9, C00.5, D46.9"}},"cancer_type_prior_malignancy":{"changeType":"created","description":"The code to represent the cancer type of a prior malignancy using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","name":"cancer_type_prior_malignancy","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"valueType":"string","meta":{"displayName":"Cancer Type Prior Malignancy"}},"age_at_prior_malignancy":{"changeType":"created","description":"If donor has history of prior malignancy, indicate age at previous diagnosis, in years.","name":"age_at_prior_malignancy","valueType":"integer","meta":{"displayName":"Age at Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"created","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Codelist reference: NCI CDE: 4122391)","name":"laterality_of_prior_malignancy","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality at Prior Malignancy"}}},"deleted":{"genetic_disorders":{"changeType":"deleted","description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},"hrt_type":{"changeType":"deleted","description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},"hrt_duration":{"changeType":"deleted","description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},"contraception_type":{"changeType":"deleted","description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},"contraception_duration":{"changeType":"deleted","description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},"lost_to_followup_after_clinical_event_id":{"changeType":"deleted","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}}},"specimen":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"description":{"left":"Indicate the primary diagnosis event in the clinical timeline that this specimen acquisition was related to.","right":"Indicate the primary diagnosis event in the clinical timeline that this specimen aquisition was related to."},"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"pathological_tumour_staging_system":{"meta":{"validationDependency":{"left":true,"right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"pathological_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"pathological_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"pathological_stage_group":{"description":{"left":"Specify the tumour stage, based on pathological_tumour_staging_system, used to assess the cancer at the time the tumour specimen was resected.","right":"Specify the tumour stage, based on tumour_staging_system, used to assess the cancer at the time the tumour specimen was resected."},"meta":{"notes":{"left":"This field depends on the selected pathological_tumour_staging_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","right":"This field depends on the selected pathological staging system, and is only required if the specimen is a tumour."}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n if ($row.pathological_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.pathological_tumour_staging_system && $row.pathological_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'pathological_tumour_staging_system' is set to '${\n $row.pathological_tumour_staging_system\n }', 'pathological_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })()"]}}},"specimen_acquisition_interval":{"meta":{"notes":{"left":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":"The associated Primary Diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."},"displayName":{"left":"Specimen Acquisition Interval","right":"Specimen Aquisition Interval"}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"data":{"added":[],"deleted":["Unknown"]}}}},"specimen_storage":{"description":{"left":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured.","right":"Indicate the method of specimen storage for specimens that were not extracted freshly or immediately cultured."},"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"data":{"added":[],"deleted":["Unknown"]}}}},"reference_pathology_confirmed":{"description":{"left":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)","right":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. This only applies to clinical studies."}},"tumour_grading_system":{"meta":{"validationDependency":{"left":true,"right":null}}},"tumour_grade":{"meta":{"notes":{"left":"This field depends on the selected tumour_grading_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Grading Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-grading-classifications","right":"This field depends on the selected tumour grading system, and is only required if the specimen is a tumour."}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = \"'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.\";\n result.message = msg;\n }\n }\n return result;\n })()"]}}},"percent_tumour_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)","right":"Indicate a value, in decimals, that represents the percentage of infiltration by tumour cells in a specimen."},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null},"script":{"left":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"],"right":null}}},"percent_proliferating_cells":{"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_inflammatory_tissue":{"description":{"left":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)","right":"Indicate a value, in decimals, that represents local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_stromal_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)","right":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a malignant tumour specimen but are not malignant such as fibroblasts, vascular structures, etc."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_necrosis":{"description":{"left":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)","right":"Indicate a value, in decimals, that represents the percentage of cell death in a malignant tumour specimen."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}}},"created":{},"deleted":{"specimen_laterality":{"changeType":"deleted","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"percent_tumour_cells_measurement_method":{"changeType":"deleted","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"age_at_diagnosis":{"description":{"left":"Age that the donor was first diagnosed with cancer, in years. This should be based on the earliest diagnosis of cancer.","right":"Age that the donor was first diagnosed with cancer, in years."},"restrictions":{"range":{"left":{"exclusiveMin":0,"max":90},"right":null}}},"number_lymph_nodes_examined":{"description":{"left":"The total number of lymph nodes tested for the presence of cancer. (Reference: caDSR CDE ID 3)","right":"The total number of lymph nodes tested for the presence of cancer. (Reference: NCI CDE ID: 3)"},"meta":{"dependsOn":{"left":"primary_diagnosis.lymph_nodes_examined_status","right":null},"notes":{"left":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":null},"range":{"left":{"min":0},"right":null}}},"number_lymph_nodes_positive":{"description":{"left":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: caDSR CDE ID 6113694)","right":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: NCI CDE ID: 6113694)"},"meta":{"dependsOn":{"left":"primary_diagnosis.lymph_nodes_examined_status","right":null},"notes":{"left":"This field is only required if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":null},"range":{"left":{"min":0},"right":null},"required":{"left":null,"right":true}}},"clinical_tumour_staging_system":{"meta":{"validationDependency":{"left":true,"right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}},"required":{"left":null,"right":true}}},"clinical_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"clinical_n_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null}}},"clinical_m_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned.","right":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned."},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"clinical_stage_group":{"description":{"left":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage.","right":"Stage group of the tumour, as assigned by the reporting tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.)."},"meta":{"notes":{"left":"This field is dependent on the selected clinical_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","right":"This field is dependent on the selected clinical_tumour_staging_system"},"examples":{"left":"Stage I, Stage IIB","right":null}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n if ($row.clinical_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'clinical_tumour_staging_system' is set to '${\n $row.clinical_tumour_staging_system\n }', 'clinical_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })()"]}}},"presenting_symptoms":{"restrictions":{"codeList":{"left":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Loss of Appetite","Nausea","None","Not Reported","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Swelling in the Neck","Unknown","Vomiting","Weight Loss"],"right":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Nausea","None","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Unknown","Vomiting","Weight Loss"],"data":{"added":[],"deleted":["Loss of Appetite","Not Reported","Swelling in the Neck"]}}}},"performance_status":{"description":{"left":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status).","right":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference source: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status)."},"meta":{"notes":{"left":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction.\nGrade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work).\nGrade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours.\nGrade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours.\nGrade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair","right":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction \n Grade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work) \n Grade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours \n Grade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours \n Grade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair"}},"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"data":{"added":[],"deleted":["Unknown"]}}}}},"created":{},"deleted":{"cancer_type_additional_information":{"changeType":"deleted","name":"cancer_type_additional_information","valueType":"string","description":"Additional details related to the cancer type that are not covered by the ICD-10 code provided in the cancer_type field.","meta":{"displayName":"Cancer Type Additional Information"}},"laterality":{"changeType":"deleted","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_status":{"changeType":"deleted","name":"lymph_nodes_examined_status","description":"Indicate if lymph nodes were examined for metastases.","valueType":"string","restrictions":{"required":true,"codeList":["Cannot be determined","No","No lymph nodes found in resected specimen","Not applicable","Yes"]},"meta":{"core":true,"displayName":"Lymph Nodes Examined Status"}},"lymph_nodes_examined_method":{"changeType":"deleted","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}}},"treatment":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"treatment_type":{"meta":{"notes":{"left":"Depending on the treatment_type(s) selected, additional treatment details may be required to be submitted. For example, if treatment_type includes 'Chemotherapy', the supplemental Chemotherapy treatment type file is required.\nTo include multiple values, separate values with a pipe delimiter '|' within your file.","right":"Depending on the treatment_type(s) selected, additional treatment details may be required to be submitted. For example, if treatment_type includes 'Chemotherapy', the supplemental Chemotherapy treatment type file is required."},"examples":{"left":"Chemotherapy|Hormonal therapy","right":null}},"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":[],"deleted":["End of life care"]}}}},"is_primary_treatment":{"description":{"left":"Indicate if the treatment was the primary treatment following the initial diagnosis.","right":"Indicate if the treamtment was the primary treatment following the initial diagnosis."},"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"codeList":{"left":["Yes","No"],"right":["Yes","No","Unknown"],"data":{"added":["Unknown"],"deleted":[]}},"required":{"left":null,"right":true}}},"line_of_treatment":{"meta":{"dependsOn":{"left":"treatment.is_primary_treatment","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"],"right":null}}},"treatment_start_interval":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"treatment_duration":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null},"required":{"left":null,"right":true}}},"days_per_cycle":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null}}},"number_of_cycles":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null}}},"toxicity_type":{"description":{"left":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity.","right":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hemotological toxicity or non-hemotological toxicity."},"meta":{"dependsOn":{"left":"treatment.outcome_of_treatment","right":null}},"restrictions":{"codeList":{"left":["Hematological","Non-hematological","Not applicable","Unknown"],"right":["Hemotological","Non-hemotological"],"data":{"added":["Hemotological","Non-hemotological"],"deleted":["Hematological","Non-hematological","Not applicable","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"],"right":null}}},"adverse_events":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null},"notes":{"left":"To include multiple values, separate values with a pipe delimiter '|' within your file.","right":null}},"restrictions":{"codeList":{"left":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"right":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"data":{"added":[],"deleted":["None","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null}}},"clinical_trials_database":{"meta":{"notes":{"left":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added.","right":null}},"restrictions":{"codeList":{"left":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"],"right":["NCI Clinical Trials","EU Clinical Trials Register"],"data":{"added":[],"deleted":["Not applicable","Unknown"]}}}},"clinical_trial_number":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: 'The submitted NCI clinical trial number is in incorrect format.'};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: \"The submitted EudraCT clinical trial number is in incorrect format.\"};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: \"The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database.\"};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: \"'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.\"};\n } \n }\n return result;\n })()"]}}}},"created":{"age_at_consent_for_treatment":{"changeType":"created","name":"age_at_consent_for_treatment","description":"Indicate the age of donor when consent was given for treatment.","valueType":"integer","meta":{"displayName":"Age At Consent For Treatment"}},"therapeutic_intent":{"changeType":"created","name":"therapeutic_intent","description":"The therapeutic intent, the reason behind the choice of a therapy, of the treatment.","valueType":"string","restrictions":{"required":true,"codeList":["Adjuvant","Concurrent","Curative","Neoadjuvant","Not applicable","Palliative","Unknown"]},"meta":{"core":true,"displayName":"Therapeutic Intent"}},"response_to_therapy":{"changeType":"created","name":"response_to_therapy","description":"The donors's response to the applied treatment regimen. (Source: RECIST)","valueType":"string","restrictions":{"required":true,"codeList":["Complete response","Disease progression","NED","Partial response","Stable disease"]},"meta":{"core":true,"displayName":"Response To Therapy"}},"outcome_of_therapy":{"changeType":"created","name":"outcome_of_therapy","description":"Indicate the donor's outcome of the prescribed treatment.","valueType":"string","restrictions":{"codeList":["Treatment completed as prescribed","Treatment incomplete due to technical or organizational problems","Treatment incomplete because patient died","Patient choice (stopped or interrupted treatment)","Physician decision (stopped or interrupted treatment)","Treatment stopped due to lack of efficacy (disease progression)","Treatment stopped due to acute toxicity","Other","Not applicable","Unknown"]},"meta":{"displayName":"Outcome Of Therapy"}},"hemotological_toxicity":{"changeType":"created","name":"hemotological_toxicity","description":"Indicate the hemotological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5"]},"meta":{"displayName":"Hemotological Toxicity"}}},"deleted":{"treatment_intent":{"changeType":"deleted","name":"treatment_intent","description":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"]},"meta":{"core":true,"displayName":"Treatment Intent","dependsOn":"treatment.treatment_type"}},"treatment_setting":{"changeType":"deleted","name":"treatment_setting","description":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: NCIt C124308)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"]},"meta":{"core":true,"displayName":"Treatment Setting","dependsOn":"treatment.treatment_type"}},"response_to_treatment_criteria_method":{"changeType":"deleted","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},"response_to_treatment":{"changeType":"deleted","name":"response_to_treatment","description":"The donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"codeList":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"]},"meta":{"core":true,"displayName":"Response To Treatment","dependsOn":"treatment.response_to_treatment_criteria_method","notes":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"outcome_of_treatment":{"changeType":"deleted","name":"outcome_of_treatment","description":"Indicate the donor's outcome of the prescribed treatment.","valueType":"string","restrictions":{"codeList":["Treatment completed as prescribed","Treatment incomplete due to technical or organizational problems","Treatment incomplete because patient died","Patient choice (stopped or interrupted treatment)","Physician decision (stopped or interrupted treatment)","Treatment stopped due to lack of efficacy (disease progression)","Treatment stopped due to acute toxicity","Other","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Outcome Of Treatment","dependsOn":"treatment.treatment_type"}},"hematological_toxicity":{"changeType":"deleted","name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"non-hematological_toxicity":{"changeType":"deleted","name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"chemotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"dependsOn":{"left":"chemotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"description":{"left":"Name of agent or drug administered to donor as part of the treatment regimen.","right":"Name of agent or drug administered to patient as part of the treatment regimen."},"meta":{"dependsOn":{"left":"chemotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"chemotherapy_dosage_units":{"changeType":"created","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate the total drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"deleted","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"deleted","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"deleted","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"deleted","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"description":{"left":"Name of agent or drug administered to donor as part of the treatment regimen.","right":"Name of agent or drug administered to patient as part of the treatment regimen."},"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"hormone_drug_dosage_units":{"changeType":"created","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"deleted","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"radiation":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"radiation_therapy_fractions":{"description":{"left":"Indicate the total number of fractions delivered as part of treatment.","right":"Indicate the number of total fractions delivered as part of treatment."},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"radiation_therapy_dosage":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"anatomical_site_irradiated":{"description":{"left":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)","right":"Indicate localization site where radiation therapy was administered."},"restrictions":{"codeList":{"left":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"right":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"data":{"added":["Bone","Extremities","Head-Neck","Peritoneum"],"deleted":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"]}}}}},"created":{"radiation_treatment_type":{"changeType":"created","name":"radiation_treatment_type","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal"]},"meta":{"core":true,"displayName":"Application Form","notes":"Internal application includes Brachytherapy."}}},"deleted":{"radiation_therapy_type":{"changeType":"deleted","name":"radiation_therapy_type","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal"]},"meta":{"core":true,"displayName":"Type of Radiation Therapy","notes":"Internal application includes Brachytherapy."}},"radiation_boost":{"changeType":"deleted","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"deleted","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}}},"immunotherapy":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"immunotherapy_type":{"changeType":"deleted","name":"immunotherapy_type","valueType":"string","description":"Indicate the type of immunotherapy administered to donor.","meta":{"displayName":"Immunotherapy Type","core":true},"restrictions":{"required":true,"codeList":["Cell-based","Immune checkpoint inhibitors","Monoclonal antibodies other than immune checkpoint inhibitors","Other immunomodulatory substances"]}},"drug_rxnormcui":{"changeType":"deleted","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"deleted","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"deleted","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"surgery":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"deleted","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"deleted","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"deleted","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"deleted","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"deleted","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"deleted","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"deleted","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"deleted","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"deleted","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"deleted","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"deleted","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"deleted","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"deleted","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"deleted","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}}},"follow_up":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_follow_up_id":{"description":{"left":"Unique identifier for a follow-up event in a donor's clinical record, assigned by the data provider.","right":"Unique identifier for a follow-up event in a donors clincal record, assigned by the data provider."},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"interval_of_followup":{"meta":{"notes":{"left":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":"The associated Primary Diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}}},"disease_status_at_followup":{"description":{"left":"Indicate the donor's disease status at time of follow-up. (Reference: RECIST)","right":"Indicate the donor's disease status at time of follow-up."},"restrictions":{"codeList":{"left":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Progression NOS","Relapse or recurrence","Stable"],"right":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Relapse or recurrence","Stable"],"data":{"added":[],"deleted":["Progression NOS"]}}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"treatment.submitter_treatment_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"weight_at_followup":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"relapse_type":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })()"]}}},"relapse_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })()"]}}},"method_of_progression_status":{"description":{"left":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Reference: caDSR CDE ID 6161031)","right":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Codelist reference: NCI CDE ID: 6161031)"},"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })()"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })()"]}}},"recurrence_t_category":{"description":{"left":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"recurrence_n_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":null,"right":true}}},"recurrence_m_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"core":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"recurrence_stage_group":{"description":{"left":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) at the time of retreatment for a recurrence or disease progression.","right":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery."},"meta":{"notes":{"left":"This field is dependent on the selected recurrence_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","right":"This field is dependent on the selected recurrence_tumour_staging_system."},"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n if ($row.recurrence_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.recurrence_tumour_staging_system && $row.recurrence_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'recurrence_tumour_staging_system' is set to '${\n $row.recurrence_tumour_staging_system\n }', 'recurrence_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })()"]}}},"posttherapy_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"posttherapy_t_category":{"meta":{"dependsOn":{"left":"follow_up.posttherapy_tumour_staging_system","right":"follow_up.post_therapy_tumour_staging_system"}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"posttherapy_n_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"dependsOn":{"left":"follow_up.posttherapy_tumour_staging_system","right":"follow_up.post_therapy_tumour_staging_system"}}},"posttherapy_m_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"dependsOn":{"left":"follow_up.posttherapy_tumour_staging_system","right":"follow_up.post_therapy_tumour_staging_system"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"posttherapy_stage_group":{"meta":{"dependsOn":{"left":"follow_up.posttherapy_tumour_staging_system","right":"follow_up.post_therapy_tumour_staging_system"},"notes":{"left":"This field is dependent on the selected posttherapy_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","right":"This field is dependent on the selected posttherapy_tumour_staging_system."}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n if ($row.posttherapy_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.posttherapy_tumour_staging_system && $row.posttherapy_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'posttherapy_tumour_staging_system' is set to '${\n $row.posttherapy_tumour_staging_system\n }', 'posttherapy_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })()"]}}}},"created":{"anatomic_site_progression_or_recurrences":{"changeType":"created","description":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })()"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1,C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}}},"deleted":{"anatomic_site_progression_or_recurrence":{"changeType":"deleted","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"exposure":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"deleted","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"deleted","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"deleted","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"deleted","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"deleted","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"deleted","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"deleted","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"deleted","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"deleted","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"deleted","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"deleted","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}}},"family_history":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"family_relative_id":{"changeType":"deleted","description":"Unique identifier of the relative, assigned by the data provider.","name":"family_relative_id","valueType":"string","meta":{"displayName":"Family Relative ID","primaryId":true,"notes":"This field is required to ensure that family members are identified in unique records. Ids can be as simple as an incremented numeral to ensure uniqueness."},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"relative_with_cancer_history":{"changeType":"deleted","description":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","name":"relative_with_cancer_history","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Relative with Cancer History"}},"relationship_type":{"changeType":"deleted","description":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","name":"relationship_type","restrictions":{"codeList":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"]},"valueType":"string","meta":{"displayName":"Relationship Type"}},"gender_of_relative":{"changeType":"deleted","description":"The self-reported gender of related individual.","name":"gender_of_relative","restrictions":{"codeList":["Female","Male","Other","Unknown"]},"valueType":"string","meta":{"displayName":"Gender of Relative"}},"age_of_relative_at_diagnosis":{"changeType":"deleted","description":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","name":"age_of_relative_at_diagnosis","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","displayName":"Age Of Relative At Diagnosis"}},"cancer_type_code_of_relative":{"changeType":"deleted","name":"cancer_type_code_of_relative","valueType":"string","description":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"examples":"C41.1,C16.9,C00.5,D46.9","dependsOn":"family_history.relative_with_cancer_history","displayName":"Cancer Type Code (ICD-10) of Relative"}},"relative_vital_status":{"changeType":"deleted","description":"Relative's last known state of living or deceased.","name":"relative_vital_status","restrictions":{"codeList":["Alive","Deceased","Unknown"]},"valueType":"string","meta":{"displayName":"Vital Status of Relative"}},"cause_of_death_of_relative":{"changeType":"deleted","description":"Indicate the cause of the death of the relative.","name":"cause_of_death_of_relative","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]},"valueType":"string","meta":{"dependsOn":"family_history.relative_vital_status","displayName":"Cause of Death of Relative"}},"relative_survival_time":{"changeType":"deleted","description":"Indicate how long, in days, the relative survived from the time they were diagnosed with cancer.","name":"relative_survival_time","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","units":"days","displayName":"Survival Time Of Relative"}}}},"biomarker":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"deleted","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"deleted","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"deleted","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"deleted","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"deleted","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"deleted","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"deleted","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"deleted","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"deleted","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"deleted","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"deleted","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"deleted","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"deleted","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"deleted","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"deleted","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"deleted","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}}},"comorbidity":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"deleted","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"deleted","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"deleted","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"deleted","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"deleted","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"deleted","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}}}}} diff --git a/website/static/data/schemas/diffs/1.24/1.24-diff-0.5.json b/website/static/data/schemas/diffs/1.24/1.24-diff-0.5.json new file mode 100644 index 00000000..d6ef57e1 --- /dev/null +++ b/website/static/data/schemas/diffs/1.24/1.24-diff-0.5.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"program_id":{"meta":{"examples":{"left":"TEST-CA","right":"PACA-AU,BR-CA"},"notes":{"left":"This is the unique id that is assigned to your program. If you have logged into the platform, this is the Program Id that you see in the Program Services area. For example, TEST-CA is a Program ID.","right":null},"displayName":{"left":"Program ID","right":null}}},"submitter_donor_id":{"meta":{"displayName":{"left":"Submitter Donor ID","right":null}}},"gender":{"meta":{"displayName":{"left":"Gender","right":null}}},"submitter_specimen_id":{"meta":{"displayName":{"left":"Submitter Specimen ID","right":null}}},"specimen_tissue_source":{"meta":{"displayName":{"left":"Specimen Tissue Source","right":null}}},"tumour_normal_designation":{"meta":{"displayName":{"left":"Tumour Normal Designation","right":null}}},"specimen_type":{"meta":{"displayName":{"left":"Specimen Type","right":null}},"restrictions":{"codeList":{"left":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Normal","Normal - tissue adjacent to primary tumour","Primary tumour","Primary tumour - adjacent to normal","Primary tumour - additional new primary","Recurrent tumour","Metastatic tumour","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour - additional metastatic","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line","Cell line - derived from xenograft tumour","Cell line - derived from tumour","Cell line - derived from normal"],"data":{"added":[],"deleted":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n\n const row = $row;\n let result = {valid: true, message: \"Ok\"};\n \n const designation = row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\"){\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when tumour_normal_designation is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when tumour_normal_designation is set to Tumour.\"};\n }\n }\n return result;\n })()"]}}},"submitter_sample_id":{"meta":{"displayName":{"left":"Submitter Sample ID","right":null}}},"sample_type":{"meta":{"displayName":{"left":"Sample Type","right":null}}}},"created":{},"deleted":{}},"donor":{"updated":{"program_id":{"meta":{"displayName":{"left":"Program ID","right":null}}},"submitter_donor_id":{"meta":{"displayName":{"left":"Submitter Donor ID","right":null}}},"vital_status":{"meta":{"displayName":{"left":"Vital Status","right":null}},"restrictions":{"codeList":{"left":["Alive","Deceased"],"right":["Alive","Deceased","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"cause_of_death":{"meta":{"displayName":{"left":"Cause of Death","right":null}},"restrictions":{"codeList":{"left":["Died of cancer","Died of other reasons","Unknown"],"right":["Died of cancer","Died of other reasons"],"data":{"added":[],"deleted":["Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })()"]}}},"survival_time":{"meta":{"displayName":{"left":"Survival Time","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })()"]},"range":{"left":{"exclusiveMin":0},"right":null}}},"height":{"valueType":{"left":"number","right":"integer"},"meta":{"displayName":{"left":"Height","right":null}},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"weight":{"valueType":{"left":"number","right":"integer"},"meta":{"displayName":{"left":"Weight","right":null}},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"bmi":{"valueType":{"left":"number","right":"integer"},"meta":{"displayName":{"left":"BMI","right":null}},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"menopause_status":{"description":{"left":"Indicate the donor's menopause status at the time of primary diagnosis. (Reference: caDSR CDE ID 2434914)","right":"Indicate the donor's menopause status at the time of primary diagnosis. (Codelist reference: NCI CDE ID: 2434914)"},"meta":{"displayName":{"left":"Menopause Status","right":null}},"restrictions":{"codeList":{"left":["Not applicable","Perimenopausal","Postmenopausal","Premenopausal","Unknown"],"right":["Premenopausal","Perimenopausal","Postmenopausal","Indeterminate or unknown","Not applicable"],"data":{"added":["Indeterminate or unknown"],"deleted":["Unknown"]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)","right":"Indicate the donor's age of menarche, the first occurrence of menstruation."},"meta":{"displayName":{"left":"Age at Menarche","right":null}},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"number_of_pregnancies":{"description":{"left":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)","right":"Indicate the number of pregnancies a donor has had."},"meta":{"displayName":{"left":"Number of Pregnancies","right":null}},"restrictions":{"range":{"left":{"min":0},"right":null}}},"number_of_children":{"description":{"left":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)","right":"Indicate the number of children the donor has birthed."},"meta":{"displayName":{"left":"Number of Children","right":null}},"restrictions":{"range":{"left":{"min":0},"right":null}}}},"created":{"prior_malignancy":{"changeType":"created","description":"Prior malignancy affecting donor.","name":"prior_malignancy","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string"},"cancer_type_prior_malignancy":{"changeType":"created","description":"ICD-10 diagnostic code for type of cancer in a prior malignancy.","name":"cancer_type_prior_malignancy","restrictions":{"regex":"[A-Z]{1}[0-9]{2}.[0-9]{0,3}[A-Z]{0,1}$"},"valueType":"string"},"age_at_prior_malignancy":{"changeType":"created","description":"If donor has history of prior malignancy, indicate age at previous diagnosis, in years.","name":"age_at_prior_malignancy","valueType":"integer"},"laterality_of_prior_malignancy":{"changeType":"created","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis.","name":"laterality_of_prior_malignancy","valueType":"string"}},"deleted":{"primary_site":{"changeType":"deleted","name":"primary_site","valueType":"string","isArray":true,"description":"The text term used to describe the primary site of disease, as categorized by the World Health Organization's (WHO) International Classification of Diseases for Oncology (ICD-O). This categorization groups cases into general categories.","meta":{"displayName":"Primary Site","core":true,"notes":"To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Breast|Ovary"},"restrictions":{"required":true,"codeList":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"]}},"genetic_disorders":{"changeType":"deleted","description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},"hrt_type":{"changeType":"deleted","description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},"hrt_duration":{"changeType":"deleted","description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},"contraception_type":{"changeType":"deleted","description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},"contraception_duration":{"changeType":"deleted","description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},"lost_to_followup_after_clinical_event_id":{"changeType":"deleted","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}}},"specimen":{"updated":{"program_id":{"meta":{"displayName":{"left":"Program ID","right":null}}},"submitter_donor_id":{"meta":{"displayName":{"left":"Submitter Donor ID","right":null}}},"submitter_specimen_id":{"meta":{"displayName":{"left":"Submitter Specimen ID","right":null}}},"pathological_tumour_staging_system":{"meta":{"validationDependency":{"left":true,"right":null},"displayName":{"left":"Pathological Tumour Staging System","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate() {\n\n let result = {valid: true, message: \"Ok\"};\n \n /* This is not a required field, so first ensure that it exists */\n if ($field){\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name.trim().toLowerCase().split('_tumour_staging_system')[0];\n /* Perform validation only if an AJCC value was selected */\n if (/^(AJCC)\\b/i.test($field)){\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`\n ];\n const convertedRow = Object.fromEntries(Object.entries($row).map(([fieldName,fieldVal]) => [fieldName.toLowerCase(), fieldVal]));\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(field => Object.keys(convertedRow).includes(field) && (!convertedRow[field] || checkforEmpty(convertedRow[field])))\n if (emptyFields.length){\n result = {valid: false, \"message\": `The following fields are required when ${$name} is set to an AJCC option: ${emptyFields}`};\n }\n }\n }\n return result;\n })()"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"data":{"added":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"deleted":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"]}}}},"pathological_t_category":{"meta":{"displayName":{"left":"Pathological T Category","right":null}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":null,"data":{"added":[],"deleted":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"]}}}},"pathological_n_category":{"meta":{"displayName":{"left":"Pathological N Category","right":null}},"restrictions":{"codeList":{"left":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"],"right":null,"data":{"added":[],"deleted":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"]}}}},"pathological_m_category":{"meta":{"displayName":{"left":"Pathological M Category","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":null,"data":{"added":[],"deleted":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"]}}}},"pathological_stage_group":{"description":{"left":"Specify the tumour stage, based on pathological_tumour_staging_system, used to assess the cancer at the time the tumour specimen was resected.","right":"Specify the tumour stage, based on tumor_staging_system, used to assess the cancer at the time the tumour specimen was resected."},"meta":{"notes":{"left":"This field depends on the selected pathological_tumour_staging_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","right":null},"displayName":{"left":"Pathological Stage Group","right":null}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":null,"data":{"added":[],"deleted":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":null}}},"specimen_acquisition_interval":{"meta":{"notes":{"left":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":null},"displayName":{"left":"Specimen Acquisition Interval","right":null}}},"tumour_histological_type":{"description":{"left":"The code to represent the histology (morphology) of neoplasms that is usually obtained from a pathology report, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","right":"The code to represent the histology (morphology) of neoplasms that is usually obtained from a pathology report, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Please refer to the guidelines provided in the ICD-O-3 manual at https://apps.who.int/iris/handle/10665/42344."},"meta":{"validationDependency":{"left":true,"right":null},"displayName":{"left":"Tumour Histological Type","right":null}}},"specimen_anatomic_location":{"description":{"left":"Indicate the ICD-O-3 topography code for the anatomic location of a specimen when it was collected. Refer to the guidelines provided in the ICD-O-3 manual at https://apps.who.int/iris/handle/10665/42344.","right":"Anatomic location of a specimen when it was collected."},"meta":{"displayName":{"left":"Specimen Anatomic Location","right":null},"examples":{"left":"C50.1,C18","right":null}},"restrictions":{"regex":{"left":"^[C][0-9]{2}(.[0-9]{1})?$","right":null},"codeList":{"right":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear, pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal; distal","Esophageal; mid","Esophageal; proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck, NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es), maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"],"data":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear, pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal; distal","Esophageal; mid","Esophageal; proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck, NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es), maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"]}}},"specimen_processing":{"meta":{"displayName":{"left":"Specimen Processing","right":null}},"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation, other","Formalin fixed & paraffin embedded","Formalin fixed, buffered","Formalin fixed, unbuffered","Fresh","Other"],"data":{"added":["Cryopreservation, other","Formalin fixed, buffered","Formalin fixed, unbuffered"],"deleted":["Cryopreservation - other","Formalin fixed - buffered","Formalin fixed - unbuffered","Unknown"]}}}},"specimen_storage":{"description":{"left":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured.","right":"Indicate the method of specimen storage for specimens that were not extracted freshly or immediately cultured."},"meta":{"displayName":{"left":"Specimen Storage","right":null}},"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"right":["Cut slide","Frozen, -70 freezer","Frozen, liquid nitrogen","Frozen, vapor phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"data":{"added":["Frozen, -70 freezer","Frozen, liquid nitrogen","Frozen, vapor phase"],"deleted":["Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Unknown"]}}}},"tumour_grading_system":{"meta":{"validationDependency":{"left":true,"right":null},"displayName":{"left":"Tumour Grading System","right":null}},"restrictions":{"codeList":{"left":["FNCLCC grading system","Four-tier grading system","Gleason grade group system","Grading system for GISTs","Grading system for GNETs","ISUP grading system","Nuclear grading system for DCIS","Scarff-Bloom-Richardson grading system","Three-tier grading system","Two-tier grading system","WHO grading system for CNS tumours"],"right":["Default","Gleason","Nottingham","Brain cancer","ISUP","Lymphoid neoplasms"],"data":{"added":["Default","Gleason","Nottingham","Brain cancer","ISUP","Lymphoid neoplasms"],"deleted":["FNCLCC grading system","Four-tier grading system","Gleason grade group system","Grading system for GISTs","Grading system for GNETs","ISUP grading system","Nuclear grading system for DCIS","Scarff-Bloom-Richardson grading system","Three-tier grading system","Two-tier grading system","WHO grading system for CNS tumours"]}}}},"tumour_grade":{"meta":{"notes":{"left":"This field depends on the selected tumour_grading_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Grading Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-grading-classifications","right":"This field depends on the selected tumour grading system."},"displayName":{"left":"Tumour Grade","right":null}},"restrictions":{"codeList":{"left":["Low grade","High grade","GX","G1","G2","G3","G4","Low","High","Grade I","Grade II","Grade III","Grade IV","Grade Group 1","Grade Group 2","Grade Group 3","Grade Group 4","Grade Group 5"],"data":["Low grade","High grade","GX","G1","G2","G3","G4","Low","High","Grade I","Grade II","Grade III","Grade IV","Grade Group 1","Grade Group 2","Grade Group 3","Grade Group 4","Grade Group 5"]},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'default':\n codeList = [\n 'gx - cannot be assessed',\n 'g1 well differentiated/low grade',\n 'g2 moderately differentiated/intermediated grade',\n 'g3 poorly differentiated/high grade',\n 'g4 undifferentiated/high grade',\n ];\n break;\n case 'gleason':\n codeList = [\n 'gleason x: gleason score cannot be determined',\n 'gleason 2–6: the tumor tissue is well differentiated',\n 'gleason 7: the tumor tissue is moderately differentiated',\n 'gleason 8–10: the tumor tissue is poorly differentiated or undifferentiated',\n ];\n break;\n case 'nottingham':\n codeList = [\n 'g1 (low grade or well differentiated)',\n 'g2 (intermediate grade or moderately differentiated)',\n 'g3 (high grade or poorly differentiated)',\n ];\n break;\n case 'brain cancer':\n codeList = ['grade i', 'grade ii', 'grade iii', 'grade iv'];\n break;\n case 'isup for renal cell carcinoma':\n codeList = [\n 'grade 1: tumor cell nucleoli invisible or small and basophilic at 400 x magnification',\n 'grade 2: tumor cell nucleoli conspicuous at 400 x magnification but inconspicuous at 100 x magnification',\n 'grade 3: tumor cell nucleoli eosinophilic and clearly visible at 100 x magnification',\n 'grade 4: tumors showing extreme nuclear pleomorphism and/or containing tumor giant cells and/or the presence of any proportion of tumor showing sarcomatoid and/or rhabdoid dedifferentiation',\n ];\n break;\n case 'lymphoid neoplasms':\n codeList = ['low grade or indolent nhl', 'high grade or aggressive nhl'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList.join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })()"]}}},"percent_tumour_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)","right":"Indicate a value, in decimals, that represents the percentage of infiltration by tumour cells in a specimen."},"meta":{"displayName":{"left":"Percent Tumour Cells","right":null}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null},"script":{"left":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"],"right":null}}},"percent_proliferating_cells":{"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"displayName":{"left":"Percent Proliferating Cells","right":null},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_inflammatory_tissue":{"description":{"left":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)","right":"Indicate a value, in decimals, that represents local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"displayName":{"left":"Percent Inflammatory Tissue","right":null},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_stromal_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)","right":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a malignant tumour specimen but are not malignant such as fibroblasts, vascular structures, etc."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"displayName":{"left":"Percent Stromal Cells","right":null},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_necrosis":{"description":{"left":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)","right":"Indicate a value, in decimals, that represents the percentage of cell death in a malignant tumour specimen."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"displayName":{"left":"Percent Necrosis","right":null},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}}},"created":{"central_pathology_confirmed":{"changeType":"created","name":"central_pathology_confirmed","description":"Indicate whether the histologic description of tissue or cells was confirmed by a pathology review of frozen or formalin fixed slide(s) completed after the diagnostic pathology review of the tumour sample used to extract analyte(s).","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour."},"restrictions":{"codeList":["Yes","No","Unknown"]}}},"deleted":{"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate the primary diagnosis event in the clinical timeline that this specimen acquisition was related to.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"specimen_laterality":{"changeType":"deleted","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"reference_pathology_confirmed":{"changeType":"deleted","name":"reference_pathology_confirmed","description":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)","valueType":"string","meta":{"validationDependency":true,"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Reference Pathology Confirmed"},"restrictions":{"codeList":["Yes","No","Unknown"]}},"percent_tumour_cells_measurement_method":{"changeType":"deleted","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}}},"primary_diagnosis":{"updated":{"program_id":{"meta":{"displayName":{"left":"Program ID","right":null}}},"submitter_donor_id":{"meta":{"displayName":{"left":"Submitter Donor ID","right":null}}},"age_at_diagnosis":{"description":{"left":"Age that the donor was first diagnosed with cancer, in years. This should be based on the earliest diagnosis of cancer.","right":"Age that the donor was first diagnosed with cancer, in years."},"meta":{"displayName":{"left":"Age at Diagnosis","right":null}},"restrictions":{"range":{"left":{"exclusiveMin":0,"max":90},"right":null}}},"cancer_type_code":{"description":{"left":"The code to represent the cancer type using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","right":"The code to represent the cancer type using the WHO ICD-10 code (https://icd.who.int/browse10/2016/en#/) classification."},"meta":{"examples":{"left":"C41.1,C16.9,C00.5,D46.9","right":null},"displayName":{"left":"Cancer Type Code","right":null}},"restrictions":{"regex":{"left":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","right":"[A-Z]{1}[0-9]{2}.[0-9]{0,3}[A-Z]{0,1}$"}}},"number_lymph_nodes_examined":{"description":{"left":"The total number of lymph nodes tested for the presence of cancer. (Reference: caDSR CDE ID 3)","right":"The total number of lymph nodes tested for the presence of cancer. (Reference: NCI CDE ID: 3)"},"meta":{"displayName":{"left":"Number Of Lymph Nodes Examined","right":null},"dependsOn":{"left":"primary_diagnosis.lymph_nodes_examined_status","right":null},"notes":{"left":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":null},"range":{"left":{"min":0},"right":null}}},"number_lymph_nodes_positive":{"description":{"left":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: caDSR CDE ID 6113694)","right":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: NCI CDE ID: 6113694)"},"meta":{"displayName":{"left":"Number Of Lymph Nodes Positive","right":null},"dependsOn":{"left":"primary_diagnosis.lymph_nodes_examined_status","right":null},"notes":{"left":"This field is only required if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":null},"range":{"left":{"min":0},"right":null},"required":{"left":null,"right":true}}},"clinical_tumour_staging_system":{"meta":{"validationDependency":{"left":true,"right":null},"displayName":{"left":"Clinical Tumour Staging System","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate() {\n\n let result = {valid: true, message: \"Ok\"};\n \n /* This is not a required field, so first ensure that it exists */\n if ($field){\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name.trim().toLowerCase().split('_tumour_staging_system')[0];\n /* Perform validation only if an AJCC value was selected */\n if (/^(AJCC)\\b/i.test($field)){\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`\n ];\n const convertedRow = Object.fromEntries(Object.entries($row).map(([fieldName,fieldVal]) => [fieldName.toLowerCase(), fieldVal]));\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(field => Object.keys(convertedRow).includes(field) && (!convertedRow[field] || checkforEmpty(convertedRow[field])))\n if (emptyFields.length){\n result = {valid: false, \"message\": `The following fields are required when ${$name} is set to an AJCC option: ${emptyFields}`};\n }\n }\n }\n return result;\n })()"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"data":{"added":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"deleted":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"]}},"required":{"left":null,"right":true}}},"clinical_t_category":{"meta":{"displayName":{"left":"Clinical T Category","right":null}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":null,"data":{"added":[],"deleted":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"]}}}},"clinical_n_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"displayName":{"left":"Clinical N Category","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"],"right":null,"data":{"added":[],"deleted":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"]}}}},"clinical_m_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned.","right":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned."},"meta":{"displayName":{"left":"Clinical M Category","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":null,"data":{"added":[],"deleted":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"]}}}},"clinical_stage_group":{"description":{"left":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage.","right":"Stage group of the tumour, as assigned by the reporting tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.)."},"meta":{"notes":{"left":"This field is dependent on the selected clinical_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","right":null},"displayName":{"left":"Clinical Stage Group","right":null},"examples":{"left":"Stage I, Stage IIB","right":null}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"presenting_symptoms":{"meta":{"displayName":{"left":"Presenting Symptoms","right":null},"notes":{"left":"To include multiple values, separate values with a pipe delimiter '|' within your file.","right":null},"examples":{"left":"Anemia|Bloating|Diabetes","right":null}},"restrictions":{"codeList":{"left":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Loss of Appetite","Nausea","None","Not Reported","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Swelling in the Neck","Unknown","Vomiting","Weight Loss"],"right":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Nausea","None","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Unknown","Vomiting","Weight Loss"],"data":{"added":[],"deleted":["Loss of Appetite","Not Reported","Swelling in the Neck"]}}}},"performance_status":{"description":{"left":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status).","right":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference source: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status)."},"meta":{"notes":{"left":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction.\nGrade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work).\nGrade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours.\nGrade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours.\nGrade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair","right":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction \n Grade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work) \n Grade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours \n Grade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours \n Grade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair"},"displayName":{"left":"Performance Status","right":null}},"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"data":{"added":[],"deleted":["Unknown"]}}}}},"created":{"stage_suffix":{"changeType":"created","name":"stage_suffix","description":"If necessary, use this field to add any applicable stage suffixes. Stage suffixes may apply to certain staging systems such as Ann Arbour staging system where the four stages are divided into 4 categories (A, B, X and E).","valueType":"string","meta":{"core":true,"dependsOn":"primary_diagnosis.clinical_tumour_staging_system"}}},"deleted":{"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Unique identifier of the primary diagnosis event, assigned by the data provider.","meta":{"primaryId":true,"displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"cancer_type_additional_information":{"changeType":"deleted","name":"cancer_type_additional_information","valueType":"string","description":"Additional details related to the cancer type that are not covered by the ICD-10 code provided in the cancer_type field.","meta":{"displayName":"Cancer Type Additional Information"}},"basis_of_diagnosis":{"changeType":"deleted","name":"basis_of_diagnosis","description":"Indicate the most valid basis of how the primary diagnosis was identified. If more than one diagnosis technique was used, select the term that has the highest code number (see notes). (Reference: IACR Standard for Basis of Diagnosis http://www.iacr.com.fr/images/doc/basis.pdf)","restrictions":{"codeList":["Clinical investigation","Clinical","Cytology","Death certificate only","Histology of a metastasis","Histology of a primary tumour","Specific tumour markers","Unknown"]},"valueType":"string","meta":{"notes":"0: Death certificate only: Information provided is from a death certificate.\n1: Clinical: Diagnosis made before death.\n2: Clinical investigation: All diagnostic techniques, including X-ray, endoscopy, imaging, ultrasound, exploratory surgery (such as laparotomy), and autopsy, without a tissue diagnosis.\n4: Specific tumour markers: Including biochemical and/or immunologic markers that are specific for a tumour site.\n5: Cytology: Examination of cells from a primary or secondary site, including fluids aspirated by endoscopy or needle; also includes the microscopic examination of peripheral blood and bone marrow aspirates.\n6: Histology of a metastasis: Histologic examination of tissue from a metastasis, including autopsy specimens.\n7: Histology of a primary tumour: Histologic examination of tissue from primary tumour, however obtained, including all cutting techniques and bone marrow biopsies; also includes autopsy specimens of primary tumour.\n9: Unknown: No information on how the diagnosis has been made.","displayName":"Basis of Diagnosis"}},"laterality":{"changeType":"deleted","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_status":{"changeType":"deleted","name":"lymph_nodes_examined_status","description":"Indicate if lymph nodes were examined for metastases.","valueType":"string","restrictions":{"required":true,"codeList":["Cannot be determined","No","No lymph nodes found in resected specimen","Not applicable","Yes"]},"meta":{"core":true,"displayName":"Lymph Nodes Examined Status"}},"lymph_nodes_examined_method":{"changeType":"deleted","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}}},"treatment":{"updated":{"program_id":{"meta":{"displayName":{"left":"Program ID","right":null}}},"submitter_donor_id":{"meta":{"displayName":{"left":"Submitter Donor ID","right":null}}},"submitter_treatment_id":{"meta":{"displayName":{"left":"Submitter Treatment ID","right":null}}},"treatment_type":{"meta":{"notes":{"left":"Depending on the treatment_type(s) selected, additional treatment details may be required to be submitted. For example, if treatment_type includes 'Chemotherapy', the supplemental Chemotherapy treatment type file is required.\nTo include multiple values, separate values with a pipe delimiter '|' within your file.","right":"Depending on the treatment_type selected, additional treament details may be required to be submitted."},"displayName":{"left":"Treatment Type","right":null},"examples":{"left":"Chemotherapy|Hormonal therapy","right":null}},"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Chemotherapy","Ablation","Bone marrow transplant","Combined chemo+immunotherapy","Combined chemo+radiation therapy","Combined chemo-radiotherapy and surgery","Endoscopic therapy","Hormonal therapy","Immunotherapy","Monoclonal antibodies (for liquid tumours)","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgical resection"],"data":{"added":["Combined chemo+immunotherapy","Combined chemo+radiation therapy","Combined chemo-radiotherapy and surgery","Monoclonal antibodies (for liquid tumours)","Surgical resection"],"deleted":["End of life care","Surgery"]}}}},"is_primary_treatment":{"description":{"left":"Indicate if the treatment was the primary treatment following the initial diagnosis.","right":"Indicate if the treamtment was the primary treatment following the initial diagnosis."},"meta":{"displayName":{"left":"Is Primary Treatment","right":null},"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"codeList":{"left":["Yes","No"],"right":["Yes","No","Unknown"],"data":{"added":["Unknown"],"deleted":[]}},"required":{"left":null,"right":true}}},"treatment_start_interval":{"description":{"left":"The interval between the primary diagnosis and initiation of treatment, in days.","right":"The interval between primary diagnosis and initiation of treatment, in days."},"meta":{"notes":{"left":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":null},"displayName":{"left":"Treatment Start Interval","right":null},"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"treatment_duration":{"description":{"left":"The duration of treatment regimen, in days.","right":"The duration of treatment regimen, in days"},"meta":{"displayName":{"left":"Treatment Duration","right":null},"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null},"required":{"left":null,"right":true}}}},"created":{"age_at_consent_for_treatment":{"changeType":"created","name":"age_at_consent_for_treatment","description":"Indicate the age of donor when consent was given for treatment.","valueType":"integer"},"therapeutic_intent":{"changeType":"created","name":"therapeutic_intent","description":"The therapeutic intent, the reason behind the choice of a therapy, of the treatment.","valueType":"string","restrictions":{"required":true,"codeList":["Adjuvant","Concurrent","Curative","Neoadjuvant","Not applicable","Palliative","Unknown"]},"meta":{"core":true}},"response_to_therapy":{"changeType":"created","name":"response_to_therapy","description":"The donors's response to the applied treatment regimen. (Source: RECIST)","valueType":"string","restrictions":{"required":true,"codeList":["Complete response","Disease progression","NED","Partial response","Stable disease"]},"meta":{"core":true}}},"deleted":{"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate the primary diagnosis event in the clinical timeline that this treatment was related to.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"line_of_treatment":{"changeType":"deleted","name":"line_of_treatment","description":"Indicate the line of treatment if it is not the primary treatment.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Line Of treatment","dependsOn":"treatment.is_primary_treatment","examples":"2,3,4"}},"days_per_cycle":{"changeType":"deleted","name":"days_per_cycle","description":"Indicate the number of days in a treatment cycle.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Days Per Cycle","dependsOn":"treatment.treatment_type"}},"number_of_cycles":{"changeType":"deleted","name":"number_of_cycles","description":"Indicate the number of treatment cycles.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Number Of Cycles","dependsOn":"treatment.treatment_type"}},"treatment_intent":{"changeType":"deleted","name":"treatment_intent","description":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"]},"meta":{"core":true,"displayName":"Treatment Intent","dependsOn":"treatment.treatment_type"}},"treatment_setting":{"changeType":"deleted","name":"treatment_setting","description":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: NCIt C124308)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"]},"meta":{"core":true,"displayName":"Treatment Setting","dependsOn":"treatment.treatment_type"}},"response_to_treatment_criteria_method":{"changeType":"deleted","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},"response_to_treatment":{"changeType":"deleted","name":"response_to_treatment","description":"The donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"codeList":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"]},"meta":{"core":true,"displayName":"Response To Treatment","dependsOn":"treatment.response_to_treatment_criteria_method","notes":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"outcome_of_treatment":{"changeType":"deleted","name":"outcome_of_treatment","description":"Indicate the donor's outcome of the prescribed treatment.","valueType":"string","restrictions":{"codeList":["Treatment completed as prescribed","Treatment incomplete due to technical or organizational problems","Treatment incomplete because patient died","Patient choice (stopped or interrupted treatment)","Physician decision (stopped or interrupted treatment)","Treatment stopped due to lack of efficacy (disease progression)","Treatment stopped due to acute toxicity","Other","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Outcome Of Treatment","dependsOn":"treatment.treatment_type"}},"toxicity_type":{"changeType":"deleted","name":"toxicity_type","description":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity.","valueType":"string","restrictions":{"codeList":["Hematological","Non-hematological","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Toxicity Type","dependsOn":"treatment.outcome_of_treatment"}},"hematological_toxicity":{"changeType":"deleted","name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"non-hematological_toxicity":{"changeType":"deleted","name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"adverse_events":{"changeType":"deleted","name":"adverse_events","description":"Report any treatment related adverse events. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Adverse Events","dependsOn":"treatment.treatment_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"clinical_trials_database":{"changeType":"deleted","name":"clinical_trials_database","description":"If the donor is a participant in a clinical trial, indicate the clinical trial database where the clinical trial is registered.","valueType":"string","meta":{"display name":"Clinical Trials Database","notes":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added."},"restrictions":{"codeList":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"]}},"clinical_trial_number":{"changeType":"deleted","name":"clinical_trial_number","description":"Based on the clinical_trial_database, indicate the unique NCT or EudraCT clinical trial identifier of which the donor is a participant.","valueType":"string","meta":{"display name":"Clinical Trial Number","dependsOn":"treatment.clinical_trials_database","examples":"2016-002120-83,NCT02465060"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"]}}}},"chemotherapy":{"updated":{"program_id":{"meta":{"displayName":{"left":"Program ID","right":null}}},"submitter_donor_id":{"meta":{"displayName":{"left":"Submitter Donor ID","right":null}}},"submitter_treatment_id":{"meta":{"displayName":{"left":"Submitter Treatment ID","right":null}}}},"created":{"chemotherapy_drug_name":{"changeType":"created","name":"chemotherapy_drug_name","description":"Name of agent or drug administered to patient as part of the chemotherapy treatment regimen.","valueType":"string","restrictions":{"required":true,"codeList":["Placeholder list 1","Need list","Still need it"]},"meta":{"validationDependency":true,"core":true,"notes":"This field uses a controlled vocabulary gathered from the DrugBank database of drug names.","examples":"Allopurinol, Dronabinol, Sucralfate, Lapatinib"}},"chemotherapy_dosage_units":{"changeType":"created","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m²","IU/m²","µg/m²","g/m²","kg"]},"meta":{"core":true}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate the total drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"integer","restrictions":{"required":true},"meta":{"core":true}}},"deleted":{"drug_rxnormcui":{"changeType":"deleted","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"deleted","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"deleted","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"deleted","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"deleted","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"deleted","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}}},"hormone_therapy":{"updated":{"program_id":{"meta":{"displayName":{"left":"Program ID","right":null}}},"submitter_donor_id":{"meta":{"displayName":{"left":"Submitter Donor ID","right":null}}},"submitter_treatment_id":{"meta":{"displayName":{"left":"Submitter Treatment ID","right":null}}}},"created":{"hormone_therapy_drug_name":{"changeType":"created","name":"hormone_therapy_drug_name","description":"Name of agent or drug administered to patient as part of the hormone therapy treatment regimen.","valueType":"string","restrictions":{"required":true,"codeList":["Placeholder list 1","Need list","Still need it"]},"meta":{"validationDependency":true,"core":true,"notes":"This field uses a controlled vocabulary gathered from the DrugBank database of drug names."}},"hormone_drug_dosage_units":{"changeType":"created","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m²","IU/m²","µg/m²","g/m²","kg "]},"meta":{"core":true}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"integer","restrictions":{"required":true},"meta":{"core":true}}},"deleted":{"drug_rxnormcui":{"changeType":"deleted","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"deleted","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Hormone Therapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"deleted","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"radiation":{"updated":{"program_id":{"meta":{"displayName":{"left":"Program ID","right":null}}},"submitter_donor_id":{"meta":{"displayName":{"left":"Submitter Donor ID","right":null}}},"submitter_treatment_id":{"meta":{"displayName":{"left":"Submitter Treatment ID","right":null}}},"radiation_therapy_modality":{"meta":{"displayName":{"left":"Radiation Therapy Modality","right":null}}},"radiation_therapy_fractions":{"description":{"left":"Indicate the total number of fractions delivered as part of treatment.","right":"Indicate the number of total fractions delivered as part of treatment."},"meta":{"displayName":{"left":"Radiation Therapy Fractions","right":null}},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"radiation_therapy_dosage":{"valueType":{"left":"number","right":"integer"},"meta":{"displayName":{"left":"Radiation Therapy Dosage","right":null}},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"anatomical_site_irradiated":{"description":{"left":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)","right":"Indicate localization site where radiation therapy was administered."},"meta":{"displayName":{"left":"Anatomical Site Irradiated","right":null}},"restrictions":{"codeList":{"left":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"right":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"data":{"added":["Bone","Extremities","Head-Neck","Peritoneum"],"deleted":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"]}}}}},"created":{"application_form":{"changeType":"created","name":"application_form","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal (including Brachytherapy)"]},"meta":{"core":true}}},"deleted":{"radiation_therapy_type":{"changeType":"deleted","name":"radiation_therapy_type","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal"]},"meta":{"core":true,"displayName":"Type of Radiation Therapy","notes":"Internal application includes Brachytherapy."}},"radiation_boost":{"changeType":"deleted","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"deleted","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}}},"immunotherapy":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"immunotherapy_type":{"changeType":"deleted","name":"immunotherapy_type","valueType":"string","description":"Indicate the type of immunotherapy administered to donor.","meta":{"displayName":"Immunotherapy Type","core":true},"restrictions":{"required":true,"codeList":["Cell-based","Immune checkpoint inhibitors","Monoclonal antibodies other than immune checkpoint inhibitors","Other immunomodulatory substances"]}},"drug_rxnormcui":{"changeType":"deleted","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"deleted","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"deleted","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"surgery":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"deleted","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"deleted","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"deleted","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"deleted","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"deleted","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"deleted","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"deleted","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"deleted","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"deleted","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"deleted","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"deleted","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"deleted","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"deleted","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"deleted","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}}},"follow_up":{"updated":{"program_id":{"meta":{"displayName":{"left":"Program ID","right":null}}},"submitter_donor_id":{"meta":{"displayName":{"left":"Submitter Donor ID","right":null}}},"submitter_follow_up_id":{"description":{"left":"Unique identifier for a follow-up event in a donor's clinical record, assigned by the data provider.","right":"Unique identifier for a follow-up event in a donors clincal record, assigned by the data provider."},"meta":{"displayName":{"left":"Submitter Follow-Up ID","right":null}}},"interval_of_followup":{"description":{"left":"Interval from the primary diagnosis date to the follow-up date, in days.","right":"Interval from the primary diagnosis date to the follow up date, in days."},"meta":{"displayName":{"left":"Interval Of Follow-Up","right":null},"notes":{"left":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":null}}},"disease_status_at_followup":{"description":{"left":"Indicate the donor's disease status at time of follow-up. (Reference: RECIST)","right":"Indicate the donor's disease status at time of follow-up."},"meta":{"displayName":{"left":"Disease Status at Follow-Up","right":null}},"restrictions":{"codeList":{"left":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Progression NOS","Relapse or recurrence","Stable"],"right":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Relapse","Stable"],"data":{"added":["Relapse"],"deleted":["Progression NOS","Relapse or recurrence"]}}}},"relapse_type":{"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.","right":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse."},"displayName":{"left":"Relapse Type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":null}}},"relapse_interval":{"description":{"left":"If the donor was clinically disease free following primary treatment and then relapse or recurrence or progression (for liquid tumours) occurred afterwards, then this field will indicate the length of disease free interval, in days.","right":"If the donor was clinically disease free following primary treatment and then relapse or progression (for liquid tumours) occurred afterwards, then this field will indicate the length of disease free interval, in days."},"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.","right":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse."},"displayName":{"left":"Relapse Interval","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"]}}},"method_of_progression_status":{"description":{"left":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Reference: caDSR CDE ID 6161031)","right":"Indicate the method(s) used to confirm the donor's progression disease status. (Codelist reference: NCI CDE ID: 6161031)"},"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file.","right":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse."},"displayName":{"left":"Method Of Progression Status","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"]},"codeList":{"left":["Biomarker in liquid biopsy (e.g. tumour marker in blood or urine)","Biopsy","Blood draw","Bone marrow aspirate","Core biopsy","Cystoscopy","Cytology","Debulking","Diagnostic imaging","Dilation and curettage procedure","Enucleation","Excisional biopsy","Fine needle aspiration","Imaging","Incisional biopsy","Laparoscopy","Laparotomy","Other","Pap Smear","Pathologic review","Physical exam","Surgical resection","Thoracentesis","Ultrasound guided biopsy"],"right":["Autopsy","Biomarker in liquid biopsy (e.g. tumor marker in blood or urine)","Biopsy","Blood draw","Bone marrow aspirate","Core biopsy","Cystoscopy","Cytology","Debulking","Diagnostic imaging","Dilation and curettage procedure","Enucleation","Excisional biopsy","Fine needle aspiration","Imaging","Incisional biopsy","Laparoscopy","Laparotomy","Other","Pap Smear","Pathologic review","Physical exam","Surgical resection","Thoracentesis","Ultrasound guided biopsy"],"data":{"added":["Autopsy","Biomarker in liquid biopsy (e.g. tumor marker in blood or urine)"],"deleted":["Biomarker in liquid biopsy (e.g. tumour marker in blood or urine)"]}}}},"recurrence_tumour_staging_system":{"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.","right":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse."},"displayName":{"left":"Recurrance Tumour Staging System","right":null},"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"data":{"added":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"deleted":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n\n let result = {valid: true, message: \"Ok\"};\n \n /* This is not a required field, so first ensure that it exists */\n if ($field){\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name.trim().toLowerCase().split('_tumour_staging_system')[0];\n /* Perform validation only if an AJCC value was selected */\n if (/^(AJCC)\\b/i.test($field)){\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`\n ];\n const convertedRow = Object.fromEntries(Object.entries($row).map(([fieldName,fieldVal]) => [fieldName.toLowerCase(), fieldVal]));\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(field => Object.keys(convertedRow).includes(field) && (!convertedRow[field] || checkforEmpty(convertedRow[field])))\n if (emptyFields.length){\n result = {valid: false, \"message\": `The following fields are required when ${$name} is set to an AJCC option: ${emptyFields}`};\n }\n }\n }\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"]}}},"recurrence_t_category":{"description":{"left":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"displayName":{"left":"Recurrence T Category","right":null},"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":null,"data":{"added":[],"deleted":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"]}}}},"recurrence_n_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"displayName":{"left":"Recurrence N Category","right":null},"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"],"right":null,"data":{"added":[],"deleted":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"]}}}},"recurrence_m_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"displayName":{"left":"Recurrence M Category","right":null},"core":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":null,"data":{"added":[],"deleted":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"]}}}},"recurrence_stage_group":{"description":{"left":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) at the time of retreatment for a recurrence or disease progression.","right":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery."},"meta":{"notes":{"left":"This field is dependent on the selected recurrence_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","right":null},"displayName":{"left":"Recurrence Stage Group","right":null},"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":null,"data":{"added":[],"deleted":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":null}}},"posttherapy_tumour_staging_system":{"meta":{"displayName":{"left":"Post-therapy Tumour Staging System","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate() {\n\n let result = {valid: true, message: \"Ok\"};\n \n /* This is not a required field, so first ensure that it exists */\n if ($field){\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name.trim().toLowerCase().split('_tumour_staging_system')[0];\n /* Perform validation only if an AJCC value was selected */\n if (/^(AJCC)\\b/i.test($field)){\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`\n ];\n const convertedRow = Object.fromEntries(Object.entries($row).map(([fieldName,fieldVal]) => [fieldName.toLowerCase(), fieldVal]));\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(field => Object.keys(convertedRow).includes(field) && (!convertedRow[field] || checkforEmpty(convertedRow[field])))\n if (emptyFields.length){\n result = {valid: false, \"message\": `The following fields are required when ${$name} is set to an AJCC option: ${emptyFields}`};\n }\n }\n }\n return result;\n })()"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"data":{"added":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"deleted":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"]}}}},"posttherapy_t_category":{"meta":{"dependsOn":{"left":"follow_up.posttherapy_tumour_staging_system","right":"follow_up.post_therapy_tumour_staging_system"},"displayName":{"left":"Post-therapy T Category","right":null}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":null,"data":{"added":[],"deleted":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"]}}}},"posttherapy_n_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"dependsOn":{"left":"follow_up.posttherapy_tumour_staging_system","right":"follow_up.post_therapy_tumour_staging_system"},"displayName":{"left":"Post-therapy N Category","right":null}},"restrictions":{"codeList":{"left":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"],"right":null,"data":{"added":[],"deleted":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"]}}}},"posttherapy_m_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"dependsOn":{"left":"follow_up.posttherapy_tumour_staging_system","right":"follow_up.post_therapy_tumour_staging_system"},"displayName":{"left":"Post-therapy M Category","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":null,"data":{"added":[],"deleted":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"]}}}},"posttherapy_stage_group":{"meta":{"dependsOn":{"left":"follow_up.posttherapy_tumour_staging_system","right":"follow_up.post_therapy_tumour_staging_system"},"notes":{"left":"This field is dependent on the selected posttherapy_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","right":"This field value is dependent on the selected posttherapy_tumour_staging_system."},"displayName":{"left":"Post-therapy Stage Group","right":null}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":null,"data":{"added":[],"deleted":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":null}}}},"created":{"anatomic_site_progression_or_recurrences":{"changeType":"created","description":"Indicate the anatomic site where disease progression or recurrence occurred. (Codelist reference: NCI CDE ID: 4742851)","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"],"codeList":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear, pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal; distal","Esophageal; mid","Esophageal; proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck, NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es), maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"]},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","notes":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse."}}},"deleted":{"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate if the follow-up is related to a specific primary diagnosis event in the clinical timeline.","meta":{"validationDependency":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID","primaryId":true},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"Indicate if the follow-up is related to a specific treatment event in the clinical timeline.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"weight_at_followup":{"changeType":"deleted","description":"Indicate the donor's weight, in kilograms (kg), at the time of follow-up.","name":"weight_at_followup","valueType":"number","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Weight at Follow-Up"}},"anatomic_site_progression_or_recurrence":{"changeType":"deleted","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"exposure":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"deleted","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"deleted","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"deleted","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"deleted","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"deleted","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"deleted","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"deleted","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"deleted","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"deleted","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"deleted","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"deleted","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}}},"family_history":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"family_relative_id":{"changeType":"deleted","description":"Unique identifier of the relative, assigned by the data provider.","name":"family_relative_id","valueType":"string","meta":{"displayName":"Family Relative ID","primaryId":true,"notes":"This field is required to ensure that family members are identified in unique records. Ids can be as simple as an incremented numeral to ensure uniqueness."},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"relative_with_cancer_history":{"changeType":"deleted","description":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","name":"relative_with_cancer_history","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Relative with Cancer History"}},"relationship_type":{"changeType":"deleted","description":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","name":"relationship_type","restrictions":{"codeList":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"]},"valueType":"string","meta":{"displayName":"Relationship Type"}},"gender_of_relative":{"changeType":"deleted","description":"The self-reported gender of related individual.","name":"gender_of_relative","restrictions":{"codeList":["Female","Male","Other","Unknown"]},"valueType":"string","meta":{"displayName":"Gender of Relative"}},"age_of_relative_at_diagnosis":{"changeType":"deleted","description":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","name":"age_of_relative_at_diagnosis","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","displayName":"Age Of Relative At Diagnosis"}},"cancer_type_code_of_relative":{"changeType":"deleted","name":"cancer_type_code_of_relative","valueType":"string","description":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"examples":"C41.1,C16.9,C00.5,D46.9","dependsOn":"family_history.relative_with_cancer_history","displayName":"Cancer Type Code (ICD-10) of Relative"}},"relative_vital_status":{"changeType":"deleted","description":"Relative's last known state of living or deceased.","name":"relative_vital_status","restrictions":{"codeList":["Alive","Deceased","Unknown"]},"valueType":"string","meta":{"displayName":"Vital Status of Relative"}},"cause_of_death_of_relative":{"changeType":"deleted","description":"Indicate the cause of the death of the relative.","name":"cause_of_death_of_relative","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]},"valueType":"string","meta":{"dependsOn":"family_history.relative_vital_status","displayName":"Cause of Death of Relative"}},"relative_survival_time":{"changeType":"deleted","description":"Indicate how long, in days, the relative survived from the time they were diagnosed with cancer.","name":"relative_survival_time","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","units":"days","displayName":"Survival Time Of Relative"}}}},"biomarker":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"deleted","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"deleted","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"deleted","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"deleted","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"deleted","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"deleted","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"deleted","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"deleted","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"deleted","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"deleted","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"deleted","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"deleted","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"deleted","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"deleted","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"deleted","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"deleted","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}}},"comorbidity":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"deleted","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"deleted","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"deleted","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"deleted","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"deleted","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"deleted","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}}}}} diff --git a/website/static/data/schemas/diffs/1.24/1.24-diff-0.6.json b/website/static/data/schemas/diffs/1.24/1.24-diff-0.6.json new file mode 100644 index 00000000..0ab1faa1 --- /dev/null +++ b/website/static/data/schemas/diffs/1.24/1.24-diff-0.6.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"program_id":{"meta":{"examples":{"left":"TEST-CA","right":"PACA-AU,BR-CA"},"notes":{"left":"This is the unique id that is assigned to your program. If you have logged into the platform, this is the Program Id that you see in the Program Services area. For example, TEST-CA is a Program ID.","right":null},"displayName":{"left":"Program ID","right":null}}},"submitter_donor_id":{"meta":{"displayName":{"left":"Submitter Donor ID","right":null}}},"gender":{"meta":{"displayName":{"left":"Gender","right":null}}},"submitter_specimen_id":{"meta":{"displayName":{"left":"Submitter Specimen ID","right":null}}},"specimen_tissue_source":{"meta":{"displayName":{"left":"Specimen Tissue Source","right":null}}},"tumour_normal_designation":{"meta":{"displayName":{"left":"Tumour Normal Designation","right":null}}},"specimen_type":{"meta":{"displayName":{"left":"Specimen Type","right":null}},"restrictions":{"codeList":{"left":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Normal","Normal - tissue adjacent to primary tumour","Primary tumour","Primary tumour - adjacent to normal","Primary tumour - additional new primary","Recurrent tumour","Metastatic tumour","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour - additional metastatic","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line","Cell line - derived from xenograft tumour","Cell line - derived from tumour","Cell line - derived from normal"],"data":{"added":[],"deleted":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n\n const row = $row;\n let result = {valid: true, message: \"Ok\"};\n \n const designation = row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\"){\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when tumour_normal_designation is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when tumour_normal_designation is set to Tumour.\"};\n }\n }\n return result;\n })()"]}}},"submitter_sample_id":{"meta":{"displayName":{"left":"Submitter Sample ID","right":null}}},"sample_type":{"meta":{"displayName":{"left":"Sample Type","right":null}}}},"created":{},"deleted":{}},"donor":{"updated":{"program_id":{"meta":{"displayName":{"left":"Program ID","right":null}}},"submitter_donor_id":{"meta":{"displayName":{"left":"Submitter Donor ID","right":null}}},"vital_status":{"meta":{"displayName":{"left":"Vital Status","right":null}},"restrictions":{"codeList":{"left":["Alive","Deceased"],"right":["Alive","Deceased","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"cause_of_death":{"meta":{"displayName":{"left":"Cause of Death","right":null}},"restrictions":{"codeList":{"left":["Died of cancer","Died of other reasons","Unknown"],"right":["Died of cancer","Died of other reasons"],"data":{"added":[],"deleted":["Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })()"]}}},"survival_time":{"meta":{"displayName":{"left":"Survival Time","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })()"]},"range":{"left":{"exclusiveMin":0},"right":null}}},"height":{"valueType":{"left":"number","right":"integer"},"meta":{"displayName":{"left":"Height","right":null}},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"weight":{"valueType":{"left":"number","right":"integer"},"meta":{"displayName":{"left":"Weight","right":null}},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"bmi":{"valueType":{"left":"number","right":"integer"},"meta":{"displayName":{"left":"BMI","right":null}},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"menopause_status":{"description":{"left":"Indicate the donor's menopause status at the time of primary diagnosis. (Reference: caDSR CDE ID 2434914)","right":"Indicate the donor's menopause status at the time of primary diagnosis. (Codelist reference: NCI CDE ID: 2434914)"},"meta":{"displayName":{"left":"Menopause Status","right":null}},"restrictions":{"codeList":{"left":["Not applicable","Perimenopausal","Postmenopausal","Premenopausal","Unknown"],"right":["Premenopausal","Perimenopausal","Postmenopausal","Indeterminate or unknown","Not applicable"],"data":{"added":["Indeterminate or unknown"],"deleted":["Unknown"]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)","right":"Indicate the donor's age of menarche, the first occurrence of menstruation."},"meta":{"displayName":{"left":"Age at Menarche","right":null}},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"number_of_pregnancies":{"description":{"left":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)","right":"Indicate the number of pregnancies a donor has had."},"meta":{"displayName":{"left":"Number of Pregnancies","right":null}},"restrictions":{"range":{"left":{"min":0},"right":null}}},"number_of_children":{"description":{"left":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)","right":"Indicate the number of children the donor has birthed."},"meta":{"displayName":{"left":"Number of Children","right":null}},"restrictions":{"range":{"left":{"min":0},"right":null}}}},"created":{"prior_malignancy":{"changeType":"created","description":"Prior malignancy affecting donor.","name":"prior_malignancy","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string"},"cancer_type_prior_malignancy":{"changeType":"created","description":"ICD-10 diagnostic code for type of cancer in a prior malignancy.","name":"cancer_type_prior_malignancy","restrictions":{"regex":"[A-Z]{1}[0-9]{2}.[0-9]{0,3}[A-Z]{0,1}$"},"valueType":"string"},"age_at_prior_malignancy":{"changeType":"created","description":"If donor has history of prior malignancy, indicate age at previous diagnosis, in years.","name":"age_at_prior_malignancy","valueType":"integer"},"laterality_of_prior_malignancy":{"changeType":"created","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis.","name":"laterality_of_prior_malignancy","valueType":"string"}},"deleted":{"primary_site":{"changeType":"deleted","name":"primary_site","valueType":"string","isArray":true,"description":"The text term used to describe the primary site of disease, as categorized by the World Health Organization's (WHO) International Classification of Diseases for Oncology (ICD-O). This categorization groups cases into general categories.","meta":{"displayName":"Primary Site","core":true,"notes":"To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Breast|Ovary"},"restrictions":{"required":true,"codeList":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"]}},"genetic_disorders":{"changeType":"deleted","description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},"hrt_type":{"changeType":"deleted","description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},"hrt_duration":{"changeType":"deleted","description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},"contraception_type":{"changeType":"deleted","description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},"contraception_duration":{"changeType":"deleted","description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},"lost_to_followup_after_clinical_event_id":{"changeType":"deleted","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}}},"specimen":{"updated":{"program_id":{"meta":{"displayName":{"left":"Program ID","right":null}}},"submitter_donor_id":{"meta":{"displayName":{"left":"Submitter Donor ID","right":null}}},"submitter_specimen_id":{"meta":{"displayName":{"left":"Submitter Specimen ID","right":null}}},"pathological_tumour_staging_system":{"meta":{"validationDependency":{"left":true,"right":null},"displayName":{"left":"Pathological Tumour Staging System","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate() {\n\n let result = {valid: true, message: \"Ok\"};\n \n /* This is not a required field, so first ensure that it exists */\n if ($field){\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name.trim().toLowerCase().split('_tumour_staging_system')[0];\n /* Perform validation only if an AJCC value was selected */\n if (/^(AJCC)\\b/i.test($field)){\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`\n ];\n const convertedRow = Object.fromEntries(Object.entries($row).map(([fieldName,fieldVal]) => [fieldName.toLowerCase(), fieldVal]));\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(field => Object.keys(convertedRow).includes(field) && (!convertedRow[field] || checkforEmpty(convertedRow[field])))\n if (emptyFields.length){\n result = {valid: false, \"message\": `The following fields are required when ${$name} is set to an AJCC option: ${emptyFields}`};\n }\n }\n }\n return result;\n })()"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"data":{"added":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"deleted":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"]}}}},"pathological_t_category":{"meta":{"displayName":{"left":"Pathological T Category","right":null}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":null,"data":{"added":[],"deleted":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"]}}}},"pathological_n_category":{"meta":{"displayName":{"left":"Pathological N Category","right":null}},"restrictions":{"codeList":{"left":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"],"right":null,"data":{"added":[],"deleted":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"]}}}},"pathological_m_category":{"meta":{"displayName":{"left":"Pathological M Category","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":null,"data":{"added":[],"deleted":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"]}}}},"pathological_stage_group":{"description":{"left":"Specify the tumour stage, based on pathological_tumour_staging_system, used to assess the cancer at the time the tumour specimen was resected.","right":"Specify the tumour stage, based on tumor_staging_system, used to assess the cancer at the time the tumour specimen was resected."},"meta":{"notes":{"left":"This field depends on the selected pathological_tumour_staging_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","right":"This field depends on the selected pathological staging system, and is only required if the specimen is a tumour."},"displayName":{"left":"Pathological Stage Group","right":null}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":null,"data":{"added":[],"deleted":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":null}}},"specimen_acquisition_interval":{"meta":{"notes":{"left":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":null},"displayName":{"left":"Specimen Acquisition Interval","right":null}}},"tumour_histological_type":{"description":{"left":"The code to represent the histology (morphology) of neoplasms that is usually obtained from a pathology report, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","right":"The code to represent the histology (morphology) of neoplasms that is usually obtained from a pathology report, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Please refer to the guidelines provided in the ICD-O-3 manual at https://apps.who.int/iris/handle/10665/42344."},"meta":{"validationDependency":{"left":true,"right":null},"displayName":{"left":"Tumour Histological Type","right":null}}},"specimen_anatomic_location":{"description":{"left":"Indicate the ICD-O-3 topography code for the anatomic location of a specimen when it was collected. Refer to the guidelines provided in the ICD-O-3 manual at https://apps.who.int/iris/handle/10665/42344.","right":"Anatomic location of a specimen when it was collected."},"meta":{"displayName":{"left":"Specimen Anatomic Location","right":null},"examples":{"left":"C50.1,C18","right":null}},"restrictions":{"regex":{"left":"^[C][0-9]{2}(.[0-9]{1})?$","right":null},"codeList":{"right":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear, pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal; distal","Esophageal; mid","Esophageal; proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck, NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es), maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"],"data":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear, pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal; distal","Esophageal; mid","Esophageal; proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck, NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es), maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"]}}},"specimen_processing":{"meta":{"displayName":{"left":"Specimen Processing","right":null}},"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation, other","Formalin fixed & paraffin embedded","Formalin fixed, buffered","Formalin fixed, unbuffered","Fresh","Other"],"data":{"added":["Cryopreservation, other","Formalin fixed, buffered","Formalin fixed, unbuffered"],"deleted":["Cryopreservation - other","Formalin fixed - buffered","Formalin fixed - unbuffered","Unknown"]}}}},"specimen_storage":{"description":{"left":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured.","right":"Indicate the method of specimen storage for specimens that were not extracted freshly or immediately cultured."},"meta":{"displayName":{"left":"Specimen Storage","right":null}},"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"right":["Cut slide","Frozen, -70 freezer","Frozen, liquid nitrogen","Frozen, vapor phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"data":{"added":["Frozen, -70 freezer","Frozen, liquid nitrogen","Frozen, vapor phase"],"deleted":["Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Unknown"]}}}},"tumour_grading_system":{"meta":{"validationDependency":{"left":true,"right":null},"displayName":{"left":"Tumour Grading System","right":null}},"restrictions":{"codeList":{"left":["FNCLCC grading system","Four-tier grading system","Gleason grade group system","Grading system for GISTs","Grading system for GNETs","ISUP grading system","Nuclear grading system for DCIS","Scarff-Bloom-Richardson grading system","Three-tier grading system","Two-tier grading system","WHO grading system for CNS tumours"],"right":["Default","Gleason","Nottingham","Brain cancer","ISUP","Lymphoid neoplasms"],"data":{"added":["Default","Gleason","Nottingham","Brain cancer","ISUP","Lymphoid neoplasms"],"deleted":["FNCLCC grading system","Four-tier grading system","Gleason grade group system","Grading system for GISTs","Grading system for GNETs","ISUP grading system","Nuclear grading system for DCIS","Scarff-Bloom-Richardson grading system","Three-tier grading system","Two-tier grading system","WHO grading system for CNS tumours"]}}}},"tumour_grade":{"meta":{"notes":{"left":"This field depends on the selected tumour_grading_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Grading Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-grading-classifications","right":"This field depends on the selected tumour grading system, and is only required if the specimen is a tumour."},"displayName":{"left":"Tumour Grade","right":null}},"restrictions":{"codeList":{"left":["Low grade","High grade","GX","G1","G2","G3","G4","Low","High","Grade I","Grade II","Grade III","Grade IV","Grade Group 1","Grade Group 2","Grade Group 3","Grade Group 4","Grade Group 5"],"data":["Low grade","High grade","GX","G1","G2","G3","G4","Low","High","Grade I","Grade II","Grade III","Grade IV","Grade Group 1","Grade Group 2","Grade Group 3","Grade Group 4","Grade Group 5"]},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'default':\n codeList = [\n 'gx - cannot be assessed',\n 'g1 well differentiated/low grade',\n 'g2 moderately differentiated/intermediated grade',\n 'g3 poorly differentiated/high grade',\n 'g4 undifferentiated/high grade',\n ];\n break;\n case 'gleason':\n codeList = [\n 'gleason x: gleason score cannot be determined',\n 'gleason 2–6: the tumor tissue is well differentiated',\n 'gleason 7: the tumor tissue is moderately differentiated',\n 'gleason 8–10: the tumor tissue is poorly differentiated or undifferentiated',\n ];\n break;\n case 'nottingham':\n codeList = [\n 'g1 (low grade or well differentiated)',\n 'g2 (intermediate grade or moderately differentiated)',\n 'g3 (high grade or poorly differentiated)',\n ];\n break;\n case 'brain cancer':\n codeList = ['grade i', 'grade ii', 'grade iii', 'grade iv'];\n break;\n case 'isup for renal cell carcinoma':\n codeList = [\n 'grade 1: tumor cell nucleoli invisible or small and basophilic at 400 x magnification',\n 'grade 2: tumor cell nucleoli conspicuous at 400 x magnification but inconspicuous at 100 x magnification',\n 'grade 3: tumor cell nucleoli eosinophilic and clearly visible at 100 x magnification',\n 'grade 4: tumors showing extreme nuclear pleomorphism and/or containing tumor giant cells and/or the presence of any proportion of tumor showing sarcomatoid and/or rhabdoid dedifferentiation',\n ];\n break;\n case 'lymphoid neoplasms':\n codeList = ['low grade or indolent nhl', 'high grade or aggressive nhl'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })()"]}}},"percent_tumour_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)","right":"Indicate a value, in decimals, that represents the percentage of infiltration by tumour cells in a specimen."},"meta":{"displayName":{"left":"Percent Tumour Cells","right":null}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null},"script":{"left":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"],"right":null}}},"percent_proliferating_cells":{"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"displayName":{"left":"Percent Proliferating Cells","right":null},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_inflammatory_tissue":{"description":{"left":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)","right":"Indicate a value, in decimals, that represents local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"displayName":{"left":"Percent Inflammatory Tissue","right":null},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_stromal_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)","right":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a malignant tumour specimen but are not malignant such as fibroblasts, vascular structures, etc."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"displayName":{"left":"Percent Stromal Cells","right":null},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_necrosis":{"description":{"left":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)","right":"Indicate a value, in decimals, that represents the percentage of cell death in a malignant tumour specimen."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"displayName":{"left":"Percent Necrosis","right":null},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}}},"created":{"central_pathology_confirmed":{"changeType":"created","name":"central_pathology_confirmed","description":"Indicate whether the histologic description of tissue or cells was confirmed by a pathology review of frozen or formalin fixed slide(s) completed after the diagnostic pathology review of the tumour sample used to extract analyte(s).","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour."},"restrictions":{"codeList":["Yes","No","Unknown"]}}},"deleted":{"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate the primary diagnosis event in the clinical timeline that this specimen acquisition was related to.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"specimen_laterality":{"changeType":"deleted","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"reference_pathology_confirmed":{"changeType":"deleted","name":"reference_pathology_confirmed","description":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)","valueType":"string","meta":{"validationDependency":true,"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Reference Pathology Confirmed"},"restrictions":{"codeList":["Yes","No","Unknown"]}},"percent_tumour_cells_measurement_method":{"changeType":"deleted","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}}},"primary_diagnosis":{"updated":{"program_id":{"meta":{"displayName":{"left":"Program ID","right":null}}},"submitter_donor_id":{"meta":{"displayName":{"left":"Submitter Donor ID","right":null}}},"age_at_diagnosis":{"description":{"left":"Age that the donor was first diagnosed with cancer, in years. This should be based on the earliest diagnosis of cancer.","right":"Age that the donor was first diagnosed with cancer, in years."},"meta":{"displayName":{"left":"Age at Diagnosis","right":null}},"restrictions":{"range":{"left":{"exclusiveMin":0,"max":90},"right":null}}},"cancer_type_code":{"description":{"left":"The code to represent the cancer type using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","right":"The code to represent the cancer type using the WHO ICD-10 code (https://icd.who.int/browse10/2016/en#/) classification."},"meta":{"examples":{"left":"C41.1,C16.9,C00.5,D46.9","right":"C41.1,C16.9,C00.543A"},"displayName":{"left":"Cancer Type Code","right":null}},"restrictions":{"regex":{"left":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","right":"^C[0-9]{2}.[0-9]{0,3}[A-Z]{0,1}$"}}},"number_lymph_nodes_examined":{"description":{"left":"The total number of lymph nodes tested for the presence of cancer. (Reference: caDSR CDE ID 3)","right":"The total number of lymph nodes tested for the presence of cancer. (Reference: NCI CDE ID: 3)"},"meta":{"displayName":{"left":"Number Of Lymph Nodes Examined","right":null},"dependsOn":{"left":"primary_diagnosis.lymph_nodes_examined_status","right":null},"notes":{"left":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":null},"range":{"left":{"min":0},"right":null}}},"number_lymph_nodes_positive":{"description":{"left":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: caDSR CDE ID 6113694)","right":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: NCI CDE ID: 6113694)"},"meta":{"displayName":{"left":"Number Of Lymph Nodes Positive","right":null},"dependsOn":{"left":"primary_diagnosis.lymph_nodes_examined_status","right":null},"notes":{"left":"This field is only required if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":null},"range":{"left":{"min":0},"right":null},"required":{"left":null,"right":true}}},"clinical_tumour_staging_system":{"meta":{"validationDependency":{"left":true,"right":null},"displayName":{"left":"Clinical Tumour Staging System","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate() {\n\n let result = {valid: true, message: \"Ok\"};\n \n /* This is not a required field, so first ensure that it exists */\n if ($field){\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name.trim().toLowerCase().split('_tumour_staging_system')[0];\n /* Perform validation only if an AJCC value was selected */\n if (/^(AJCC)\\b/i.test($field)){\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`\n ];\n const convertedRow = Object.fromEntries(Object.entries($row).map(([fieldName,fieldVal]) => [fieldName.toLowerCase(), fieldVal]));\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(field => Object.keys(convertedRow).includes(field) && (!convertedRow[field] || checkforEmpty(convertedRow[field])))\n if (emptyFields.length){\n result = {valid: false, \"message\": `The following fields are required when ${$name} is set to an AJCC option: ${emptyFields}`};\n }\n }\n }\n return result;\n })()"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"data":{"added":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"deleted":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"]}},"required":{"left":null,"right":true}}},"clinical_t_category":{"meta":{"displayName":{"left":"Clinical T Category","right":null}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":null,"data":{"added":[],"deleted":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"]}}}},"clinical_n_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"displayName":{"left":"Clinical N Category","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"],"right":null,"data":{"added":[],"deleted":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"]}}}},"clinical_m_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned.","right":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned."},"meta":{"displayName":{"left":"Clinical M Category","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":null,"data":{"added":[],"deleted":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"]}}}},"clinical_stage_group":{"description":{"left":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage.","right":"Stage group of the tumour, as assigned by the reporting tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.)."},"meta":{"notes":{"left":"This field is dependent on the selected clinical_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","right":null},"displayName":{"left":"Clinical Stage Group","right":null},"examples":{"left":"Stage I, Stage IIB","right":null}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"presenting_symptoms":{"meta":{"displayName":{"left":"Presenting Symptoms","right":null},"notes":{"left":"To include multiple values, separate values with a pipe delimiter '|' within your file.","right":null},"examples":{"left":"Anemia|Bloating|Diabetes","right":null}},"restrictions":{"codeList":{"left":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Loss of Appetite","Nausea","None","Not Reported","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Swelling in the Neck","Unknown","Vomiting","Weight Loss"],"right":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Nausea","None","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Unknown","Vomiting","Weight Loss"],"data":{"added":[],"deleted":["Loss of Appetite","Not Reported","Swelling in the Neck"]}}}},"performance_status":{"description":{"left":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status).","right":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference source: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status)."},"meta":{"notes":{"left":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction.\nGrade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work).\nGrade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours.\nGrade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours.\nGrade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair","right":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction \n Grade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work) \n Grade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours \n Grade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours \n Grade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair"},"displayName":{"left":"Performance Status","right":null}},"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"data":{"added":[],"deleted":["Unknown"]}}}}},"created":{"stage_suffix":{"changeType":"created","name":"stage_suffix","description":"If necessary, use this field to add any applicable stage suffixes. Stage suffixes may apply to certain staging systems such as Ann Arbour staging system where the four stages are divided into 4 categories (A, B, X and E).","valueType":"string","meta":{"core":true,"dependsOn":"primary_diagnosis.clinical_tumour_staging_system"}}},"deleted":{"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Unique identifier of the primary diagnosis event, assigned by the data provider.","meta":{"primaryId":true,"displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"cancer_type_additional_information":{"changeType":"deleted","name":"cancer_type_additional_information","valueType":"string","description":"Additional details related to the cancer type that are not covered by the ICD-10 code provided in the cancer_type field.","meta":{"displayName":"Cancer Type Additional Information"}},"basis_of_diagnosis":{"changeType":"deleted","name":"basis_of_diagnosis","description":"Indicate the most valid basis of how the primary diagnosis was identified. If more than one diagnosis technique was used, select the term that has the highest code number (see notes). (Reference: IACR Standard for Basis of Diagnosis http://www.iacr.com.fr/images/doc/basis.pdf)","restrictions":{"codeList":["Clinical investigation","Clinical","Cytology","Death certificate only","Histology of a metastasis","Histology of a primary tumour","Specific tumour markers","Unknown"]},"valueType":"string","meta":{"notes":"0: Death certificate only: Information provided is from a death certificate.\n1: Clinical: Diagnosis made before death.\n2: Clinical investigation: All diagnostic techniques, including X-ray, endoscopy, imaging, ultrasound, exploratory surgery (such as laparotomy), and autopsy, without a tissue diagnosis.\n4: Specific tumour markers: Including biochemical and/or immunologic markers that are specific for a tumour site.\n5: Cytology: Examination of cells from a primary or secondary site, including fluids aspirated by endoscopy or needle; also includes the microscopic examination of peripheral blood and bone marrow aspirates.\n6: Histology of a metastasis: Histologic examination of tissue from a metastasis, including autopsy specimens.\n7: Histology of a primary tumour: Histologic examination of tissue from primary tumour, however obtained, including all cutting techniques and bone marrow biopsies; also includes autopsy specimens of primary tumour.\n9: Unknown: No information on how the diagnosis has been made.","displayName":"Basis of Diagnosis"}},"laterality":{"changeType":"deleted","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_status":{"changeType":"deleted","name":"lymph_nodes_examined_status","description":"Indicate if lymph nodes were examined for metastases.","valueType":"string","restrictions":{"required":true,"codeList":["Cannot be determined","No","No lymph nodes found in resected specimen","Not applicable","Yes"]},"meta":{"core":true,"displayName":"Lymph Nodes Examined Status"}},"lymph_nodes_examined_method":{"changeType":"deleted","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}}},"treatment":{"updated":{"program_id":{"meta":{"displayName":{"left":"Program ID","right":null}}},"submitter_donor_id":{"meta":{"displayName":{"left":"Submitter Donor ID","right":null}}},"submitter_treatment_id":{"meta":{"displayName":{"left":"Submitter Treatment ID","right":null}}},"treatment_type":{"meta":{"notes":{"left":"Depending on the treatment_type(s) selected, additional treatment details may be required to be submitted. For example, if treatment_type includes 'Chemotherapy', the supplemental Chemotherapy treatment type file is required.\nTo include multiple values, separate values with a pipe delimiter '|' within your file.","right":"Depending on the treatment_type selected, additional treament details may be required to be submitted."},"displayName":{"left":"Treatment Type","right":null},"examples":{"left":"Chemotherapy|Hormonal therapy","right":null}},"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Chemotherapy","Ablation","Bone marrow transplant","Combined chemo+immunotherapy","Combined chemo+radiation therapy","Combined chemo-radiotherapy and surgery","Endoscopic therapy","Hormonal therapy","Immunotherapy","Monoclonal antibodies (for liquid tumours)","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgical resection"],"data":{"added":["Combined chemo+immunotherapy","Combined chemo+radiation therapy","Combined chemo-radiotherapy and surgery","Monoclonal antibodies (for liquid tumours)","Surgical resection"],"deleted":["End of life care","Surgery"]}}}},"is_primary_treatment":{"description":{"left":"Indicate if the treatment was the primary treatment following the initial diagnosis.","right":"Indicate if the treamtment was the primary treatment following the initial diagnosis."},"meta":{"displayName":{"left":"Is Primary Treatment","right":null},"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"codeList":{"left":["Yes","No"],"right":["Yes","No","Unknown"],"data":{"added":["Unknown"],"deleted":[]}},"required":{"left":null,"right":true}}},"treatment_start_interval":{"description":{"left":"The interval between the primary diagnosis and initiation of treatment, in days.","right":"The interval between primary diagnosis and initiation of treatment, in days."},"meta":{"notes":{"left":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":null},"displayName":{"left":"Treatment Start Interval","right":null},"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"treatment_duration":{"description":{"left":"The duration of treatment regimen, in days.","right":"The duration of treatment regimen, in days"},"meta":{"displayName":{"left":"Treatment Duration","right":null},"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null},"required":{"left":null,"right":true}}}},"created":{"age_at_consent_for_treatment":{"changeType":"created","name":"age_at_consent_for_treatment","description":"Indicate the age of donor when consent was given for treatment.","valueType":"integer"},"therapeutic_intent":{"changeType":"created","name":"therapeutic_intent","description":"The therapeutic intent, the reason behind the choice of a therapy, of the treatment.","valueType":"string","restrictions":{"required":true,"codeList":["Adjuvant","Concurrent","Curative","Neoadjuvant","Not applicable","Palliative","Unknown"]},"meta":{"core":true}},"response_to_therapy":{"changeType":"created","name":"response_to_therapy","description":"The donors's response to the applied treatment regimen. (Source: RECIST)","valueType":"string","restrictions":{"required":true,"codeList":["Complete response","Disease progression","NED","Partial response","Stable disease"]},"meta":{"core":true}}},"deleted":{"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate the primary diagnosis event in the clinical timeline that this treatment was related to.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"line_of_treatment":{"changeType":"deleted","name":"line_of_treatment","description":"Indicate the line of treatment if it is not the primary treatment.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Line Of treatment","dependsOn":"treatment.is_primary_treatment","examples":"2,3,4"}},"days_per_cycle":{"changeType":"deleted","name":"days_per_cycle","description":"Indicate the number of days in a treatment cycle.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Days Per Cycle","dependsOn":"treatment.treatment_type"}},"number_of_cycles":{"changeType":"deleted","name":"number_of_cycles","description":"Indicate the number of treatment cycles.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Number Of Cycles","dependsOn":"treatment.treatment_type"}},"treatment_intent":{"changeType":"deleted","name":"treatment_intent","description":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"]},"meta":{"core":true,"displayName":"Treatment Intent","dependsOn":"treatment.treatment_type"}},"treatment_setting":{"changeType":"deleted","name":"treatment_setting","description":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: NCIt C124308)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"]},"meta":{"core":true,"displayName":"Treatment Setting","dependsOn":"treatment.treatment_type"}},"response_to_treatment_criteria_method":{"changeType":"deleted","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},"response_to_treatment":{"changeType":"deleted","name":"response_to_treatment","description":"The donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"codeList":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"]},"meta":{"core":true,"displayName":"Response To Treatment","dependsOn":"treatment.response_to_treatment_criteria_method","notes":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"outcome_of_treatment":{"changeType":"deleted","name":"outcome_of_treatment","description":"Indicate the donor's outcome of the prescribed treatment.","valueType":"string","restrictions":{"codeList":["Treatment completed as prescribed","Treatment incomplete due to technical or organizational problems","Treatment incomplete because patient died","Patient choice (stopped or interrupted treatment)","Physician decision (stopped or interrupted treatment)","Treatment stopped due to lack of efficacy (disease progression)","Treatment stopped due to acute toxicity","Other","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Outcome Of Treatment","dependsOn":"treatment.treatment_type"}},"toxicity_type":{"changeType":"deleted","name":"toxicity_type","description":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity.","valueType":"string","restrictions":{"codeList":["Hematological","Non-hematological","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Toxicity Type","dependsOn":"treatment.outcome_of_treatment"}},"hematological_toxicity":{"changeType":"deleted","name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"non-hematological_toxicity":{"changeType":"deleted","name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"adverse_events":{"changeType":"deleted","name":"adverse_events","description":"Report any treatment related adverse events. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Adverse Events","dependsOn":"treatment.treatment_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"clinical_trials_database":{"changeType":"deleted","name":"clinical_trials_database","description":"If the donor is a participant in a clinical trial, indicate the clinical trial database where the clinical trial is registered.","valueType":"string","meta":{"display name":"Clinical Trials Database","notes":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added."},"restrictions":{"codeList":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"]}},"clinical_trial_number":{"changeType":"deleted","name":"clinical_trial_number","description":"Based on the clinical_trial_database, indicate the unique NCT or EudraCT clinical trial identifier of which the donor is a participant.","valueType":"string","meta":{"display name":"Clinical Trial Number","dependsOn":"treatment.clinical_trials_database","examples":"2016-002120-83,NCT02465060"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"]}}}},"chemotherapy":{"updated":{"program_id":{"meta":{"displayName":{"left":"Program ID","right":null}}},"submitter_donor_id":{"meta":{"displayName":{"left":"Submitter Donor ID","right":null}}},"submitter_treatment_id":{"meta":{"displayName":{"left":"Submitter Treatment ID","right":null}}}},"created":{"chemotherapy_drug_name":{"changeType":"created","name":"chemotherapy_drug_name","description":"Name of agent or drug administered to patient as part of the chemotherapy treatment regimen.","valueType":"string","restrictions":{"required":true,"codeList":["Placeholder list 1","Need list","Still need it"]},"meta":{"validationDependency":true,"core":true,"notes":"This field uses a controlled vocabulary gathered from the DrugBank database of drug names.","examples":"Allopurinol, Dronabinol, Sucralfate, Lapatinib"}},"chemotherapy_dosage_units":{"changeType":"created","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m²","IU/m²","µg/m²","g/m²","mg/kg"]},"meta":{"core":true}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate the total drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"integer","restrictions":{"required":true},"meta":{"core":true}}},"deleted":{"drug_rxnormcui":{"changeType":"deleted","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"deleted","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"deleted","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"deleted","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"deleted","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"deleted","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}}},"hormone_therapy":{"updated":{"program_id":{"meta":{"displayName":{"left":"Program ID","right":null}}},"submitter_donor_id":{"meta":{"displayName":{"left":"Submitter Donor ID","right":null}}},"submitter_treatment_id":{"meta":{"displayName":{"left":"Submitter Treatment ID","right":null}}}},"created":{"hormone_therapy_drug_name":{"changeType":"created","name":"hormone_therapy_drug_name","description":"Name of agent or drug administered to patient as part of the hormone therapy treatment regimen.","valueType":"string","restrictions":{"required":true,"codeList":["Placeholder list 1","Need list","Still need it"]},"meta":{"validationDependency":true,"core":true,"notes":"This field uses a controlled vocabulary gathered from the DrugBank database of drug names."}},"hormone_drug_dosage_units":{"changeType":"created","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m²","IU/m²","µg/m²","g/m²","mg/kg"]},"meta":{"core":true}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"integer","restrictions":{"required":true},"meta":{"core":true}}},"deleted":{"drug_rxnormcui":{"changeType":"deleted","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"deleted","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Hormone Therapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"deleted","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"radiation":{"updated":{"program_id":{"meta":{"displayName":{"left":"Program ID","right":null}}},"submitter_donor_id":{"meta":{"displayName":{"left":"Submitter Donor ID","right":null}}},"submitter_treatment_id":{"meta":{"displayName":{"left":"Submitter Treatment ID","right":null}}},"radiation_therapy_modality":{"meta":{"displayName":{"left":"Radiation Therapy Modality","right":null}}},"radiation_therapy_fractions":{"description":{"left":"Indicate the total number of fractions delivered as part of treatment.","right":"Indicate the number of total fractions delivered as part of treatment."},"meta":{"displayName":{"left":"Radiation Therapy Fractions","right":null}},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"radiation_therapy_dosage":{"valueType":{"left":"number","right":"integer"},"meta":{"displayName":{"left":"Radiation Therapy Dosage","right":null}},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"anatomical_site_irradiated":{"description":{"left":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)","right":"Indicate localization site where radiation therapy was administered."},"meta":{"displayName":{"left":"Anatomical Site Irradiated","right":null}},"restrictions":{"codeList":{"left":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"right":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"data":{"added":["Bone","Extremities","Head-Neck","Peritoneum"],"deleted":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"]}}}}},"created":{"application_form":{"changeType":"created","name":"application_form","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal (including Brachytherapy)"]},"meta":{"core":true}}},"deleted":{"radiation_therapy_type":{"changeType":"deleted","name":"radiation_therapy_type","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal"]},"meta":{"core":true,"displayName":"Type of Radiation Therapy","notes":"Internal application includes Brachytherapy."}},"radiation_boost":{"changeType":"deleted","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"deleted","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}}},"immunotherapy":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"immunotherapy_type":{"changeType":"deleted","name":"immunotherapy_type","valueType":"string","description":"Indicate the type of immunotherapy administered to donor.","meta":{"displayName":"Immunotherapy Type","core":true},"restrictions":{"required":true,"codeList":["Cell-based","Immune checkpoint inhibitors","Monoclonal antibodies other than immune checkpoint inhibitors","Other immunomodulatory substances"]}},"drug_rxnormcui":{"changeType":"deleted","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"deleted","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"deleted","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"surgery":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"deleted","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"deleted","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"deleted","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"deleted","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"deleted","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"deleted","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"deleted","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"deleted","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"deleted","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"deleted","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"deleted","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"deleted","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"deleted","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"deleted","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}}},"follow_up":{"updated":{"program_id":{"meta":{"displayName":{"left":"Program ID","right":null}}},"submitter_donor_id":{"meta":{"displayName":{"left":"Submitter Donor ID","right":null}}},"submitter_follow_up_id":{"description":{"left":"Unique identifier for a follow-up event in a donor's clinical record, assigned by the data provider.","right":"Unique identifier for a follow-up event in a donors clincal record, assigned by the data provider."},"meta":{"displayName":{"left":"Submitter Follow-Up ID","right":null}}},"interval_of_followup":{"description":{"left":"Interval from the primary diagnosis date to the follow-up date, in days.","right":"Interval from the primary diagnosis date to the follow up date, in days."},"meta":{"displayName":{"left":"Interval Of Follow-Up","right":null},"notes":{"left":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":null}}},"disease_status_at_followup":{"description":{"left":"Indicate the donor's disease status at time of follow-up. (Reference: RECIST)","right":"Indicate the donor's disease status at time of follow-up."},"meta":{"displayName":{"left":"Disease Status at Follow-Up","right":null}},"restrictions":{"codeList":{"left":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Progression NOS","Relapse or recurrence","Stable"],"right":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Relapse","Stable"],"data":{"added":["Relapse"],"deleted":["Progression NOS","Relapse or recurrence"]}}}},"relapse_type":{"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.","right":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse."},"displayName":{"left":"Relapse Type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":null}}},"relapse_interval":{"description":{"left":"If the donor was clinically disease free following primary treatment and then relapse or recurrence or progression (for liquid tumours) occurred afterwards, then this field will indicate the length of disease free interval, in days.","right":"If the donor was clinically disease free following primary treatment and then relapse or progression (for liquid tumours) occurred afterwards, then this field will indicate the length of disease free interval, in days."},"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.","right":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse."},"displayName":{"left":"Relapse Interval","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"]}}},"method_of_progression_status":{"description":{"left":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Reference: caDSR CDE ID 6161031)","right":"Indicate the method(s) used to confirm the donor's progression disease status. (Codelist reference: NCI CDE ID: 6161031)"},"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file.","right":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse."},"displayName":{"left":"Method Of Progression Status","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"]},"codeList":{"left":["Biomarker in liquid biopsy (e.g. tumour marker in blood or urine)","Biopsy","Blood draw","Bone marrow aspirate","Core biopsy","Cystoscopy","Cytology","Debulking","Diagnostic imaging","Dilation and curettage procedure","Enucleation","Excisional biopsy","Fine needle aspiration","Imaging","Incisional biopsy","Laparoscopy","Laparotomy","Other","Pap Smear","Pathologic review","Physical exam","Surgical resection","Thoracentesis","Ultrasound guided biopsy"],"right":["Autopsy","Biomarker in liquid biopsy (e.g. tumor marker in blood or urine)","Biopsy","Blood draw","Bone marrow aspirate","Core biopsy","Cystoscopy","Cytology","Debulking","Diagnostic imaging","Dilation and curettage procedure","Enucleation","Excisional biopsy","Fine needle aspiration","Imaging","Incisional biopsy","Laparoscopy","Laparotomy","Other","Pap Smear","Pathologic review","Physical exam","Surgical resection","Thoracentesis","Ultrasound guided biopsy"],"data":{"added":["Autopsy","Biomarker in liquid biopsy (e.g. tumor marker in blood or urine)"],"deleted":["Biomarker in liquid biopsy (e.g. tumour marker in blood or urine)"]}}}},"recurrence_tumour_staging_system":{"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.","right":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse."},"displayName":{"left":"Recurrance Tumour Staging System","right":null},"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"data":{"added":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"deleted":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n\n let result = {valid: true, message: \"Ok\"};\n \n /* This is not a required field, so first ensure that it exists */\n if ($field){\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name.trim().toLowerCase().split('_tumour_staging_system')[0];\n /* Perform validation only if an AJCC value was selected */\n if (/^(AJCC)\\b/i.test($field)){\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`\n ];\n const convertedRow = Object.fromEntries(Object.entries($row).map(([fieldName,fieldVal]) => [fieldName.toLowerCase(), fieldVal]));\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(field => Object.keys(convertedRow).includes(field) && (!convertedRow[field] || checkforEmpty(convertedRow[field])))\n if (emptyFields.length){\n result = {valid: false, \"message\": `The following fields are required when ${$name} is set to an AJCC option: ${emptyFields}`};\n }\n }\n }\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"]}}},"recurrence_t_category":{"description":{"left":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"displayName":{"left":"Recurrence T Category","right":null},"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":null,"data":{"added":[],"deleted":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"]}}}},"recurrence_n_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"displayName":{"left":"Recurrence N Category","right":null},"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"],"right":null,"data":{"added":[],"deleted":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"]}}}},"recurrence_m_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"displayName":{"left":"Recurrence M Category","right":null},"core":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":null,"data":{"added":[],"deleted":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"]}}}},"recurrence_stage_group":{"description":{"left":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) at the time of retreatment for a recurrence or disease progression.","right":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery."},"meta":{"notes":{"left":"This field is dependent on the selected recurrence_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","right":null},"displayName":{"left":"Recurrence Stage Group","right":null},"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":null,"data":{"added":[],"deleted":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":null}}},"posttherapy_tumour_staging_system":{"meta":{"displayName":{"left":"Post-therapy Tumour Staging System","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate() {\n\n let result = {valid: true, message: \"Ok\"};\n \n /* This is not a required field, so first ensure that it exists */\n if ($field){\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name.trim().toLowerCase().split('_tumour_staging_system')[0];\n /* Perform validation only if an AJCC value was selected */\n if (/^(AJCC)\\b/i.test($field)){\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`\n ];\n const convertedRow = Object.fromEntries(Object.entries($row).map(([fieldName,fieldVal]) => [fieldName.toLowerCase(), fieldVal]));\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(field => Object.keys(convertedRow).includes(field) && (!convertedRow[field] || checkforEmpty(convertedRow[field])))\n if (emptyFields.length){\n result = {valid: false, \"message\": `The following fields are required when ${$name} is set to an AJCC option: ${emptyFields}`};\n }\n }\n }\n return result;\n })()"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"data":{"added":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"deleted":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"]}}}},"posttherapy_t_category":{"meta":{"dependsOn":{"left":"follow_up.posttherapy_tumour_staging_system","right":"follow_up.post_therapy_tumour_staging_system"},"displayName":{"left":"Post-therapy T Category","right":null}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":null,"data":{"added":[],"deleted":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"]}}}},"posttherapy_n_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"dependsOn":{"left":"follow_up.posttherapy_tumour_staging_system","right":"follow_up.post_therapy_tumour_staging_system"},"displayName":{"left":"Post-therapy N Category","right":null}},"restrictions":{"codeList":{"left":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"],"right":null,"data":{"added":[],"deleted":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"]}}}},"posttherapy_m_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"dependsOn":{"left":"follow_up.posttherapy_tumour_staging_system","right":"follow_up.post_therapy_tumour_staging_system"},"displayName":{"left":"Post-therapy M Category","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":null,"data":{"added":[],"deleted":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"]}}}},"posttherapy_stage_group":{"meta":{"dependsOn":{"left":"follow_up.posttherapy_tumour_staging_system","right":"follow_up.post_therapy_tumour_staging_system"},"notes":{"left":"This field is dependent on the selected posttherapy_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","right":"This field value is dependent on the selected posttherapy_tumour_staging_system."},"displayName":{"left":"Post-therapy Stage Group","right":null}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":null,"data":{"added":[],"deleted":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":null}}}},"created":{"anatomic_site_progression_or_recurrences":{"changeType":"created","description":"Indicate the anatomic site where disease progression or recurrence occurred. (Codelist reference: NCI CDE ID: 4742851)","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"],"codeList":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear, pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal; distal","Esophageal; mid","Esophageal; proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck, NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es), maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"]},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","notes":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse."}}},"deleted":{"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate if the follow-up is related to a specific primary diagnosis event in the clinical timeline.","meta":{"validationDependency":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID","primaryId":true},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"Indicate if the follow-up is related to a specific treatment event in the clinical timeline.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"weight_at_followup":{"changeType":"deleted","description":"Indicate the donor's weight, in kilograms (kg), at the time of follow-up.","name":"weight_at_followup","valueType":"number","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Weight at Follow-Up"}},"anatomic_site_progression_or_recurrence":{"changeType":"deleted","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"exposure":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"deleted","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"deleted","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"deleted","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"deleted","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"deleted","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"deleted","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"deleted","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"deleted","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"deleted","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"deleted","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"deleted","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}}},"family_history":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"family_relative_id":{"changeType":"deleted","description":"Unique identifier of the relative, assigned by the data provider.","name":"family_relative_id","valueType":"string","meta":{"displayName":"Family Relative ID","primaryId":true,"notes":"This field is required to ensure that family members are identified in unique records. Ids can be as simple as an incremented numeral to ensure uniqueness."},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"relative_with_cancer_history":{"changeType":"deleted","description":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","name":"relative_with_cancer_history","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Relative with Cancer History"}},"relationship_type":{"changeType":"deleted","description":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","name":"relationship_type","restrictions":{"codeList":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"]},"valueType":"string","meta":{"displayName":"Relationship Type"}},"gender_of_relative":{"changeType":"deleted","description":"The self-reported gender of related individual.","name":"gender_of_relative","restrictions":{"codeList":["Female","Male","Other","Unknown"]},"valueType":"string","meta":{"displayName":"Gender of Relative"}},"age_of_relative_at_diagnosis":{"changeType":"deleted","description":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","name":"age_of_relative_at_diagnosis","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","displayName":"Age Of Relative At Diagnosis"}},"cancer_type_code_of_relative":{"changeType":"deleted","name":"cancer_type_code_of_relative","valueType":"string","description":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"examples":"C41.1,C16.9,C00.5,D46.9","dependsOn":"family_history.relative_with_cancer_history","displayName":"Cancer Type Code (ICD-10) of Relative"}},"relative_vital_status":{"changeType":"deleted","description":"Relative's last known state of living or deceased.","name":"relative_vital_status","restrictions":{"codeList":["Alive","Deceased","Unknown"]},"valueType":"string","meta":{"displayName":"Vital Status of Relative"}},"cause_of_death_of_relative":{"changeType":"deleted","description":"Indicate the cause of the death of the relative.","name":"cause_of_death_of_relative","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]},"valueType":"string","meta":{"dependsOn":"family_history.relative_vital_status","displayName":"Cause of Death of Relative"}},"relative_survival_time":{"changeType":"deleted","description":"Indicate how long, in days, the relative survived from the time they were diagnosed with cancer.","name":"relative_survival_time","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","units":"days","displayName":"Survival Time Of Relative"}}}},"biomarker":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"deleted","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"deleted","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"deleted","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"deleted","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"deleted","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"deleted","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"deleted","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"deleted","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"deleted","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"deleted","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"deleted","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"deleted","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"deleted","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"deleted","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"deleted","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"deleted","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}}},"comorbidity":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"deleted","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"deleted","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"deleted","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"deleted","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"deleted","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"deleted","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}}}}} diff --git a/website/static/data/schemas/diffs/1.24/1.24-diff-0.7.json b/website/static/data/schemas/diffs/1.24/1.24-diff-0.7.json new file mode 100644 index 00000000..b337fced --- /dev/null +++ b/website/static/data/schemas/diffs/1.24/1.24-diff-0.7.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"program_id":{"meta":{"examples":{"left":"TEST-CA","right":"PACA-AU,BR-CA"},"notes":{"left":"This is the unique id that is assigned to your program. If you have logged into the platform, this is the Program Id that you see in the Program Services area. For example, TEST-CA is a Program ID.","right":null},"displayName":{"left":"Program ID","right":null}}},"submitter_donor_id":{"meta":{"displayName":{"left":"Submitter Donor ID","right":null}}},"gender":{"meta":{"displayName":{"left":"Gender","right":null}}},"submitter_specimen_id":{"meta":{"displayName":{"left":"Submitter Specimen ID","right":null}}},"specimen_tissue_source":{"meta":{"displayName":{"left":"Specimen Tissue Source","right":null}}},"tumour_normal_designation":{"meta":{"displayName":{"left":"Tumour Normal Designation","right":null}}},"specimen_type":{"meta":{"displayName":{"left":"Specimen Type","right":null}},"restrictions":{"codeList":{"left":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Normal","Normal - tissue adjacent to primary tumour","Primary tumour","Primary tumour - adjacent to normal","Primary tumour - additional new primary","Recurrent tumour","Metastatic tumour","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour - additional metastatic","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line","Cell line - derived from xenograft tumour","Cell line - derived from tumour","Cell line - derived from normal"],"data":{"added":[],"deleted":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n\n const row = $row;\n let result = {valid: true, message: \"Ok\"};\n \n const designation = row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\"){\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when tumour_normal_designation is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when tumour_normal_designation is set to Tumour.\"};\n }\n }\n return result;\n })()"]}}},"submitter_sample_id":{"meta":{"displayName":{"left":"Submitter Sample ID","right":null}}},"sample_type":{"meta":{"displayName":{"left":"Sample Type","right":null}}}},"created":{},"deleted":{}},"donor":{"updated":{"program_id":{"meta":{"displayName":{"left":"Program ID","right":null}}},"submitter_donor_id":{"meta":{"displayName":{"left":"Submitter Donor ID","right":null}}},"vital_status":{"meta":{"displayName":{"left":"Vital Status","right":null}},"restrictions":{"codeList":{"left":["Alive","Deceased"],"right":["Alive","Deceased","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"cause_of_death":{"meta":{"displayName":{"left":"Cause of Death","right":null}},"restrictions":{"codeList":{"left":["Died of cancer","Died of other reasons","Unknown"],"right":["Died of cancer","Died of other reasons"],"data":{"added":[],"deleted":["Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })()"]}}},"survival_time":{"meta":{"displayName":{"left":"Survival Time","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })()"]},"range":{"left":{"exclusiveMin":0},"right":null}}},"height":{"valueType":{"left":"number","right":"integer"},"meta":{"displayName":{"left":"Height","right":null}},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"weight":{"valueType":{"left":"number","right":"integer"},"meta":{"displayName":{"left":"Weight","right":null}},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"bmi":{"valueType":{"left":"number","right":"integer"},"meta":{"displayName":{"left":"BMI","right":null}},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"menopause_status":{"description":{"left":"Indicate the donor's menopause status at the time of primary diagnosis. (Reference: caDSR CDE ID 2434914)","right":"Indicate the donor's menopause status at the time of primary diagnosis. (Codelist reference: NCI CDE ID: 2434914)"},"meta":{"displayName":{"left":"Menopause Status","right":null}},"restrictions":{"codeList":{"left":["Not applicable","Perimenopausal","Postmenopausal","Premenopausal","Unknown"],"right":["Premenopausal","Perimenopausal","Postmenopausal","Indeterminate or unknown","Not applicable"],"data":{"added":["Indeterminate or unknown"],"deleted":["Unknown"]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)","right":"Indicate the donor's age of menarche, the first occurrence of menstruation."},"meta":{"displayName":{"left":"Age at Menarche","right":null}},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"number_of_pregnancies":{"description":{"left":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)","right":"Indicate the number of pregnancies a donor has had."},"meta":{"displayName":{"left":"Number of Pregnancies","right":null}},"restrictions":{"range":{"left":{"min":0},"right":null}}},"number_of_children":{"description":{"left":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)","right":"Indicate the number of children the donor has birthed."},"meta":{"displayName":{"left":"Number of Children","right":null}},"restrictions":{"range":{"left":{"min":0},"right":null}}}},"created":{"prior_malignancy":{"changeType":"created","description":"Prior malignancy affecting donor.","name":"prior_malignancy","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string"},"cancer_type_prior_malignancy":{"changeType":"created","description":"ICD-10 diagnostic code for type of cancer in a prior malignancy.","name":"cancer_type_prior_malignancy","restrictions":{"regex":"[A-Z]{1}[0-9]{2}.[0-9]{0,3}[A-Z]{0,1}$"},"valueType":"string"},"age_at_prior_malignancy":{"changeType":"created","description":"If donor has history of prior malignancy, indicate age at previous diagnosis, in years.","name":"age_at_prior_malignancy","valueType":"integer"},"laterality_of_prior_malignancy":{"changeType":"created","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis.","name":"laterality_of_prior_malignancy","valueType":"string"}},"deleted":{"primary_site":{"changeType":"deleted","name":"primary_site","valueType":"string","isArray":true,"description":"The text term used to describe the primary site of disease, as categorized by the World Health Organization's (WHO) International Classification of Diseases for Oncology (ICD-O). This categorization groups cases into general categories.","meta":{"displayName":"Primary Site","core":true,"notes":"To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Breast|Ovary"},"restrictions":{"required":true,"codeList":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"]}},"genetic_disorders":{"changeType":"deleted","description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},"hrt_type":{"changeType":"deleted","description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},"hrt_duration":{"changeType":"deleted","description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},"contraception_type":{"changeType":"deleted","description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},"contraception_duration":{"changeType":"deleted","description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},"lost_to_followup_after_clinical_event_id":{"changeType":"deleted","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}}},"specimen":{"updated":{"program_id":{"meta":{"displayName":{"left":"Program ID","right":null}}},"submitter_donor_id":{"meta":{"displayName":{"left":"Submitter Donor ID","right":null}}},"submitter_specimen_id":{"meta":{"displayName":{"left":"Submitter Specimen ID","right":null}}},"pathological_tumour_staging_system":{"meta":{"validationDependency":{"left":true,"right":null},"displayName":{"left":"Pathological Tumour Staging System","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(\n field =>\n Object.keys(convertedRow).includes(field) &&\n (!convertedRow[field] || checkforEmpty(convertedRow[field])),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"data":{"added":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"deleted":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"]}}}},"pathological_t_category":{"meta":{"displayName":{"left":"Pathological T Category","right":null}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":null,"data":{"added":[],"deleted":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"]}}}},"pathological_n_category":{"meta":{"displayName":{"left":"Pathological N Category","right":null}},"restrictions":{"codeList":{"left":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"],"right":null,"data":{"added":[],"deleted":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"]}}}},"pathological_m_category":{"meta":{"displayName":{"left":"Pathological M Category","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":null,"data":{"added":[],"deleted":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"]}}}},"pathological_stage_group":{"description":{"left":"Specify the tumour stage, based on pathological_tumour_staging_system, used to assess the cancer at the time the tumour specimen was resected.","right":"Specify the tumour stage, based on tumor_staging_system, used to assess the cancer at the time the tumour specimen was resected."},"meta":{"notes":{"left":"This field depends on the selected pathological_tumour_staging_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","right":"This field depends on the selected pathological staging system, and is only required if the specimen is a tumour."},"displayName":{"left":"Pathological Stage Group","right":null}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":null,"data":{"added":[],"deleted":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":null}}},"specimen_acquisition_interval":{"meta":{"notes":{"left":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":null},"displayName":{"left":"Specimen Acquisition Interval","right":null}}},"tumour_histological_type":{"description":{"left":"The code to represent the histology (morphology) of neoplasms that is usually obtained from a pathology report, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","right":"The code to represent the histology (morphology) of neoplasms that is usually obtained from a pathology report, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Please refer to the guidelines provided in the ICD-O-3 manual at https://apps.who.int/iris/handle/10665/42344."},"meta":{"validationDependency":{"left":true,"right":null},"displayName":{"left":"Tumour Histological Type","right":null}}},"specimen_anatomic_location":{"description":{"left":"Indicate the ICD-O-3 topography code for the anatomic location of a specimen when it was collected. Refer to the guidelines provided in the ICD-O-3 manual at https://apps.who.int/iris/handle/10665/42344.","right":"Anatomic location of a specimen when it was collected."},"meta":{"displayName":{"left":"Specimen Anatomic Location","right":null},"examples":{"left":"C50.1,C18","right":null}},"restrictions":{"regex":{"left":"^[C][0-9]{2}(.[0-9]{1})?$","right":null},"codeList":{"right":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear, pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal; distal","Esophageal; mid","Esophageal; proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck, NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es), maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"],"data":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear, pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal; distal","Esophageal; mid","Esophageal; proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck, NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es), maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"]}}},"specimen_processing":{"meta":{"displayName":{"left":"Specimen Processing","right":null}},"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation, other","Formalin fixed & paraffin embedded","Formalin fixed, buffered","Formalin fixed, unbuffered","Fresh","Other"],"data":{"added":["Cryopreservation, other","Formalin fixed, buffered","Formalin fixed, unbuffered"],"deleted":["Cryopreservation - other","Formalin fixed - buffered","Formalin fixed - unbuffered","Unknown"]}}}},"specimen_storage":{"description":{"left":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured.","right":"Indicate the method of specimen storage for specimens that were not extracted freshly or immediately cultured."},"meta":{"displayName":{"left":"Specimen Storage","right":null}},"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"right":["Cut slide","Frozen, -70 freezer","Frozen, liquid nitrogen","Frozen, vapor phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"data":{"added":["Frozen, -70 freezer","Frozen, liquid nitrogen","Frozen, vapor phase"],"deleted":["Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Unknown"]}}}},"tumour_grading_system":{"meta":{"validationDependency":{"left":true,"right":null},"displayName":{"left":"Tumour Grading System","right":null}},"restrictions":{"codeList":{"left":["FNCLCC grading system","Four-tier grading system","Gleason grade group system","Grading system for GISTs","Grading system for GNETs","ISUP grading system","Nuclear grading system for DCIS","Scarff-Bloom-Richardson grading system","Three-tier grading system","Two-tier grading system","WHO grading system for CNS tumours"],"right":["Default","Gleason","Nottingham","Brain cancer","ISUP","Lymphoid neoplasms"],"data":{"added":["Default","Gleason","Nottingham","Brain cancer","ISUP","Lymphoid neoplasms"],"deleted":["FNCLCC grading system","Four-tier grading system","Gleason grade group system","Grading system for GISTs","Grading system for GNETs","ISUP grading system","Nuclear grading system for DCIS","Scarff-Bloom-Richardson grading system","Three-tier grading system","Two-tier grading system","WHO grading system for CNS tumours"]}}}},"tumour_grade":{"meta":{"notes":{"left":"This field depends on the selected tumour_grading_system, and is only required if the specimen is a tumour.\nPlease refer to the documentation for Tumour Grading Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-grading-classifications","right":"This field depends on the selected tumour grading system, and is only required if the specimen is a tumour."},"displayName":{"left":"Tumour Grade","right":null}},"restrictions":{"codeList":{"left":["Low grade","High grade","GX","G1","G2","G3","G4","Low","High","Grade I","Grade II","Grade III","Grade IV","Grade Group 1","Grade Group 2","Grade Group 3","Grade Group 4","Grade Group 5"],"data":["Low grade","High grade","GX","G1","G2","G3","G4","Low","High","Grade I","Grade II","Grade III","Grade IV","Grade Group 1","Grade Group 2","Grade Group 3","Grade Group 4","Grade Group 5"]},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'default':\n codeList = [\n 'gx - cannot be assessed',\n 'g1 well differentiated/low grade',\n 'g2 moderately differentiated/intermediated grade',\n 'g3 poorly differentiated/high grade',\n 'g4 undifferentiated/high grade',\n ];\n break;\n case 'gleason':\n codeList = [\n 'gleason x: gleason score cannot be determined',\n 'gleason 2–6: the tumor tissue is well differentiated',\n 'gleason 7: the tumor tissue is moderately differentiated',\n 'gleason 8–10: the tumor tissue is poorly differentiated or undifferentiated',\n ];\n break;\n case 'nottingham':\n codeList = [\n 'g1 (low grade or well differentiated)',\n 'g2 (intermediate grade or moderately differentiated)',\n 'g3 (high grade or poorly differentiated)',\n ];\n break;\n case 'brain cancer':\n codeList = ['grade i', 'grade ii', 'grade iii', 'grade iv'];\n break;\n case 'isup for renal cell carcinoma':\n codeList = [\n 'grade 1: tumor cell nucleoli invisible or small and basophilic at 400 x magnification',\n 'grade 2: tumor cell nucleoli conspicuous at 400 x magnification but inconspicuous at 100 x magnification',\n 'grade 3: tumor cell nucleoli eosinophilic and clearly visible at 100 x magnification',\n 'grade 4: tumors showing extreme nuclear pleomorphism and/or containing tumor giant cells and/or the presence of any proportion of tumor showing sarcomatoid and/or rhabdoid dedifferentiation',\n ];\n break;\n case 'lymphoid neoplasms':\n codeList = ['low grade or indolent nhl', 'high grade or aggressive nhl'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })()"]}}},"percent_tumour_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)","right":"Indicate a value, in decimals, that represents the percentage of infiltration by tumour cells in a specimen."},"meta":{"displayName":{"left":"Percent Tumour Cells","right":null}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null},"script":{"left":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"],"right":null}}},"percent_proliferating_cells":{"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"displayName":{"left":"Percent Proliferating Cells","right":null},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_inflammatory_tissue":{"description":{"left":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)","right":"Indicate a value, in decimals, that represents local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"displayName":{"left":"Percent Inflammatory Tissue","right":null},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_stromal_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)","right":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a malignant tumour specimen but are not malignant such as fibroblasts, vascular structures, etc."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"displayName":{"left":"Percent Stromal Cells","right":null},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_necrosis":{"description":{"left":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)","right":"Indicate a value, in decimals, that represents the percentage of cell death in a malignant tumour specimen."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"displayName":{"left":"Percent Necrosis","right":null},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}}},"created":{"central_pathology_confirmed":{"changeType":"created","name":"central_pathology_confirmed","description":"Indicate whether the histologic description of tissue or cells was confirmed by a pathology review of frozen or formalin fixed slide(s) completed after the diagnostic pathology review of the tumour sample used to extract analyte(s).","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour."},"restrictions":{"codeList":["Yes","No","Unknown"]}}},"deleted":{"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate the primary diagnosis event in the clinical timeline that this specimen acquisition was related to.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"specimen_laterality":{"changeType":"deleted","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"reference_pathology_confirmed":{"changeType":"deleted","name":"reference_pathology_confirmed","description":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)","valueType":"string","meta":{"validationDependency":true,"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Reference Pathology Confirmed"},"restrictions":{"codeList":["Yes","No","Unknown"]}},"percent_tumour_cells_measurement_method":{"changeType":"deleted","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}}},"primary_diagnosis":{"updated":{"program_id":{"meta":{"displayName":{"left":"Program ID","right":null}}},"submitter_donor_id":{"meta":{"displayName":{"left":"Submitter Donor ID","right":null}}},"age_at_diagnosis":{"description":{"left":"Age that the donor was first diagnosed with cancer, in years. This should be based on the earliest diagnosis of cancer.","right":"Age that the donor was first diagnosed with cancer, in years."},"meta":{"displayName":{"left":"Age at Diagnosis","right":null}},"restrictions":{"range":{"left":{"exclusiveMin":0,"max":90},"right":null}}},"cancer_type_code":{"description":{"left":"The code to represent the cancer type using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","right":"The code to represent the cancer type using the WHO ICD-10 code (https://icd.who.int/browse10/2016/en#/) classification."},"meta":{"examples":{"left":"C41.1,C16.9,C00.5,D46.9","right":"C41.1,C16.9,C00.543A"},"displayName":{"left":"Cancer Type Code","right":null}},"restrictions":{"regex":{"left":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","right":"^C[0-9]{2}.[0-9]{0,3}[A-Z]{0,1}$"}}},"basis_of_diagnosis":{"meta":{"displayName":{"left":"Basis of Diagnosis","right":null}}},"number_lymph_nodes_examined":{"description":{"left":"The total number of lymph nodes tested for the presence of cancer. (Reference: caDSR CDE ID 3)","right":"The total number of lymph nodes tested for the presence of cancer. (Reference: NCI CDE ID: 3)"},"meta":{"displayName":{"left":"Number Of Lymph Nodes Examined","right":null},"dependsOn":{"left":"primary_diagnosis.lymph_nodes_examined_status","right":null},"notes":{"left":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":null},"range":{"left":{"min":0},"right":null}}},"number_lymph_nodes_positive":{"description":{"left":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: caDSR CDE ID 6113694)","right":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: NCI CDE ID: 6113694)"},"meta":{"displayName":{"left":"Number Of Lymph Nodes Positive","right":null},"dependsOn":{"left":"primary_diagnosis.lymph_nodes_examined_status","right":null},"notes":{"left":"This field is only required if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":null},"range":{"left":{"min":0},"right":null},"required":{"left":null,"right":true}}},"clinical_tumour_staging_system":{"meta":{"validationDependency":{"left":true,"right":null},"displayName":{"left":"Clinical Tumour Staging System","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(\n field =>\n Object.keys(convertedRow).includes(field) &&\n (!convertedRow[field] || checkforEmpty(convertedRow[field])),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"data":{"added":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"deleted":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"]}},"required":{"left":null,"right":true}}},"clinical_t_category":{"meta":{"displayName":{"left":"Clinical T Category","right":null}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":null,"data":{"added":[],"deleted":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"]}}}},"clinical_n_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"displayName":{"left":"Clinical N Category","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"],"right":null,"data":{"added":[],"deleted":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"]}}}},"clinical_m_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned.","right":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at time of primary diagnosis and prior to treatment, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual. MX is NOT a valid category and cannot be assigned."},"meta":{"displayName":{"left":"Clinical M Category","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":null,"data":{"added":[],"deleted":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"]}}}},"clinical_stage_group":{"description":{"left":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage.","right":"Stage group of the tumour, as assigned by the reporting tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.)."},"meta":{"notes":{"left":"This field is dependent on the selected clinical_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","right":null},"displayName":{"left":"Clinical Stage Group","right":null},"examples":{"left":"Stage I, Stage IIB","right":null}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"presenting_symptoms":{"meta":{"displayName":{"left":"Presenting Symptoms","right":null},"notes":{"left":"To include multiple values, separate values with a pipe delimiter '|' within your file.","right":null},"examples":{"left":"Anemia|Bloating|Diabetes","right":null}},"restrictions":{"codeList":{"left":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Loss of Appetite","Nausea","None","Not Reported","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Swelling in the Neck","Unknown","Vomiting","Weight Loss"],"right":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Nausea","None","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Unknown","Vomiting","Weight Loss"],"data":{"added":[],"deleted":["Loss of Appetite","Not Reported","Swelling in the Neck"]}}}},"performance_status":{"description":{"left":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status).","right":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference source: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status)."},"meta":{"notes":{"left":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction.\nGrade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work).\nGrade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours.\nGrade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours.\nGrade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair","right":"Grade 0: Fully active, able to carry on all pre-disease performance without restriction \n Grade 1: Restricted in physically strenuous activity but ambulatory and able to carry out work of a light or sedentary nature (ie. Light house work, office work) \n Grade 2: Ambulatory and capable of all selfcare but unable to carry out any work activities; up and about more than 50% of waking hours \n Grade 3: Capable of only limited selfcare; confined to bed or chair more than 50% of waking hours \n Grade 4: Completely disabled; cannot carry on any selfcare; totally confined to bed or chair"},"displayName":{"left":"Performance Status","right":null}},"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"data":{"added":[],"deleted":["Unknown"]}}}}},"created":{"stage_suffix":{"changeType":"created","name":"stage_suffix","description":"If necessary, use this field to add any applicable stage suffixes. Stage suffixes may apply to certain staging systems such as Ann Arbour staging system where the four stages are divided into 4 categories (A, B, X and E).","valueType":"string","meta":{"core":true,"dependsOn":"primary_diagnosis.clinical_tumour_staging_system"}}},"deleted":{"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Unique identifier of the primary diagnosis event, assigned by the data provider.","meta":{"primaryId":true,"displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"cancer_type_additional_information":{"changeType":"deleted","name":"cancer_type_additional_information","valueType":"string","description":"Additional details related to the cancer type that are not covered by the ICD-10 code provided in the cancer_type field.","meta":{"displayName":"Cancer Type Additional Information"}},"laterality":{"changeType":"deleted","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_status":{"changeType":"deleted","name":"lymph_nodes_examined_status","description":"Indicate if lymph nodes were examined for metastases.","valueType":"string","restrictions":{"required":true,"codeList":["Cannot be determined","No","No lymph nodes found in resected specimen","Not applicable","Yes"]},"meta":{"core":true,"displayName":"Lymph Nodes Examined Status"}},"lymph_nodes_examined_method":{"changeType":"deleted","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}}},"treatment":{"updated":{"program_id":{"meta":{"displayName":{"left":"Program ID","right":null}}},"submitter_donor_id":{"meta":{"displayName":{"left":"Submitter Donor ID","right":null}}},"submitter_treatment_id":{"meta":{"displayName":{"left":"Submitter Treatment ID","right":null}}},"treatment_type":{"meta":{"notes":{"left":"Depending on the treatment_type(s) selected, additional treatment details may be required to be submitted. For example, if treatment_type includes 'Chemotherapy', the supplemental Chemotherapy treatment type file is required.\nTo include multiple values, separate values with a pipe delimiter '|' within your file.","right":"Depending on the treatment_type selected, additional treament details may be required to be submitted."},"displayName":{"left":"Treatment Type","right":null},"examples":{"left":"Chemotherapy|Hormonal therapy","right":null}},"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Chemotherapy","Ablation","Bone marrow transplant","Combined chemo+immunotherapy","Combined chemo+radiation therapy","Combined chemo-radiotherapy and surgery","Endoscopic therapy","Hormonal therapy","Immunotherapy","Monoclonal antibodies (for liquid tumours)","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgical resection"],"data":{"added":["Combined chemo+immunotherapy","Combined chemo+radiation therapy","Combined chemo-radiotherapy and surgery","Monoclonal antibodies (for liquid tumours)","Surgical resection"],"deleted":["End of life care","Surgery"]}}}},"is_primary_treatment":{"description":{"left":"Indicate if the treatment was the primary treatment following the initial diagnosis.","right":"Indicate if the treamtment was the primary treatment following the initial diagnosis."},"meta":{"displayName":{"left":"Is Primary Treatment","right":null},"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"codeList":{"left":["Yes","No"],"right":["Yes","No","Unknown"],"data":{"added":["Unknown"],"deleted":[]}},"required":{"left":null,"right":true}}},"treatment_start_interval":{"description":{"left":"The interval between the primary diagnosis and initiation of treatment, in days.","right":"The interval between primary diagnosis and initiation of treatment, in days."},"meta":{"notes":{"left":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":null},"displayName":{"left":"Treatment Start Interval","right":null},"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"treatment_duration":{"description":{"left":"The duration of treatment regimen, in days.","right":"The duration of treatment regimen, in days"},"meta":{"displayName":{"left":"Treatment Duration","right":null},"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null},"required":{"left":null,"right":true}}}},"created":{"age_at_consent_for_treatment":{"changeType":"created","name":"age_at_consent_for_treatment","description":"Indicate the age of donor when consent was given for treatment.","valueType":"integer"},"therapeutic_intent":{"changeType":"created","name":"therapeutic_intent","description":"The therapeutic intent, the reason behind the choice of a therapy, of the treatment.","valueType":"string","restrictions":{"required":true,"codeList":["Adjuvant","Concurrent","Curative","Neoadjuvant","Not applicable","Palliative","Unknown"]},"meta":{"core":true}},"response_to_therapy":{"changeType":"created","name":"response_to_therapy","description":"The donors's response to the applied treatment regimen. (Source: RECIST)","valueType":"string","restrictions":{"required":true,"codeList":["Complete response","Disease progression","NED","Partial response","Stable disease"]},"meta":{"core":true}}},"deleted":{"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate the primary diagnosis event in the clinical timeline that this treatment was related to.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"line_of_treatment":{"changeType":"deleted","name":"line_of_treatment","description":"Indicate the line of treatment if it is not the primary treatment.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Line Of treatment","dependsOn":"treatment.is_primary_treatment","examples":"2,3,4"}},"days_per_cycle":{"changeType":"deleted","name":"days_per_cycle","description":"Indicate the number of days in a treatment cycle.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Days Per Cycle","dependsOn":"treatment.treatment_type"}},"number_of_cycles":{"changeType":"deleted","name":"number_of_cycles","description":"Indicate the number of treatment cycles.","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Number Of Cycles","dependsOn":"treatment.treatment_type"}},"treatment_intent":{"changeType":"deleted","name":"treatment_intent","description":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"]},"meta":{"core":true,"displayName":"Treatment Intent","dependsOn":"treatment.treatment_type"}},"treatment_setting":{"changeType":"deleted","name":"treatment_setting","description":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: NCIt C124308)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"]},"meta":{"core":true,"displayName":"Treatment Setting","dependsOn":"treatment.treatment_type"}},"response_to_treatment_criteria_method":{"changeType":"deleted","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},"response_to_treatment":{"changeType":"deleted","name":"response_to_treatment","description":"The donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"codeList":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"]},"meta":{"core":true,"displayName":"Response To Treatment","dependsOn":"treatment.response_to_treatment_criteria_method","notes":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"outcome_of_treatment":{"changeType":"deleted","name":"outcome_of_treatment","description":"Indicate the donor's outcome of the prescribed treatment.","valueType":"string","restrictions":{"codeList":["Treatment completed as prescribed","Treatment incomplete due to technical or organizational problems","Treatment incomplete because patient died","Patient choice (stopped or interrupted treatment)","Physician decision (stopped or interrupted treatment)","Treatment stopped due to lack of efficacy (disease progression)","Treatment stopped due to acute toxicity","Other","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Outcome Of Treatment","dependsOn":"treatment.treatment_type"}},"toxicity_type":{"changeType":"deleted","name":"toxicity_type","description":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity.","valueType":"string","restrictions":{"codeList":["Hematological","Non-hematological","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Toxicity Type","dependsOn":"treatment.outcome_of_treatment"}},"hematological_toxicity":{"changeType":"deleted","name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"non-hematological_toxicity":{"changeType":"deleted","name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"adverse_events":{"changeType":"deleted","name":"adverse_events","description":"Report any treatment related adverse events. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Adverse Events","dependsOn":"treatment.treatment_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"clinical_trials_database":{"changeType":"deleted","name":"clinical_trials_database","description":"If the donor is a participant in a clinical trial, indicate the clinical trial database where the clinical trial is registered.","valueType":"string","meta":{"display name":"Clinical Trials Database","notes":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added."},"restrictions":{"codeList":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"]}},"clinical_trial_number":{"changeType":"deleted","name":"clinical_trial_number","description":"Based on the clinical_trial_database, indicate the unique NCT or EudraCT clinical trial identifier of which the donor is a participant.","valueType":"string","meta":{"display name":"Clinical Trial Number","dependsOn":"treatment.clinical_trials_database","examples":"2016-002120-83,NCT02465060"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"]}}}},"chemotherapy":{"updated":{"program_id":{"meta":{"displayName":{"left":"Program ID","right":null}}},"submitter_donor_id":{"meta":{"displayName":{"left":"Submitter Donor ID","right":null}}},"submitter_treatment_id":{"meta":{"displayName":{"left":"Submitter Treatment ID","right":null}}}},"created":{"chemotherapy_drug_name":{"changeType":"created","name":"chemotherapy_drug_name","description":"Name of agent or drug administered to patient as part of the chemotherapy treatment regimen.","valueType":"string","restrictions":{"required":true,"codeList":["Placeholder list 1","Need list","Still need it"]},"meta":{"validationDependency":true,"core":true,"notes":"This field uses a controlled vocabulary gathered from the DrugBank database of drug names.","examples":"Allopurinol, Dronabinol, Sucralfate, Lapatinib"}},"chemotherapy_dosage_units":{"changeType":"created","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m²","IU/m²","µg/m²","g/m²","mg/kg"]},"meta":{"core":true}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate the total drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"integer","restrictions":{"required":true},"meta":{"core":true}}},"deleted":{"drug_rxnormcui":{"changeType":"deleted","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"deleted","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"deleted","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"deleted","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"deleted","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"deleted","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}}},"hormone_therapy":{"updated":{"program_id":{"meta":{"displayName":{"left":"Program ID","right":null}}},"submitter_donor_id":{"meta":{"displayName":{"left":"Submitter Donor ID","right":null}}},"submitter_treatment_id":{"meta":{"displayName":{"left":"Submitter Treatment ID","right":null}}}},"created":{"hormone_therapy_drug_name":{"changeType":"created","name":"hormone_therapy_drug_name","description":"Name of agent or drug administered to patient as part of the hormone therapy treatment regimen.","valueType":"string","restrictions":{"required":true,"codeList":["Placeholder list 1","Need list","Still need it"]},"meta":{"validationDependency":true,"core":true,"notes":"This field uses a controlled vocabulary gathered from the DrugBank database of drug names."}},"hormone_drug_dosage_units":{"changeType":"created","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m²","IU/m²","µg/m²","g/m²","mg/kg"]},"meta":{"core":true}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"integer","restrictions":{"required":true},"meta":{"core":true}}},"deleted":{"drug_rxnormcui":{"changeType":"deleted","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"deleted","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Hormone Therapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"deleted","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"radiation":{"updated":{"program_id":{"meta":{"displayName":{"left":"Program ID","right":null}}},"submitter_donor_id":{"meta":{"displayName":{"left":"Submitter Donor ID","right":null}}},"submitter_treatment_id":{"meta":{"displayName":{"left":"Submitter Treatment ID","right":null}}},"radiation_therapy_modality":{"meta":{"displayName":{"left":"Radiation Therapy Modality","right":null}}},"radiation_therapy_fractions":{"description":{"left":"Indicate the total number of fractions delivered as part of treatment.","right":"Indicate the number of total fractions delivered as part of treatment."},"meta":{"displayName":{"left":"Radiation Therapy Fractions","right":null}},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"radiation_therapy_dosage":{"valueType":{"left":"number","right":"integer"},"meta":{"displayName":{"left":"Radiation Therapy Dosage","right":null}},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"anatomical_site_irradiated":{"description":{"left":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)","right":"Indicate localization site where radiation therapy was administered."},"meta":{"displayName":{"left":"Anatomical Site Irradiated","right":null}},"restrictions":{"codeList":{"left":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"right":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"data":{"added":["Bone","Extremities","Head-Neck","Peritoneum"],"deleted":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"]}}}}},"created":{"application_form":{"changeType":"created","name":"application_form","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal (including Brachytherapy)"]},"meta":{"core":true}}},"deleted":{"radiation_therapy_type":{"changeType":"deleted","name":"radiation_therapy_type","description":"Indicate type of radiation therapy administered.","valueType":"string","restrictions":{"required":true,"codeList":["External","Internal"]},"meta":{"core":true,"displayName":"Type of Radiation Therapy","notes":"Internal application includes Brachytherapy."}},"radiation_boost":{"changeType":"deleted","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"deleted","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}}},"immunotherapy":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"immunotherapy_type":{"changeType":"deleted","name":"immunotherapy_type","valueType":"string","description":"Indicate the type of immunotherapy administered to donor.","meta":{"displayName":"Immunotherapy Type","core":true},"restrictions":{"required":true,"codeList":["Cell-based","Immune checkpoint inhibitors","Monoclonal antibodies other than immune checkpoint inhibitors","Other immunomodulatory substances"]}},"drug_rxnormcui":{"changeType":"deleted","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"deleted","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"deleted","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"surgery":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"deleted","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"deleted","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"deleted","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"deleted","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"deleted","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"deleted","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"deleted","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"deleted","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"deleted","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"deleted","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"deleted","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"deleted","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"deleted","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"deleted","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}}},"follow_up":{"updated":{"program_id":{"meta":{"displayName":{"left":"Program ID","right":null}}},"submitter_donor_id":{"meta":{"displayName":{"left":"Submitter Donor ID","right":null}}},"submitter_follow_up_id":{"description":{"left":"Unique identifier for a follow-up event in a donor's clinical record, assigned by the data provider.","right":"Unique identifier for a follow-up event in a donors clincal record, assigned by the data provider."},"meta":{"displayName":{"left":"Submitter Follow-Up ID","right":null}}},"interval_of_followup":{"description":{"left":"Interval from the primary diagnosis date to the follow-up date, in days.","right":"Interval from the primary diagnosis date to the follow up date, in days."},"meta":{"displayName":{"left":"Interval Of Follow-Up","right":null},"notes":{"left":"The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis.","right":null}}},"disease_status_at_followup":{"description":{"left":"Indicate the donor's disease status at time of follow-up. (Reference: RECIST)","right":"Indicate the donor's disease status at time of follow-up."},"meta":{"displayName":{"left":"Disease Status at Follow-Up","right":null}},"restrictions":{"codeList":{"left":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Progression NOS","Relapse or recurrence","Stable"],"right":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Relapse","Stable"],"data":{"added":["Relapse"],"deleted":["Progression NOS","Relapse or recurrence"]}}}},"relapse_type":{"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.","right":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse."},"displayName":{"left":"Relapse Type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":null}}},"relapse_interval":{"description":{"left":"If the donor was clinically disease free following primary treatment and then relapse or recurrence or progression (for liquid tumours) occurred afterwards, then this field will indicate the length of disease free interval, in days.","right":"If the donor was clinically disease free following primary treatment and then relapse or progression (for liquid tumours) occurred afterwards, then this field will indicate the length of disease free interval, in days."},"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.","right":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse."},"displayName":{"left":"Relapse Interval","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"]}}},"method_of_progression_status":{"description":{"left":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Reference: caDSR CDE ID 6161031)","right":"Indicate the method(s) used to confirm the donor's progression disease status. (Codelist reference: NCI CDE ID: 6161031)"},"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file.","right":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse."},"displayName":{"left":"Method Of Progression Status","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"]},"codeList":{"left":["Biomarker in liquid biopsy (e.g. tumour marker in blood or urine)","Biopsy","Blood draw","Bone marrow aspirate","Core biopsy","Cystoscopy","Cytology","Debulking","Diagnostic imaging","Dilation and curettage procedure","Enucleation","Excisional biopsy","Fine needle aspiration","Imaging","Incisional biopsy","Laparoscopy","Laparotomy","Other","Pap Smear","Pathologic review","Physical exam","Surgical resection","Thoracentesis","Ultrasound guided biopsy"],"right":["Autopsy","Biomarker in liquid biopsy (e.g. tumor marker in blood or urine)","Biopsy","Blood draw","Bone marrow aspirate","Core biopsy","Cystoscopy","Cytology","Debulking","Diagnostic imaging","Dilation and curettage procedure","Enucleation","Excisional biopsy","Fine needle aspiration","Imaging","Incisional biopsy","Laparoscopy","Laparotomy","Other","Pap Smear","Pathologic review","Physical exam","Surgical resection","Thoracentesis","Ultrasound guided biopsy"],"data":{"added":["Autopsy","Biomarker in liquid biopsy (e.g. tumor marker in blood or urine)"],"deleted":["Biomarker in liquid biopsy (e.g. tumour marker in blood or urine)"]}}}},"recurrence_tumour_staging_system":{"meta":{"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.","right":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse."},"displayName":{"left":"Recurrance Tumour Staging System","right":null},"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"data":{"added":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"deleted":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(\n field =>\n Object.keys(convertedRow).includes(field) &&\n (!convertedRow[field] || checkforEmpty(convertedRow[field])),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"]}}},"recurrence_t_category":{"description":{"left":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the extent of the primary tumour (T) based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"displayName":{"left":"Recurrence T Category","right":null},"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":null,"data":{"added":[],"deleted":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"]}}}},"recurrence_n_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"displayName":{"left":"Recurrence N Category","right":null},"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"],"right":null,"data":{"added":[],"deleted":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"]}}}},"recurrence_m_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined determined at the time of retreatment for a recurrence or disease progression, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"displayName":{"left":"Recurrence M Category","right":null},"core":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":null,"data":{"added":[],"deleted":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"]}}}},"recurrence_stage_group":{"description":{"left":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) at the time of retreatment for a recurrence or disease progression.","right":"The code to represent the stage group of the tumour, as assigned by the reporting recurrence_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.) after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery."},"meta":{"notes":{"left":"This field is dependent on the selected recurrence_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","right":null},"displayName":{"left":"Recurrence Stage Group","right":null},"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":null,"data":{"added":[],"deleted":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":null}}},"posttherapy_tumour_staging_system":{"meta":{"displayName":{"left":"Post-therapy Tumour Staging System","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n /* search for fields with falsy values, given the field exists */\n const emptyFields = requiredFields.filter(\n field =>\n Object.keys(convertedRow).includes(field) &&\n (!convertedRow[field] || checkforEmpty(convertedRow[field])),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"data":{"added":["Binet","Rai","FIGO","Ann Arbor","Murphy","Lugano","AJCC 8th Edition","AJCC 7th Edition","AJCC 6th Edition","AJCC 5th Edition","AJCC 4th Edition","AJCC 3rd Edition","AJCC 2nd Edition","AJCC 1st Edition"],"deleted":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"]}}}},"posttherapy_t_category":{"meta":{"dependsOn":{"left":"follow_up.posttherapy_tumour_staging_system","right":"follow_up.post_therapy_tumour_staging_system"},"displayName":{"left":"Post-therapy T Category","right":null}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":null,"data":{"added":[],"deleted":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"]}}}},"posttherapy_n_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined by which is the extent of the regional lymph node (N) involvement for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"dependsOn":{"left":"follow_up.posttherapy_tumour_staging_system","right":"follow_up.post_therapy_tumour_staging_system"},"displayName":{"left":"Post-therapy N Category","right":null}},"restrictions":{"codeList":{"left":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"],"right":null,"data":{"added":[],"deleted":["N0","N0a","N0a (biopsy)","N0b","N0b (no biopsy)","N0(i+)","N0(i-)","N0(mol+)","N0(mol-)","N1","N1a","N1a(sn)","N1b","N1c","N1mi","N2","N2a","N2b","N2c","N2mi","N3","N3a","N3b","N3c","N4","NX"]}}}},"posttherapy_m_category":{"description":{"left":"The code to represent the stage of cancer defined by the extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual.","right":"The code to represent the stage of cancer defined bythe extent of the distant metastasis (M) for the cancer based on evidence obtained from clinical assessment parameters determined determined after treatment for patients receiving systemic and/or radiation therapy alone or as a component of their initial treatment, or as neoadjuvant therapy before planned surgery, according to criteria based on multiple editions of the AJCC's Cancer Staging Manual."},"meta":{"dependsOn":{"left":"follow_up.posttherapy_tumour_staging_system","right":"follow_up.post_therapy_tumour_staging_system"},"displayName":{"left":"Post-therapy M Category","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":null,"data":{"added":[],"deleted":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"]}}}},"posttherapy_stage_group":{"meta":{"dependsOn":{"left":"follow_up.posttherapy_tumour_staging_system","right":"follow_up.post_therapy_tumour_staging_system"},"notes":{"left":"This field is dependent on the selected posttherapy_tumour_staging_system.\nPlease refer to the documentation for Tumour Staging Classifications: http://docs.icgc-argo.org/docs/submission/dictionary-overview#tumour-staging-classifications","right":"This field value is dependent on the selected posttherapy_tumour_staging_system."},"displayName":{"left":"Post-therapy Stage Group","right":null}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":null,"data":{"added":[],"deleted":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":null}}}},"created":{"anatomic_site_progression_or_recurrences":{"changeType":"created","description":"Indicate the anatomic site where disease progression or recurrence occurred. (Codelist reference: NCI CDE ID: 4742851)","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus.match(/(progression)$/);\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is of type 'progression'.` }\n }\n\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n\n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n\n const isRequired = diseaseStatus === \"relapse\";\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if (isRequired && (!$field || checkforEmpty($field))){\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' set to 'relapse'.` }\n }\n\n return result;\n })()"],"codeList":["Abdomen","Abdominal wall","Acetabulum","Adenoid","Adipose","Adrenal","Adrenal gland","Alveolar ridge","Amniotic fluid","Ampulla of Vater","Anal sphincter","Ankle","Anorectum","Antecubital fossa","Antrum","Anus","Aorta","Aortic body","Appendix","Aqueous fluid","Arm","Artery","Ascending colon","Ascending colon hepatic flexure","Ascites","Auditory canal","Autonomic nervous system","Axilla","Back","Bile duct","Bladder","Blood","Blood vessel","Bone","Bone marrow","Bowel","Brain","Brain stem","Breast","Broad ligament","Bronchiole","Bronchus","Brow","Buccal cavity","Buccal mucosa","Buttock","Calf","Capillary","Cardia","Carina","Carotid artery","Carotid body","Cartilage","Cecum","Cell-line","Central nervous system","Cerebellum","Cerebral cortex","Cerebrospinal fluid","Cerebrum","Cervical spine","Cervix","Chest","Chest wall","Chin","Clavicle","Clitoris","CNS/spinal","Colon","Colon - mucosa only","Colorectal","Common duct","Conjunctiva","Connective tissue","Dermal","Descending colon","Diaphragm","Duodenum","Ear","Ear canal","Ear, pinna (external)","Effusion","Elbow","Endocrine gland","Epididymis","Epidural space","Esophageal; distal","Esophageal; mid","Esophageal; proximal","Esophagogastric junction","Esophagus","Esophagus - mucosa only","Eye","Fallopian tube","Femoral artery","Femoral vein","Femur","Fibroblasts","Fibula","Finger","Floor of mouth","Fluid","Foot","Forearm","Forehead","Foreskin","Frontal cortex","Frontal lobe","Fundus of stomach","Gallbladder","Ganglia","Gastroesophageal junction","Gastrointestinal tract","Groin","Gum","Hand","Hard palate","Head - face or neck, NOS","Head and neck","Heart","Hepatic","Hepatic duct","Hepatic flexure","Hepatic vein","Hip","Hippocampus","Humerus","Hypopharynx","Ileum","Ilium","Index finger","Ischium","Islet cells","Jaw","Jejunum","Joint","Kidney","Knee","Lacrimal gland","Large bowel","Laryngopharynx","Larynx","Leg","Leptomeninges","Ligament","Lip","Liver","Lumbar spine","Lung","Lymph node","Lymph node(s) axilla","Lymph node(s) cervical","Lymph node(s) distant","Lymph node(s) epitrochlear","Lymph node(s) femoral","Lymph node(s) hilar","Lymph node(s) iliac-common","Lymph node(s) iliac-external","Lymph node(s) inguinal","Lymph node(s) internal mammary","Lymph node(s) mammary","Lymph node(s) mesenteric","Lymph node(s) occipital","Lymph node(s) paraaortic","Lymph node(s) parotid","Lymph node(s) pelvic","Lymph node(s) popliteal","Lymph node(s) regional","Lymph node(s) retroperitoneal","Lymph node(s) scalene","Lymph node(s) splenic","Lymph node(s) subclavicular","Lymph node(s) submandibular","Lymph node(s) supraclavicular","Lymph nodes(s) mediastinal","Mandible","Maxilla","Mediastinal soft tissue","Mediastinum","Mesentery","Mesothelium","Middle finger","Mitochondria","Muscle","Nails","Nasal cavity","Nasal soft tissue","Nasopharynx","Neck","Nerve","Nerve(s) cranial","Occipital cortex","Ocular orbits","Omentum","Oral cavity","Oral cavity - mucosa only","Oropharynx","Other","Ovary","Palate","Pancreas","Paraspinal ganglion","Parathyroid","Parotid gland","Patella","Pelvis","Penis","Pericardium","Periorbital soft tissue","Peritoneal cavity","Peritoneum","Pharynx","Pineal","Pineal gland","Pituitary gland","Placenta","Pleura","Pleural effusion","Popliteal fossa","Prostate","Pylorus","Rectosigmoid junction","Rectum","Retina","Retro-orbital region","Retroperitoneum","Rib","Ring finger","Round ligament","Sacrum","Salivary gland","Scalp","Scapula","Sciatic nerve","Scrotum","Seminal vesicle","Shoulder","Sigmoid colon","Sinus","Sinus(es), maxillary","Skeletal muscle","Skin","Skull","Small bowel","Small bowel - mucosa only","Small finger","Soft tissue","Spinal column","Spinal cord","Spleen","Splenic flexure","Sternum","Stomach","Stomach - mucosa only","Subcutaneous tissue","Synovium","Temporal cortex","Tendon","Testis","Thigh","Thoracic spine","Thorax","Throat","Thumb","Thymus","Thyroid","Tibia","Tongue","Tonsil","Tonsil (pharyngeal)","Trachea / major bronchi","Transverse colon","Trunk","Umbilical cord","Ureter","Urethra","Urinary tract","Uterus","Uvula","Vagina","Vas deferens","Vein","Venous","Vertebra","Vulva","White blood cells","Wrist"]},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","notes":"This field is required to be submitted if disease_status_at_followup indicates progression or relapse."}}},"deleted":{"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"Indicate if the follow-up is related to a specific primary diagnosis event in the clinical timeline.","meta":{"validationDependency":true,"foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","displayName":"Submitter Primary Diagnosis ID","primaryId":true},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"Indicate if the follow-up is related to a specific treatment event in the clinical timeline.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"weight_at_followup":{"changeType":"deleted","description":"Indicate the donor's weight, in kilograms (kg), at the time of follow-up.","name":"weight_at_followup","valueType":"number","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Weight at Follow-Up"}},"anatomic_site_progression_or_recurrence":{"changeType":"deleted","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"exposure":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"deleted","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"deleted","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"deleted","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"deleted","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"deleted","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"deleted","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"deleted","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"deleted","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"deleted","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"deleted","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"deleted","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}}},"family_history":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"family_relative_id":{"changeType":"deleted","description":"Unique identifier of the relative, assigned by the data provider.","name":"family_relative_id","valueType":"string","meta":{"displayName":"Family Relative ID","primaryId":true,"notes":"This field is required to ensure that family members are identified in unique records. Ids can be as simple as an incremented numeral to ensure uniqueness."},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"relative_with_cancer_history":{"changeType":"deleted","description":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","name":"relative_with_cancer_history","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Relative with Cancer History"}},"relationship_type":{"changeType":"deleted","description":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","name":"relationship_type","restrictions":{"codeList":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"]},"valueType":"string","meta":{"displayName":"Relationship Type"}},"gender_of_relative":{"changeType":"deleted","description":"The self-reported gender of related individual.","name":"gender_of_relative","restrictions":{"codeList":["Female","Male","Other","Unknown"]},"valueType":"string","meta":{"displayName":"Gender of Relative"}},"age_of_relative_at_diagnosis":{"changeType":"deleted","description":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","name":"age_of_relative_at_diagnosis","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","displayName":"Age Of Relative At Diagnosis"}},"cancer_type_code_of_relative":{"changeType":"deleted","name":"cancer_type_code_of_relative","valueType":"string","description":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"examples":"C41.1,C16.9,C00.5,D46.9","dependsOn":"family_history.relative_with_cancer_history","displayName":"Cancer Type Code (ICD-10) of Relative"}},"relative_vital_status":{"changeType":"deleted","description":"Relative's last known state of living or deceased.","name":"relative_vital_status","restrictions":{"codeList":["Alive","Deceased","Unknown"]},"valueType":"string","meta":{"displayName":"Vital Status of Relative"}},"cause_of_death_of_relative":{"changeType":"deleted","description":"Indicate the cause of the death of the relative.","name":"cause_of_death_of_relative","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]},"valueType":"string","meta":{"dependsOn":"family_history.relative_vital_status","displayName":"Cause of Death of Relative"}},"relative_survival_time":{"changeType":"deleted","description":"Indicate how long, in days, the relative survived from the time they were diagnosed with cancer.","name":"relative_survival_time","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","units":"days","displayName":"Survival Time Of Relative"}}}},"biomarker":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"deleted","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"deleted","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"deleted","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"deleted","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"deleted","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"deleted","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"deleted","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"deleted","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"deleted","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"deleted","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"deleted","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"deleted","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"deleted","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"deleted","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"deleted","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"deleted","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}}},"comorbidity":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"deleted","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"deleted","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"deleted","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"deleted","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"deleted","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"deleted","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}}}}} diff --git a/website/static/data/schemas/diffs/1.24/1.24-diff-1.0.json b/website/static/data/schemas/diffs/1.24/1.24-diff-1.0.json new file mode 100644 index 00000000..708f8496 --- /dev/null +++ b/website/static/data/schemas/diffs/1.24/1.24-diff-1.0.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":[],"deleted":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\r\n\r\n const row = $row;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n const designation = row.tumour_normal_designation.trim().toLowerCase();\r\n const specimen_type = $field.trim().toLowerCase();\r\n \r\n if (designation === \"normal\"){\r\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\r\n if (!validTypes.includes(specimen_type)){\r\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when tumour_normal_designation is set to Normal.\"};\r\n }\r\n }\r\n else if (designation === \"tumour\") {\r\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\r\n if (invalidTypes.includes(specimen_type)){\r\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when tumour_normal_designation is set to Tumour.\"};\r\n }\r\n }\r\n return result;\r\n })()"]}}},"submitter_sample_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased"],"right":["Alive","Deceased","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"cause_of_death":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate() {\r\n let result = {valid: true, message: \"Ok\"};\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n const vitalStatus = $row.vital_status.trim().toLowerCase();\r\n \r\n if (!currField && vitalStatus === \"deceased\"){\r\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\r\n }\r\n else if (currField && vitalStatus != \"deceased\"){\r\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\r\n }\r\n return result;\r\n })()"]}}},"survival_time":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate() {\r\n let result = {valid: true, message: \"Ok\"};\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n const vitalStatus = $row.vital_status.trim().toLowerCase();\r\n \r\n if (!currField && vitalStatus === \"deceased\"){\r\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\r\n }\r\n else if (currField && vitalStatus != \"deceased\"){\r\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\r\n }\r\n return result;\r\n })()"]},"range":{"left":{"exclusiveMin":0},"right":null}}},"primary_site":{"meta":{"notes":{"left":"To include multiple values, separate values with a pipe delimiter '|' within your file.","right":null},"examples":{"left":"Breast|Ovary","right":null}},"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Not Reported","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva","Unknown"],"data":{"added":["Not Reported","Unknown"],"deleted":["Unknown primary site"]}}}},"height":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"weight":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"bmi":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"menopause_status":{"description":{"left":"Indicate the donor's menopause status at the time of primary diagnosis. (Reference: caDSR CDE ID 2434914)","right":"Indicate the donor's menopause status at the time of primary diagnosis. (Codelist reference: NCI CDE ID: 2434914)"},"restrictions":{"codeList":{"left":["Not applicable","Perimenopausal","Postmenopausal","Premenopausal","Unknown"],"right":["Indeterminate or unknown","Not applicable","Perimenopausal","Postmenopausal","Premenopausal"],"data":{"added":["Indeterminate or unknown"],"deleted":["Unknown"]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)","right":"Indicate the donor's age of menarche, the first occurrence of menstruation."},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"number_of_pregnancies":{"description":{"left":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)","right":"Indicate the number of pregnancies a donor has had."},"restrictions":{"range":{"left":{"min":0},"right":null}}},"number_of_children":{"description":{"left":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)","right":"Indicate the number of children the donor has birthed."},"restrictions":{"range":{"left":{"min":0},"right":null}}}},"created":{"prior_malignancy":{"changeType":"created","description":"Prior malignancy affecting donor.","name":"prior_malignancy","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy","examples":"C41.1, C16.9, C00.5, D46.9"}},"cancer_type_prior_malignancy":{"changeType":"created","description":"The code to represent the cancer type of a prior malignancy using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","name":"cancer_type_prior_malignancy","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"valueType":"string","meta":{"displayName":"Cancer Type Prior Malignancy"}},"age_at_prior_malignancy":{"changeType":"created","description":"If donor has history of prior malignancy, indicate age at previous diagnosis, in years.","name":"age_at_prior_malignancy","valueType":"integer","meta":{"displayName":"Age at Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"created","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Codelist reference: NCI CDE: 4122391)","name":"laterality_of_prior_malignancy","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality at Prior Malignancy"}}},"deleted":{"genetic_disorders":{"changeType":"deleted","description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},"hrt_type":{"changeType":"deleted","description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},"hrt_duration":{"changeType":"deleted","description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},"contraception_type":{"changeType":"deleted","description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},"contraception_duration":{"changeType":"deleted","description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},"lost_to_followup_after_clinical_event_id":{"changeType":"deleted","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}}},"specimen":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null},"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"pathological_tumour_staging_system":{"meta":{"validationDependency":{"left":true,"right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n /* This is not a required field, so first ensure that it exists */\r\n if ($field) {\r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })()"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"pathological_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"pathological_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"pathological_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.pathological_tumour_staging_system && $field) {\r\n let codeList = [];\r\n switch ($row.pathological_tumour_staging_system && $row.pathological_tumour_staging_system.trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb',\r\n 'stage ive',\r\n 'stage ivs'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When 'pathological_tumour_staging_system' is set to '${\r\n $row.pathological_tumour_staging_system\r\n }', 'pathological_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })()"]}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"data":{"added":[],"deleted":["Unknown"]}}}},"specimen_storage":{"description":{"left":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured.","right":"Indicate the method of specimen storage for specimens that were not extracted freshly or immediately cultured."},"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"data":{"added":[],"deleted":["Unknown"]}}}},"reference_pathology_confirmed":{"description":{"left":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)","right":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist."}},"tumour_grading_system":{"meta":{"validationDependency":{"left":true,"right":null}}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.tumour_grading_system && $field) {\r\n let codeList = [];\r\n const tieredGradingList = ['gx','g1','g2','g3'];\r\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\r\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\r\n case 'two-tier grading system':\r\n codeList = [\r\n 'low grade',\r\n 'high grade',\r\n ];\r\n break;\r\n case 'three-tier grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'four-tier grading system':\r\n codeList = [\r\n 'gx',\r\n 'g1',\r\n 'g2',\r\n 'g3',\r\n 'g4',\r\n ];\r\n break;\r\n case 'grading system for gists':\r\n codeList = [\r\n 'low',\r\n 'high',\r\n ];\r\n break;\r\n case 'grading system for gnets':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'isup grading system':\r\n codeList = [\r\n 'gx',\r\n 'g1',\r\n 'g2',\r\n 'g3',\r\n 'g4',\r\n ];\r\n break;\r\n case 'who grading system for cns tumours':\r\n codeList = [\r\n 'grade i',\r\n 'grade ii',\r\n 'grade iii',\r\n 'grade iv',\r\n ];\r\n break;\r\n case 'fnclcc grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'gleason grade group system':\r\n codeList = [\r\n 'grade group 1',\r\n 'grade group 2',\r\n 'grade group 3',\r\n 'grade group 4',\r\n 'grade group 5',\r\n ];\r\n break;\r\n case 'scarff-bloom-richardson grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'nuclear grading system for dcis':\r\n codeList = tieredGradingList;\r\n break;\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase())) {\r\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\r\n $row.tumour_grading_system\r\n }', 'tumour_grade' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\r\n result.valid = false;\r\n const msg = \"'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.\";\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })()"]}}},"percent_tumour_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)","right":"Indicate a value, in decimals, that represents the percentage of infiltration by tumour cells in a specimen."},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null},"script":{"left":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"],"right":null}}},"percent_proliferating_cells":{"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_inflammatory_tissue":{"description":{"left":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)","right":"Indicate a value, in decimals, that represents local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_stromal_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)","right":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a malignant tumour specimen but are not malignant such as fibroblasts, vascular structures, etc."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_necrosis":{"description":{"left":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)","right":"Indicate a value, in decimals, that represents the percentage of cell death in a malignant tumour specimen."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}}},"created":{},"deleted":{"specimen_laterality":{"changeType":"deleted","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"percent_tumour_cells_measurement_method":{"changeType":"deleted","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"age_at_diagnosis":{"description":{"left":"Age that the donor was first diagnosed with cancer, in years. This should be based on the earliest diagnosis of cancer.","right":"Age that the donor was first diagnosed with cancer, in years."},"restrictions":{"range":{"left":{"exclusiveMin":0,"max":90},"right":null}}},"number_lymph_nodes_examined":{"description":{"left":"The total number of lymph nodes tested for the presence of cancer. (Reference: caDSR CDE ID 3)","right":"The total number of lymph nodes tested for the presence of cancer. (Reference: NCI CDE ID: 3)"},"meta":{"dependsOn":{"left":"primary_diagnosis.lymph_nodes_examined_status","right":null},"notes":{"left":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":null},"range":{"left":{"min":0},"right":null}}},"number_lymph_nodes_positive":{"description":{"left":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: caDSR CDE ID 6113694)","right":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: NCI CDE ID: 6113694)"},"meta":{"dependsOn":{"left":"primary_diagnosis.lymph_nodes_examined_status","right":null},"notes":{"left":"This field is only required if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":null},"range":{"left":{"min":0},"right":null},"required":{"left":null,"right":true}}},"clinical_tumour_staging_system":{"meta":{"validationDependency":{"left":true,"right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n /* This is not a required field, so first ensure that it exists */\r\n if ($field) {\r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })()"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}},"required":{"left":null,"right":true}}},"clinical_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"clinical_n_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null}}},"clinical_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"clinical_stage_group":{"description":{"left":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage.","right":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.)."},"meta":{"examples":{"left":"Stage I, Stage IIB","right":null}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.clinical_tumour_staging_system && $field) {\r\n let codeList = [];\r\n switch ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system.trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb',\r\n 'stage ive',\r\n 'stage ivs'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When 'clinical_tumour_staging_system' is set to '${\r\n $row.clinical_tumour_staging_system\r\n }', 'clinical_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })()"]},"required":{"left":null,"right":true}}},"presenting_symptoms":{"restrictions":{"codeList":{"left":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Loss of Appetite","Nausea","None","Not Reported","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Swelling in the Neck","Unknown","Vomiting","Weight Loss"],"right":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Loss of Appetite","Nausea","None","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Unknown","Vomiting","Weight Loss"],"data":{"added":[],"deleted":["Not Reported","Swelling in the Neck"]}}}},"performance_status":{"description":{"left":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status).","right":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference source: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status)."},"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"data":{"added":[],"deleted":["Unknown"]}}}}},"created":{},"deleted":{"laterality":{"changeType":"deleted","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_status":{"changeType":"deleted","name":"lymph_nodes_examined_status","description":"Indicate if lymph nodes were examined for metastases.","valueType":"string","restrictions":{"required":true,"codeList":["Cannot be determined","No","No lymph nodes found in resected specimen","Not applicable","Yes"]},"meta":{"core":true,"displayName":"Lymph Nodes Examined Status"}},"lymph_nodes_examined_method":{"changeType":"deleted","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}}},"treatment":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null},"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":[],"deleted":["End of life care"]}}}},"is_primary_treatment":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"codeList":{"left":["Yes","No"],"right":["Yes","No","Unknown"],"data":{"added":["Unknown"],"deleted":[]}},"required":{"left":null,"right":true}}},"line_of_treatment":{"meta":{"dependsOn":{"left":"treatment.is_primary_treatment","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"],"right":null}}},"treatment_start_interval":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"treatment_duration":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null},"required":{"left":null,"right":true}}},"days_per_cycle":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null}}},"number_of_cycles":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null}}},"toxicity_type":{"description":{"left":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity.","right":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hemotological toxicity or non-hemotological toxicity."},"meta":{"dependsOn":{"left":"treatment.outcome_of_treatment","right":null}},"restrictions":{"codeList":{"left":["Hematological","Non-hematological","Not applicable","Unknown"],"right":["Hemotological","Non-hemotological"],"data":{"added":["Hemotological","Non-hemotological"],"deleted":["Hematological","Non-hematological","Not applicable","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"],"right":null}}},"adverse_events":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"codeList":{"left":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"right":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"data":{"added":[],"deleted":["None","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null}}},"clinical_trials_database":{"meta":{"notes":{"left":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added.","right":null}},"restrictions":{"codeList":{"left":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"],"right":["NCI Clinical Trials","EU Clinical Trials Register"],"data":{"added":[],"deleted":["Not applicable","Unknown"]}}}},"clinical_trial_number":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"],"right":["(function validate() {\r\n let result = {valid: true, message: \"Ok\"};\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n //regex check for clinical trial number\r\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\r\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\r\n\r\n // list of valid clinical trial databases\r\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\r\n \r\n if ($row.clinical_trials_database && $field) {\r\n const trialNumber = $field.trim();\r\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\r\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\r\n result = {valid: false, message: 'The submitted NCI clinical trial number is in incorrect format.'};\r\n }\r\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\r\n result = {valid: false, message: \"The submitted EudraCT clinical trial number is in incorrect format.\"};\r\n }\r\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\r\n result = {valid: false, message: \"The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database.\"};\r\n }\r\n }\r\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\r\n result = {valid: true, message: \"Ok\"};\r\n }\r\n else if ($row.clinical_trials_database && !$field) {\r\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\r\n result = {valid: false, message: \"'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.\"};\r\n } \r\n }\r\n return result;\r\n })()"]}}}},"created":{"age_at_consent_for_treatment":{"changeType":"created","name":"age_at_consent_for_treatment","description":"Indicate the age of donor when consent was given for treatment.","valueType":"integer","meta":{"displayName":"Age At Consent For Treatment"}},"therapeutic_intent":{"changeType":"created","name":"therapeutic_intent","description":"The therapeutic intent, the reason behind the choice of a therapy, of the treatment.","valueType":"string","restrictions":{"required":true,"codeList":["Adjuvant","Concurrent","Curative","Neoadjuvant","Not applicable","Palliative","Unknown"]},"meta":{"core":true,"displayName":"Therapeutic Intent"}},"response_to_therapy":{"changeType":"created","name":"response_to_therapy","description":"The donor's response to the applied treatment regimen. (Source: RECIST)","valueType":"string","restrictions":{"required":true,"codeList":["Complete response","Disease progression","NED","Partial response","Stable disease"]},"meta":{"core":true,"displayName":"Response To Therapy"}},"outcome_of_therapy":{"changeType":"created","name":"outcome_of_therapy","description":"Indicate the donor's outcome of the prescribed treatment.","valueType":"string","restrictions":{"codeList":["Treatment completed as prescribed","Treatment incomplete due to technical or organizational problems","Treatment incomplete because patient died","Patient choice (stopped or interrupted treatment)","Physician decision (stopped or interrupted treatment)","Treatment stopped due to lack of efficacy (disease progression)","Treatment stopped due to acute toxicity","Other","Not applicable","Unknown"]},"meta":{"displayName":"Outcome Of Therapy"}},"hemotological_toxicity":{"changeType":"created","name":"hemotological_toxicity","description":"Indicate the hemotological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5"]},"meta":{"displayName":"Hemotological Toxicity","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"treatment_intent":{"changeType":"deleted","name":"treatment_intent","description":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"]},"meta":{"core":true,"displayName":"Treatment Intent","dependsOn":"treatment.treatment_type"}},"treatment_setting":{"changeType":"deleted","name":"treatment_setting","description":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: NCIt C124308)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"]},"meta":{"core":true,"displayName":"Treatment Setting","dependsOn":"treatment.treatment_type"}},"response_to_treatment_criteria_method":{"changeType":"deleted","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},"response_to_treatment":{"changeType":"deleted","name":"response_to_treatment","description":"The donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"codeList":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"]},"meta":{"core":true,"displayName":"Response To Treatment","dependsOn":"treatment.response_to_treatment_criteria_method","notes":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"outcome_of_treatment":{"changeType":"deleted","name":"outcome_of_treatment","description":"Indicate the donor's outcome of the prescribed treatment.","valueType":"string","restrictions":{"codeList":["Treatment completed as prescribed","Treatment incomplete due to technical or organizational problems","Treatment incomplete because patient died","Patient choice (stopped or interrupted treatment)","Physician decision (stopped or interrupted treatment)","Treatment stopped due to lack of efficacy (disease progression)","Treatment stopped due to acute toxicity","Other","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Outcome Of Treatment","dependsOn":"treatment.treatment_type"}},"hematological_toxicity":{"changeType":"deleted","name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"non-hematological_toxicity":{"changeType":"deleted","name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"chemotherapy":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"dependsOn":{"left":"chemotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"description":{"left":"Name of agent or drug administered to donor as part of the treatment regimen.","right":"Name of agent or drug administered to patient as part of the treatment regimen."},"meta":{"dependsOn":{"left":"chemotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"chemotherapy_dosage_units":{"changeType":"created","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate the total drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"deleted","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"deleted","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"deleted","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"deleted","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"description":{"left":"Name of agent or drug administered to donor as part of the treatment regimen.","right":"Name of agent or drug administered to patient as part of the treatment regimen."},"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"hormone_drug_dosage_units":{"changeType":"created","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"deleted","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"radiation":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"radiation_therapy_fractions":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"radiation_therapy_dosage":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"anatomical_site_irradiated":{"description":{"left":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)","right":"Indicate localization site where radiation therapy was administered."},"restrictions":{"codeList":{"left":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"right":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"data":{"added":["Bone","Extremities","Head-Neck","Peritoneum"],"deleted":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"]}}}}},"created":{},"deleted":{"radiation_boost":{"changeType":"deleted","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"deleted","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}}},"immunotherapy":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"immunotherapy_type":{"changeType":"deleted","name":"immunotherapy_type","valueType":"string","description":"Indicate the type of immunotherapy administered to donor.","meta":{"displayName":"Immunotherapy Type","core":true},"restrictions":{"required":true,"codeList":["Cell-based","Immune checkpoint inhibitors","Monoclonal antibodies other than immune checkpoint inhibitors","Other immunomodulatory substances"]}},"drug_rxnormcui":{"changeType":"deleted","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"deleted","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"deleted","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"surgery":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"deleted","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"deleted","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"deleted","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"deleted","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"deleted","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"deleted","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"deleted","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"deleted","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"deleted","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"deleted","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"deleted","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"deleted","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"deleted","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"deleted","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}}},"follow_up":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_follow_up_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"disease_status_at_followup":{"description":{"left":"Indicate the donor's disease status at time of follow-up. (Reference: RECIST)","right":"Indicate the donor's disease status at time of follow-up."},"restrictions":{"codeList":{"left":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Progression NOS","Relapse or recurrence","Stable"],"right":["Complete remission","Distant progression","Loco-regional progression","No evidence of disease","Partial remission","Relapse or recurrence","Stable"],"data":{"added":[],"deleted":["Progression NOS"]}}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null},"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"treatment.submitter_treatment_id","right":null},"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"weight_at_followup":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"relapse_type":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })()"]}}},"relapse_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const intervalOfFollowup = parseInt($row.interval_of_followup);\r\n\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n relapseInterval = parseInt($field);\r\n if (relapseInterval > intervalOfFollowup) {\r\n result = {valid: false, message: `'${$name}' cannot be greater than the 'interval_of_followup'.` }\r\n }\r\n }\r\n return result;\r\n })()"]}}},"method_of_progression_status":{"description":{"left":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Reference: caDSR CDE ID 6161031)","right":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Codelist reference: NCI CDE ID: 6161031)"},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })()"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n /* This is not a required field, so first ensure that it exists */\r\n if ($field) {\r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })()","(function validate() {\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })()"]}}},"recurrence_t_category":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"recurrence_n_category":{"meta":{"core":{"left":null,"right":true}}},"recurrence_m_category":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"recurrence_stage_group":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.recurrence_tumour_staging_system && $field) {\r\n let codeList = [];\r\n switch ($row.recurrence_tumour_staging_system && $row.recurrence_tumour_staging_system.trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb',\r\n 'stage ive',\r\n 'stage ivs'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When 'recurrence_tumour_staging_system' is set to '${\r\n $row.recurrence_tumour_staging_system\r\n }', 'recurrence_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })()"]}}},"posttherapy_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n /* This is not a required field, so first ensure that it exists */\r\n if ($field) {\r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })()"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"posttherapy_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"posttherapy_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"posttherapy_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.posttherapy_tumour_staging_system && $field) {\r\n let codeList = [];\r\n switch ($row.posttherapy_tumour_staging_system && $row.posttherapy_tumour_staging_system.trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb',\r\n 'stage ive',\r\n 'stage ivs'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When 'posttherapy_tumour_staging_system' is set to '${\r\n $row.posttherapy_tumour_staging_system\r\n }', 'posttherapy_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })()"]}}}},"created":{"anatomic_site_progression_or_recurrences":{"changeType":"created","description":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate() {\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })()"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1,C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}}},"deleted":{"anatomic_site_progression_or_recurrence":{"changeType":"deleted","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"exposure":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"deleted","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"deleted","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"deleted","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"deleted","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"deleted","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"deleted","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"deleted","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"deleted","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"deleted","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"deleted","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"deleted","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}}},"family_history":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"family_relative_id":{"changeType":"deleted","description":"Unique identifier of the relative, assigned by the data provider.","name":"family_relative_id","valueType":"string","meta":{"displayName":"Family Relative ID","primaryId":true,"notes":"This field is required to ensure that family members are identified in unique records. Ids can be as simple as an incremented numeral to ensure uniqueness."},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"relative_with_cancer_history":{"changeType":"deleted","description":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","name":"relative_with_cancer_history","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Relative with Cancer History"}},"relationship_type":{"changeType":"deleted","description":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","name":"relationship_type","restrictions":{"codeList":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"]},"valueType":"string","meta":{"displayName":"Relationship Type"}},"gender_of_relative":{"changeType":"deleted","description":"The self-reported gender of related individual.","name":"gender_of_relative","restrictions":{"codeList":["Female","Male","Other","Unknown"]},"valueType":"string","meta":{"displayName":"Gender of Relative"}},"age_of_relative_at_diagnosis":{"changeType":"deleted","description":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","name":"age_of_relative_at_diagnosis","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","displayName":"Age Of Relative At Diagnosis"}},"cancer_type_code_of_relative":{"changeType":"deleted","name":"cancer_type_code_of_relative","valueType":"string","description":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"examples":"C41.1,C16.9,C00.5,D46.9","dependsOn":"family_history.relative_with_cancer_history","displayName":"Cancer Type Code (ICD-10) of Relative"}},"relative_vital_status":{"changeType":"deleted","description":"Relative's last known state of living or deceased.","name":"relative_vital_status","restrictions":{"codeList":["Alive","Deceased","Unknown"]},"valueType":"string","meta":{"displayName":"Vital Status of Relative"}},"cause_of_death_of_relative":{"changeType":"deleted","description":"Indicate the cause of the death of the relative.","name":"cause_of_death_of_relative","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]},"valueType":"string","meta":{"dependsOn":"family_history.relative_vital_status","displayName":"Cause of Death of Relative"}},"relative_survival_time":{"changeType":"deleted","description":"Indicate how long, in days, the relative survived from the time they were diagnosed with cancer.","name":"relative_survival_time","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","units":"days","displayName":"Survival Time Of Relative"}}}},"biomarker":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"deleted","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"deleted","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"deleted","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"deleted","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"deleted","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"deleted","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"deleted","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"deleted","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"deleted","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"deleted","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"deleted","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"deleted","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"deleted","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"deleted","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"deleted","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"deleted","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}}},"comorbidity":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"deleted","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"deleted","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"deleted","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"deleted","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"deleted","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"deleted","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}}}}} diff --git a/website/static/data/schemas/diffs/1.24/1.24-diff-1.1.json b/website/static/data/schemas/diffs/1.24/1.24-diff-1.1.json new file mode 100644 index 00000000..be8c8716 --- /dev/null +++ b/website/static/data/schemas/diffs/1.24/1.24-diff-1.1.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":[],"deleted":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n\n const row = $row;\n let result = {valid: true, message: \"Ok\"};\n \n const designation = row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\"){\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when tumour_normal_designation is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when tumour_normal_designation is set to Tumour.\"};\n }\n }\n return result;\n })()"]}}},"submitter_sample_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased"],"right":["Alive","Deceased","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"cause_of_death":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })()"]}}},"survival_time":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })()"]},"range":{"left":{"exclusiveMin":0},"right":null}}},"primary_site":{"meta":{"notes":{"left":"To include multiple values, separate values with a pipe delimiter '|' within your file.","right":null},"examples":{"left":"Breast|Ovary","right":null}},"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Not Reported","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva","Unknown"],"data":{"added":["Not Reported","Unknown"],"deleted":["Unknown primary site"]}}}},"height":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"weight":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"bmi":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"menopause_status":{"description":{"left":"Indicate the donor's menopause status at the time of primary diagnosis. (Reference: caDSR CDE ID 2434914)","right":"Indicate the donor's menopause status at the time of primary diagnosis. (Codelist reference: NCI CDE ID: 2434914)"},"restrictions":{"codeList":{"left":["Not applicable","Perimenopausal","Postmenopausal","Premenopausal","Unknown"],"right":["Indeterminate or unknown","Not applicable","Perimenopausal","Postmenopausal","Premenopausal"],"data":{"added":["Indeterminate or unknown"],"deleted":["Unknown"]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)","right":"Indicate the donor's age of menarche, the first occurrence of menstruation."},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"number_of_pregnancies":{"description":{"left":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)","right":"Indicate the number of pregnancies a donor has had."},"restrictions":{"range":{"left":{"min":0},"right":null}}},"number_of_children":{"description":{"left":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)","right":"Indicate the number of children the donor has birthed."},"restrictions":{"range":{"left":{"min":0},"right":null}}}},"created":{"prior_malignancy":{"changeType":"created","description":"Prior malignancy affecting donor.","name":"prior_malignancy","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy","examples":"C41.1, C16.9, C00.5, D46.9"}},"cancer_type_prior_malignancy":{"changeType":"created","description":"The code to represent the cancer type of a prior malignancy using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","name":"cancer_type_prior_malignancy","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"valueType":"string","meta":{"displayName":"Cancer Type Prior Malignancy"}},"age_at_prior_malignancy":{"changeType":"created","description":"If donor has history of prior malignancy, indicate age at previous diagnosis, in years.","name":"age_at_prior_malignancy","valueType":"integer","meta":{"displayName":"Age at Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"created","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Codelist reference: NCI CDE: 4122391)","name":"laterality_of_prior_malignancy","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality at Prior Malignancy"}}},"deleted":{"genetic_disorders":{"changeType":"deleted","description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},"hrt_type":{"changeType":"deleted","description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},"hrt_duration":{"changeType":"deleted","description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},"contraception_type":{"changeType":"deleted","description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},"contraception_duration":{"changeType":"deleted","description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},"lost_to_followup_after_clinical_event_id":{"changeType":"deleted","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}}},"specimen":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null},"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"pathological_tumour_staging_system":{"meta":{"validationDependency":{"left":true,"right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"pathological_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"pathological_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"pathological_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n if ($row.pathological_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.pathological_tumour_staging_system && $row.pathological_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'pathological_tumour_staging_system' is set to '${\n $row.pathological_tumour_staging_system\n }', 'pathological_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })()"]}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"data":{"added":[],"deleted":["Unknown"]}}}},"specimen_storage":{"description":{"left":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured.","right":"Indicate the method of specimen storage for specimens that were not extracted freshly or immediately cultured."},"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"data":{"added":[],"deleted":["Unknown"]}}}},"reference_pathology_confirmed":{"description":{"left":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)","right":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist."}},"tumour_grading_system":{"meta":{"validationDependency":{"left":true,"right":null}}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = \"'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.\";\n result.message = msg;\n }\n }\n return result;\n })()"]}}},"percent_tumour_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)","right":"Indicate a value, in decimals, that represents the percentage of infiltration by tumour cells in a specimen."},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null},"script":{"left":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"],"right":null}}},"percent_proliferating_cells":{"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_inflammatory_tissue":{"description":{"left":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)","right":"Indicate a value, in decimals, that represents local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_stromal_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)","right":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a malignant tumour specimen but are not malignant such as fibroblasts, vascular structures, etc."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_necrosis":{"description":{"left":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)","right":"Indicate a value, in decimals, that represents the percentage of cell death in a malignant tumour specimen."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}}},"created":{},"deleted":{"specimen_laterality":{"changeType":"deleted","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"percent_tumour_cells_measurement_method":{"changeType":"deleted","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"age_at_diagnosis":{"restrictions":{"range":{"left":{"exclusiveMin":0,"max":90},"right":null}}},"number_lymph_nodes_examined":{"description":{"left":"The total number of lymph nodes tested for the presence of cancer. (Reference: caDSR CDE ID 3)","right":"The total number of lymph nodes tested for the presence of cancer. (Reference: NCI CDE ID: 3)"},"meta":{"dependsOn":{"left":"primary_diagnosis.lymph_nodes_examined_status","right":null},"notes":{"left":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":null},"range":{"left":{"min":0},"right":null}}},"number_lymph_nodes_positive":{"description":{"left":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: caDSR CDE ID 6113694)","right":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: NCI CDE ID: 6113694)"},"meta":{"dependsOn":{"left":"primary_diagnosis.lymph_nodes_examined_status","right":null},"notes":{"left":"This field is only required if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":null},"range":{"left":{"min":0},"right":null},"required":{"left":null,"right":true}}},"clinical_tumour_staging_system":{"meta":{"validationDependency":{"left":true,"right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}},"required":{"left":null,"right":true}}},"clinical_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"clinical_n_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null}}},"clinical_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"clinical_stage_group":{"description":{"left":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage.","right":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.)."},"meta":{"examples":{"left":"Stage I, Stage IIB","right":null}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n if ($row.clinical_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'clinical_tumour_staging_system' is set to '${\n $row.clinical_tumour_staging_system\n }', 'clinical_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })()"]},"required":{"left":null,"right":true}}},"presenting_symptoms":{"restrictions":{"codeList":{"left":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Loss of Appetite","Nausea","None","Not Reported","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Swelling in the Neck","Unknown","Vomiting","Weight Loss"],"right":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Loss of Appetite","Nausea","None","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Unknown","Vomiting","Weight Loss"],"data":{"added":[],"deleted":["Not Reported","Swelling in the Neck"]}}}},"performance_status":{"description":{"left":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status).","right":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference source: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status)."},"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"data":{"added":[],"deleted":["Unknown"]}}}}},"created":{},"deleted":{"laterality":{"changeType":"deleted","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_status":{"changeType":"deleted","name":"lymph_nodes_examined_status","description":"Indicate if lymph nodes were examined for metastases.","valueType":"string","restrictions":{"required":true,"codeList":["Cannot be determined","No","No lymph nodes found in resected specimen","Not applicable","Yes"]},"meta":{"core":true,"displayName":"Lymph Nodes Examined Status"}},"lymph_nodes_examined_method":{"changeType":"deleted","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}}},"treatment":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null},"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":[],"deleted":["End of life care"]}}}},"is_primary_treatment":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"codeList":{"left":["Yes","No"],"right":["Yes","No","Unknown"],"data":{"added":["Unknown"],"deleted":[]}},"required":{"left":null,"right":true}}},"line_of_treatment":{"meta":{"dependsOn":{"left":"treatment.is_primary_treatment","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"],"right":null}}},"treatment_start_interval":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"treatment_duration":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null},"required":{"left":null,"right":true}}},"days_per_cycle":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null}}},"number_of_cycles":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null}}},"toxicity_type":{"description":{"left":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity.","right":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hemotological toxicity or non-hemotological toxicity."},"meta":{"dependsOn":{"left":"treatment.outcome_of_treatment","right":null}},"restrictions":{"codeList":{"left":["Hematological","Non-hematological","Not applicable","Unknown"],"right":["Hemotological","Non-hemotological"],"data":{"added":["Hemotological","Non-hemotological"],"deleted":["Hematological","Non-hematological","Not applicable","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"],"right":null}}},"adverse_events":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"codeList":{"left":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"right":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"data":{"added":[],"deleted":["None","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null}}},"clinical_trials_database":{"meta":{"notes":{"left":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added.","right":null}},"restrictions":{"codeList":{"left":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"],"right":["NCI Clinical Trials","EU Clinical Trials Register"],"data":{"added":[],"deleted":["Not applicable","Unknown"]}}}},"clinical_trial_number":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: 'The submitted NCI clinical trial number is in incorrect format.'};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: \"The submitted EudraCT clinical trial number is in incorrect format.\"};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: \"The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database.\"};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: \"'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.\"};\n } \n }\n return result;\n })()"]}}}},"created":{"age_at_consent_for_treatment":{"changeType":"created","name":"age_at_consent_for_treatment","description":"Indicate the age of donor when consent was given for treatment.","valueType":"integer","meta":{"displayName":"Age At Consent For Treatment"}},"therapeutic_intent":{"changeType":"created","name":"therapeutic_intent","description":"The therapeutic intent, the reason behind the choice of a therapy, of the treatment.","valueType":"string","restrictions":{"required":true,"codeList":["Adjuvant","Concurrent","Curative","Neoadjuvant","Not applicable","Palliative","Unknown"]},"meta":{"core":true,"displayName":"Therapeutic Intent"}},"response_to_therapy":{"changeType":"created","name":"response_to_therapy","description":"The donor's response to the applied treatment regimen. (Source: RECIST)","valueType":"string","restrictions":{"required":true,"codeList":["Complete response","Disease progression","NED","Partial response","Stable disease"]},"meta":{"core":true,"displayName":"Response To Therapy"}},"outcome_of_therapy":{"changeType":"created","name":"outcome_of_therapy","description":"Indicate the donor's outcome of the prescribed treatment.","valueType":"string","restrictions":{"codeList":["Treatment completed as prescribed","Treatment incomplete due to technical or organizational problems","Treatment incomplete because patient died","Patient choice (stopped or interrupted treatment)","Physician decision (stopped or interrupted treatment)","Treatment stopped due to lack of efficacy (disease progression)","Treatment stopped due to acute toxicity","Other","Not applicable","Unknown"]},"meta":{"displayName":"Outcome Of Therapy"}},"hemotological_toxicity":{"changeType":"created","name":"hemotological_toxicity","description":"Indicate the hemotological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5"]},"meta":{"displayName":"Hemotological Toxicity","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"treatment_intent":{"changeType":"deleted","name":"treatment_intent","description":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"]},"meta":{"core":true,"displayName":"Treatment Intent","dependsOn":"treatment.treatment_type"}},"treatment_setting":{"changeType":"deleted","name":"treatment_setting","description":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: NCIt C124308)","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"]},"meta":{"core":true,"displayName":"Treatment Setting","dependsOn":"treatment.treatment_type"}},"response_to_treatment_criteria_method":{"changeType":"deleted","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},"response_to_treatment":{"changeType":"deleted","name":"response_to_treatment","description":"The donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"codeList":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"]},"meta":{"core":true,"displayName":"Response To Treatment","dependsOn":"treatment.response_to_treatment_criteria_method","notes":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"outcome_of_treatment":{"changeType":"deleted","name":"outcome_of_treatment","description":"Indicate the donor's outcome of the prescribed treatment.","valueType":"string","restrictions":{"codeList":["Treatment completed as prescribed","Treatment incomplete due to technical or organizational problems","Treatment incomplete because patient died","Patient choice (stopped or interrupted treatment)","Physician decision (stopped or interrupted treatment)","Treatment stopped due to lack of efficacy (disease progression)","Treatment stopped due to acute toxicity","Other","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Outcome Of Treatment","dependsOn":"treatment.treatment_type"}},"hematological_toxicity":{"changeType":"deleted","name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"non-hematological_toxicity":{"changeType":"deleted","name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"chemotherapy":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"dependsOn":{"left":"chemotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"description":{"left":"Name of agent or drug administered to donor as part of the treatment regimen.","right":"Name of agent or drug administered to patient as part of the treatment regimen."},"meta":{"dependsOn":{"left":"chemotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"chemotherapy_dosage_units":{"changeType":"created","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate the total drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"deleted","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"deleted","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"deleted","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"deleted","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"description":{"left":"Name of agent or drug administered to donor as part of the treatment regimen.","right":"Name of agent or drug administered to patient as part of the treatment regimen."},"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"hormone_drug_dosage_units":{"changeType":"created","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"deleted","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"radiation":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"radiation_therapy_fractions":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"radiation_therapy_dosage":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"anatomical_site_irradiated":{"description":{"left":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)","right":"Indicate localization site where radiation therapy was administered."},"restrictions":{"codeList":{"left":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"right":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"data":{"added":["Bone","Extremities","Head-Neck","Peritoneum"],"deleted":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"]}}}}},"created":{},"deleted":{"radiation_boost":{"changeType":"deleted","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"deleted","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}}},"immunotherapy":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"immunotherapy_type":{"changeType":"deleted","name":"immunotherapy_type","valueType":"string","description":"Indicate the type of immunotherapy administered to donor.","meta":{"displayName":"Immunotherapy Type","core":true},"restrictions":{"required":true,"codeList":["Cell-based","Immune checkpoint inhibitors","Monoclonal antibodies other than immune checkpoint inhibitors","Other immunomodulatory substances"]}},"drug_rxnormcui":{"changeType":"deleted","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"deleted","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"deleted","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"surgery":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"deleted","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"deleted","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"deleted","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"deleted","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"deleted","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"deleted","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"deleted","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"deleted","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"deleted","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"deleted","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"deleted","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"deleted","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"deleted","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"deleted","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}}},"follow_up":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_follow_up_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null},"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"treatment.submitter_treatment_id","right":null},"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"weight_at_followup":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"relapse_type":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })()"]}}},"relapse_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `'${$name}' cannot be greater than the 'interval_of_followup'.` }\n }\n }\n return result;\n })()"]}}},"method_of_progression_status":{"description":{"left":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Reference: caDSR CDE ID 6161031)","right":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Codelist reference: NCI CDE ID: 6161031)"},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })()"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()","(function validate() {\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })()"]}}},"recurrence_t_category":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"recurrence_n_category":{"meta":{"core":{"left":null,"right":true}}},"recurrence_m_category":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"recurrence_stage_group":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n if ($row.recurrence_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.recurrence_tumour_staging_system && $row.recurrence_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'recurrence_tumour_staging_system' is set to '${\n $row.recurrence_tumour_staging_system\n }', 'recurrence_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })()"]}}},"posttherapy_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })()"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"posttherapy_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"posttherapy_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"posttherapy_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate() {\n let result = { valid: true, message: 'Ok' };\n if ($row.posttherapy_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.posttherapy_tumour_staging_system && $row.posttherapy_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'posttherapy_tumour_staging_system' is set to '${\n $row.posttherapy_tumour_staging_system\n }', 'posttherapy_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })()"]}}}},"created":{"anatomic_site_progression_or_recurrences":{"changeType":"created","description":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate() {\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })()"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1,C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}}},"deleted":{"anatomic_site_progression_or_recurrence":{"changeType":"deleted","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"exposure":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"deleted","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"deleted","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"deleted","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"deleted","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"deleted","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"deleted","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"deleted","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"deleted","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"deleted","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"deleted","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"deleted","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}}},"family_history":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"family_relative_id":{"changeType":"deleted","description":"Unique identifier of the relative, assigned by the data provider.","name":"family_relative_id","valueType":"string","meta":{"displayName":"Family Relative ID","primaryId":true,"notes":"This field is required to ensure that family members are identified in unique records. Ids can be as simple as an incremented numeral to ensure uniqueness."},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"relative_with_cancer_history":{"changeType":"deleted","description":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","name":"relative_with_cancer_history","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Relative with Cancer History"}},"relationship_type":{"changeType":"deleted","description":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","name":"relationship_type","restrictions":{"codeList":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"]},"valueType":"string","meta":{"displayName":"Relationship Type"}},"gender_of_relative":{"changeType":"deleted","description":"The self-reported gender of related individual.","name":"gender_of_relative","restrictions":{"codeList":["Female","Male","Other","Unknown"]},"valueType":"string","meta":{"displayName":"Gender of Relative"}},"age_of_relative_at_diagnosis":{"changeType":"deleted","description":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","name":"age_of_relative_at_diagnosis","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","displayName":"Age Of Relative At Diagnosis"}},"cancer_type_code_of_relative":{"changeType":"deleted","name":"cancer_type_code_of_relative","valueType":"string","description":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"examples":"C41.1,C16.9,C00.5,D46.9","dependsOn":"family_history.relative_with_cancer_history","displayName":"Cancer Type Code (ICD-10) of Relative"}},"relative_vital_status":{"changeType":"deleted","description":"Relative's last known state of living or deceased.","name":"relative_vital_status","restrictions":{"codeList":["Alive","Deceased","Unknown"]},"valueType":"string","meta":{"displayName":"Vital Status of Relative"}},"cause_of_death_of_relative":{"changeType":"deleted","description":"Indicate the cause of the death of the relative.","name":"cause_of_death_of_relative","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]},"valueType":"string","meta":{"dependsOn":"family_history.relative_vital_status","displayName":"Cause of Death of Relative"}},"relative_survival_time":{"changeType":"deleted","description":"Indicate how long, in days, the relative survived from the time they were diagnosed with cancer.","name":"relative_survival_time","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","units":"days","displayName":"Survival Time Of Relative"}}}},"biomarker":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"deleted","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"deleted","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"deleted","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"deleted","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"deleted","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"deleted","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"deleted","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"deleted","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"deleted","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"deleted","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"deleted","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"deleted","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"deleted","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"deleted","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"deleted","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"deleted","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}}},"comorbidity":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"deleted","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"deleted","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"deleted","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"deleted","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"deleted","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"deleted","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}}}}} diff --git a/website/static/data/schemas/diffs/1.24/1.24-diff-1.10.json b/website/static/data/schemas/diffs/1.24/1.24-diff-1.10.json new file mode 100644 index 00000000..0e84ed71 --- /dev/null +++ b/website/static/data/schemas/diffs/1.24/1.24-diff-1.10.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":[],"deleted":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \r\n const designation = $row.tumour_normal_designation.trim().toLowerCase();\r\n const specimen_type = $field.trim().toLowerCase();\r\n \r\n if (designation === \"normal\") {\r\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\r\n if (!validTypes.includes(specimen_type)) {\r\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\r\n }\r\n }\r\n else if (designation === \"tumour\") {\r\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\r\n if (invalidTypes.includes(specimen_type)) {\r\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\r\n }\r\n }\r\n }\r\n return result;\r\n })"]}}},"submitter_sample_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased"],"right":["Alive","Deceased","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"cause_of_death":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n \r\n if ($row.vital_status != null) {\r\n const vitalStatus = $row.vital_status.trim().toLowerCase();\r\n\r\n if (!currField && vitalStatus === \"deceased\") {\r\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\r\n }\r\n else if (currField && vitalStatus != \"deceased\"){\r\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\r\n }\r\n }\r\n else if (($row.vital_status === null) && (currField)) {\r\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\r\n }\r\n return result;\r\n })"]}}},"survival_time":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n \r\n if ($row.vital_status != null) {\r\n const vitalStatus = $row.vital_status.trim().toLowerCase();\r\n\r\n if (!currField && vitalStatus === \"deceased\") {\r\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\r\n }\r\n else if (currField && vitalStatus != \"deceased\"){\r\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\r\n }\r\n }\r\n else if (($row.vital_status === null) && (currField)) {\r\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\r\n }\r\n return result;\r\n })"]}}},"primary_site":{"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva"],"data":{"added":[],"deleted":["Unknown primary site"]}}}},"genetic_disorders":{"description":{"left":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","right":"Indicate presence of any hereditary genetic disorders. (Reference: Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)"},"restrictions":{"codeList":{"left":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"],"right":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Serrated Polyposis Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"],"data":{"added":[],"deleted":["None","Not applicable","Unknown"]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)","right":"Indicate the donor's age at which the first menstruation event occurred. (Reference: NCIt C19666)"}},"hrt_type":{"restrictions":{"codeList":{"left":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"],"right":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Other","Patch","Pill","Unknown"],"data":{"added":[],"deleted":["Not applicable"]}}}},"hrt_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n const type = $name.trim().toLowerCase().split('_duration')[0];\r\n const hormoneType = type + `_type`;\r\n \r\n if ($field != null && !(checkforEmpty($field))) {\r\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\r\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\r\n }\r\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\") {\r\n const submittedValue = $row[hormoneType].toLowerCase()\r\n result = {valid: false, message: `If '${$name}' is submitted, then '${hormoneType}' field cannot be '${submittedValue}'.`};\r\n }\r\n\r\n }\r\n return result;\r\n })"]}}},"contraception_type":{"restrictions":{"codeList":{"left":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"],"right":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Other","Progestin-only pill","Unknown","Vaginal ring"],"data":{"added":[],"deleted":["Not applicable","Oral contraceptive pill"]}}}},"contraception_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n const type = $name.trim().toLowerCase().split('_duration')[0];\r\n const hormoneType = type + `_type`;\r\n \r\n if ($field != null && !(checkforEmpty($field))) {\r\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\r\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\r\n }\r\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\") {\r\n const submittedValue = $row[hormoneType].toLowerCase()\r\n result = {valid: false, message: `If '${$name}' is submitted, then '${hormoneType}' field cannot be '${submittedValue}'.`};\r\n }\r\n\r\n }\r\n return result;\r\n })"]}}}},"created":{},"deleted":{"lost_to_followup_after_clinical_event_id":{"changeType":"deleted","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}}},"specimen":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"pathological_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\r\n\r\n \r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\r\n if (!($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n /* This is not a required field, so first ensure that it exists */\r\n else if ($field) {\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"pathological_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"pathological_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"pathological_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS"],"data":{"added":[],"deleted":["Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_stage_group')[0];\r\n\r\n const stagingSystem = stagingName + `_tumour_staging_system`;\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\r\n result.valid = false;\r\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\r\n result.message = msg;\r\n }\r\n else if (!($row[stagingSystem]) && $field) {\r\n result.valid = false;\r\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\r\n result.message = msg;\r\n }\r\n else if ($row[stagingSystem] && $field) {\r\n let codeList = [];\r\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage ii bulky',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ies',\r\n 'stage iae',\r\n 'stage ias',\r\n 'stage iaes',\r\n 'stage ib',\r\n 'stage ibe',\r\n 'stage ibs',\r\n 'stage ibes',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iies',\r\n 'stage iiae',\r\n 'stage iias',\r\n 'stage iiaes',\r\n 'stage iib',\r\n 'stage iibe',\r\n 'stage iibs',\r\n 'stage iibes',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iiies',\r\n 'stage iiiae',\r\n 'stage iiias',\r\n 'stage iiiaes',\r\n 'stage iiib',\r\n 'stage iiibe',\r\n 'stage iiibs',\r\n 'stage iiibes',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ive',\r\n 'stage ivs',\r\n 'stage ives',\r\n 'stage ivae',\r\n 'stage ivas',\r\n 'stage ivaes',\r\n 'stage ivb',\r\n 'stage ivbe',\r\n 'stage ivbs',\r\n 'stage ivbes'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\r\n $row[stagingSystem]\r\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n \r\n return result;\r\n })"]}}},"specimen_acquisition_interval":{"restrictions":{"range":{"left":null,"right":{"min":0}}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"data":{"added":[],"deleted":["Unknown"]}}}},"specimen_storage":{"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"data":{"added":[],"deleted":["Unknown"]}}}},"reference_pathology_confirmed":{"description":{"left":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)","right":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist."}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.tumour_grading_system && $field) {\r\n let codeList = [];\r\n const tieredGradingList = ['gx','g1','g2','g3'];\r\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\r\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\r\n case 'two-tier grading system':\r\n codeList = [\r\n 'low grade',\r\n 'high grade',\r\n ];\r\n break;\r\n case 'three-tier grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'four-tier grading system':\r\n codeList = [\r\n 'gx',\r\n 'g1',\r\n 'g2',\r\n 'g3',\r\n 'g4',\r\n ];\r\n break;\r\n case 'grading system for gists':\r\n codeList = [\r\n 'low',\r\n 'high',\r\n ];\r\n break;\r\n case 'grading system for gnets':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'isup grading system':\r\n codeList = [\r\n 'gx',\r\n 'g1',\r\n 'g2',\r\n 'g3',\r\n 'g4',\r\n ];\r\n break;\r\n case 'who grading system for cns tumours':\r\n codeList = [\r\n 'grade i',\r\n 'grade ii',\r\n 'grade iii',\r\n 'grade iv',\r\n ];\r\n break;\r\n case 'fnclcc grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'gleason grade group system':\r\n codeList = [\r\n 'grade group 1',\r\n 'grade group 2',\r\n 'grade group 3',\r\n 'grade group 4',\r\n 'grade group 5',\r\n ];\r\n break;\r\n case 'scarff-bloom-richardson grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'nuclear grading system for dcis':\r\n codeList = tieredGradingList;\r\n break;\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase())) {\r\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\r\n $row.tumour_grading_system\r\n }', 'tumour_grade' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\r\n result.valid = false;\r\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })"]}}},"percent_tumour_cells":{"restrictions":{"script":{"left":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"],"right":null}}},"percent_proliferating_cells":{"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}}},"percent_inflammatory_tissue":{"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}}},"percent_stromal_cells":{"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}}},"percent_necrosis":{"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}}}},"created":{},"deleted":{"specimen_laterality":{"changeType":"deleted","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"percent_tumour_cells_measurement_method":{"changeType":"deleted","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"number_lymph_nodes_examined":{"meta":{"notes":{"left":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n /* checks for a string just consisting of whitespacei */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\r\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\r\n \r\n if ($row.lymph_nodes_examined_status != null) {\r\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\r\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\r\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\r\n if (lymphNodesExaminedStatus === \"yes\") { \r\n if (parseInt($field) <= 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n else if (parseInt($field) > 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n \r\n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\r\n else if ($name === \"number_lymph_nodes_positive\") {\r\n if (lymphNodesExaminedStatus === \"yes\") {\r\n if (checkforEmpty($field) || $field == null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n else if (parseInt($field) < 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n else if ($field || $field != null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n }\r\n return result;\r\n})"]}}},"number_lymph_nodes_positive":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n /* checks for a string just consisting of whitespacei */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\r\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\r\n \r\n if ($row.lymph_nodes_examined_status != null) {\r\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\r\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\r\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\r\n if (lymphNodesExaminedStatus === \"yes\") { \r\n if (parseInt($field) <= 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n else if (parseInt($field) > 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n \r\n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\r\n else if ($name === \"number_lymph_nodes_positive\") {\r\n if (lymphNodesExaminedStatus === \"yes\") {\r\n if (checkforEmpty($field) || $field == null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n else if (parseInt($field) < 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n else if ($field || $field != null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n }\r\n return result;\r\n})"]}}},"clinical_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\r\n\r\n \r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\r\n if (!($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n /* This is not a required field, so first ensure that it exists */\r\n else if ($field) {\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"clinical_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"clinical_n_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null}}},"clinical_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"clinical_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS"],"data":{"added":[],"deleted":["Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_stage_group')[0];\r\n\r\n const stagingSystem = stagingName + `_tumour_staging_system`;\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\r\n result.valid = false;\r\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\r\n result.message = msg;\r\n }\r\n else if (!($row[stagingSystem]) && $field) {\r\n result.valid = false;\r\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\r\n result.message = msg;\r\n }\r\n else if ($row[stagingSystem] && $field) {\r\n let codeList = [];\r\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage ii bulky',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ies',\r\n 'stage iae',\r\n 'stage ias',\r\n 'stage iaes',\r\n 'stage ib',\r\n 'stage ibe',\r\n 'stage ibs',\r\n 'stage ibes',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iies',\r\n 'stage iiae',\r\n 'stage iias',\r\n 'stage iiaes',\r\n 'stage iib',\r\n 'stage iibe',\r\n 'stage iibs',\r\n 'stage iibes',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iiies',\r\n 'stage iiiae',\r\n 'stage iiias',\r\n 'stage iiiaes',\r\n 'stage iiib',\r\n 'stage iiibe',\r\n 'stage iiibs',\r\n 'stage iiibes',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ive',\r\n 'stage ivs',\r\n 'stage ives',\r\n 'stage ivae',\r\n 'stage ivas',\r\n 'stage ivaes',\r\n 'stage ivb',\r\n 'stage ivbe',\r\n 'stage ivbs',\r\n 'stage ivbes'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\r\n $row[stagingSystem]\r\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n \r\n return result;\r\n })"]}}},"performance_status":{"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"data":{"added":[],"deleted":["Unknown"]}}}}},"created":{},"deleted":{"laterality":{"changeType":"deleted","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_method":{"changeType":"deleted","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}}},"treatment":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":[],"deleted":["End of life care"]}}}},"is_primary_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]},"codeList":{"left":["Yes","No"],"right":["Yes","No","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"line_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\r\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\r\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\r\n if (isPrimaryTreatment === 'yes') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\r\n }\r\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\r\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\r\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\r\n }\r\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\r\n else if (isPrimaryTreatment === 'unknown') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'unknown'.`};\r\n }\r\n }\r\n return result;\r\n })"]}}},"treatment_start_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"treatment_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]}}},"days_per_cycle":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]}}},"number_of_cycles":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]}}},"treatment_intent":{"description":{"left":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","right":"Indicate the intended disease outcome for which the treatment is given. (Reference: NCIt C124307)"},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]},"codeList":{"left":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"],"right":["Curative","Palliative","Unknown"],"data":{"added":["Unknown"],"deleted":["Diagnostic","Forensic","Guidance","Preventative","Screening","Supportive"]}}}},"treatment_setting":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]},"codeList":{"left":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"],"right":["Adjuvant","Advanced/Metastatic","Neoadjuvant","Not applicable"],"data":{"added":["Not applicable"],"deleted":["Conditioning","Induction","Maintenance","Mobilization","Preventative","Radiosensitization","Salvage"]}}}},"response_to_treatment":{"description":{"left":"The donor's response to the applied treatment regimen.","right":"The donor's response to the applied treatment regimen. (Source: RECIST)"},"meta":{"dependsOn":{"left":"treatment.response_to_treatment_criteria_method","right":"treatment.treatment_type"},"notes":{"left":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]},"codeList":{"left":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"],"right":["Complete response","Disease progression","NED","Partial response","Stable disease"],"data":{"added":["Disease progression","NED"],"deleted":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease"]}}}},"outcome_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]}}},"toxicity_type":{"restrictions":{"codeList":{"left":["Hematological","Non-hematological","Not applicable","Unknown"],"right":["Hematological","Non-hematological"],"data":{"added":[],"deleted":["Not applicable","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($field != null && !(checkforEmpty($field))) {\r\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \r\n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\r\n \r\n /* toxicityType should only be submitted if treatment was terminated early due to acute toxicity ('outcome_of_treatment' is 'Treatment stopped due to acute toxicity'). */\r\n if (outcomeOfTreatment != \"treatment stopped due to acute toxicity\") {\r\n result = { valid: false, message: `The 'outcome_of_treatment' field should be 'Treatment stopped due to acute toxicity' if the '${$name}' field is submitted.`};\r\n }\r\n }\r\n else {\r\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\r\n }\r\n }\r\n return result;\r\n })"]}}},"hematological_toxicity":{"restrictions":{"codeList":{"left":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"right":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5"],"data":{"added":[],"deleted":["Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($field != null && !(checkforEmpty($field))) {\r\n if (($row.toxicity_type != null && !(checkforEmpty($row.toxicity_type)))) { \r\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\r\n \r\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\r\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\r\n }\r\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\r\n }\r\n }\r\n else {\r\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"]}}},"non-hematological_toxicity":{"restrictions":{"codeList":{"left":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"right":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"data":{"added":[],"deleted":["Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($field != null && !(checkforEmpty($field))) {\r\n if (($row.toxicity_type != null && !(checkforEmpty($row.toxicity_type)))) { \r\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\r\n \r\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\r\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\r\n }\r\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\r\n }\r\n }\r\n else {\r\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"]}}},"adverse_events":{"restrictions":{"codeList":{"left":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"right":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"data":{"added":[],"deleted":["None","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]}}},"clinical_trials_database":{"meta":{"notes":{"left":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added.","right":null}},"restrictions":{"codeList":{"left":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"],"right":["NCI Clinical Trials","EU Clinical Trials Register"],"data":{"added":[],"deleted":["Not applicable","Unknown"]}}}},"clinical_trial_number":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n //regex check for clinical trial number\r\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\r\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\r\n\r\n // list of valid clinical trial databases\r\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\r\n \r\n if ($row.clinical_trials_database && $field) {\r\n const trialNumber = $field.trim();\r\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\r\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\r\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\r\n }\r\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\r\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\r\n }\r\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\r\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database.`};\r\n }\r\n }\r\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\r\n result = {valid: true, message: \"Ok\"};\r\n }\r\n else if ($row.clinical_trials_database && !$field) {\r\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\r\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\r\n } \r\n }\r\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\r\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\r\n }\r\n return result;\r\n })"]}}}},"created":{},"deleted":{"response_to_treatment_criteria_method":{"changeType":"deleted","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}}}},"chemotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"dependsOn":{"left":"chemotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"dependsOn":{"left":"chemotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"chemotherapy_dosage_units":{"changeType":"created","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate the total actual drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true,"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"deleted","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"deleted","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"deleted","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"deleted","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"hormone_drug_dosage_units":{"changeType":"created","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true,"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"deleted","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"radiation":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"radiation_therapy_dosage":{"valueType":{"left":"number","right":"integer"}},"anatomical_site_irradiated":{"description":{"left":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)","right":"Indicate localization site where radiation therapy was administered."},"restrictions":{"codeList":{"left":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"right":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"data":{"added":["Bone","Extremities","Head-Neck","Peritoneum"],"deleted":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"]}}}}},"created":{},"deleted":{"radiation_boost":{"changeType":"deleted","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"deleted","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}}},"immunotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"immunotherapy_type":{"meta":{"core":{"left":true,"right":null}}},"drug_rxnormcui":{"meta":{"dependsOn":{"left":"immunotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"dependsOn":{"left":"immunotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"},"displayName":{"left":"Chemotherapy Drug Name","right":"Immunotherapy Drug Name"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"deleted","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"surgery":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"deleted","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"deleted","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"deleted","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"deleted","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"deleted","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"deleted","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"deleted","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"deleted","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"deleted","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"deleted","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"deleted","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"deleted","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"deleted","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"deleted","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}}},"follow_up":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_follow_up_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"interval_of_followup":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"treatment.submitter_treatment_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"relapse_type":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n if ($row.disease_status_at_followup != null) {\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n }\r\n return result;\r\n })"]}}},"relapse_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n if ($row.disease_status_at_followup != null) {\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const intervalOfFollowup = parseInt($row.interval_of_followup);\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n relapseInterval = parseInt($field);\r\n if (relapseInterval > intervalOfFollowup) {\r\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\r\n }\r\n }\r\n }\r\n return result;\r\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"method_of_progression_status":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n if ($row.disease_status_at_followup != null) {\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n }\r\n return result;\r\n })"]}}},"anatomic_site_progression_or_recurrence":{"description":{"left":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","right":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344."},"meta":{"examples":{"left":"C50.1|C18","right":"C50.1,C18"},"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n if ($row.disease_status_at_followup != null) {\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n }\r\n return result;\r\n })"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\r\n\r\n \r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\r\n if (!($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n /* This is not a required field, so first ensure that it exists */\r\n else if ($field) {\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })","(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n if ($row.disease_status_at_followup != null) {\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n }\r\n return result;\r\n })"]}}},"recurrence_t_category":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"recurrence_n_category":{"meta":{"core":{"left":null,"right":true}}},"recurrence_m_category":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"recurrence_stage_group":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS"],"data":{"added":[],"deleted":["Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_stage_group')[0];\r\n\r\n const stagingSystem = stagingName + `_tumour_staging_system`;\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\r\n result.valid = false;\r\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\r\n result.message = msg;\r\n }\r\n else if (!($row[stagingSystem]) && $field) {\r\n result.valid = false;\r\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\r\n result.message = msg;\r\n }\r\n else if ($row[stagingSystem] && $field) {\r\n let codeList = [];\r\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage ii bulky',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ies',\r\n 'stage iae',\r\n 'stage ias',\r\n 'stage iaes',\r\n 'stage ib',\r\n 'stage ibe',\r\n 'stage ibs',\r\n 'stage ibes',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iies',\r\n 'stage iiae',\r\n 'stage iias',\r\n 'stage iiaes',\r\n 'stage iib',\r\n 'stage iibe',\r\n 'stage iibs',\r\n 'stage iibes',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iiies',\r\n 'stage iiiae',\r\n 'stage iiias',\r\n 'stage iiiaes',\r\n 'stage iiib',\r\n 'stage iiibe',\r\n 'stage iiibs',\r\n 'stage iiibes',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ive',\r\n 'stage ivs',\r\n 'stage ives',\r\n 'stage ivae',\r\n 'stage ivas',\r\n 'stage ivaes',\r\n 'stage ivb',\r\n 'stage ivbe',\r\n 'stage ivbs',\r\n 'stage ivbes'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\r\n $row[stagingSystem]\r\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n \r\n return result;\r\n })"]}}},"posttherapy_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\r\n\r\n \r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\r\n if (!($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n /* This is not a required field, so first ensure that it exists */\r\n else if ($field) {\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"posttherapy_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"posttherapy_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"posttherapy_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS"],"data":{"added":[],"deleted":["Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_stage_group')[0];\r\n\r\n const stagingSystem = stagingName + `_tumour_staging_system`;\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\r\n result.valid = false;\r\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\r\n result.message = msg;\r\n }\r\n else if (!($row[stagingSystem]) && $field) {\r\n result.valid = false;\r\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\r\n result.message = msg;\r\n }\r\n else if ($row[stagingSystem] && $field) {\r\n let codeList = [];\r\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage ii bulky',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ies',\r\n 'stage iae',\r\n 'stage ias',\r\n 'stage iaes',\r\n 'stage ib',\r\n 'stage ibe',\r\n 'stage ibs',\r\n 'stage ibes',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iies',\r\n 'stage iiae',\r\n 'stage iias',\r\n 'stage iiaes',\r\n 'stage iib',\r\n 'stage iibe',\r\n 'stage iibs',\r\n 'stage iibes',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iiies',\r\n 'stage iiiae',\r\n 'stage iiias',\r\n 'stage iiiaes',\r\n 'stage iiib',\r\n 'stage iiibe',\r\n 'stage iiibs',\r\n 'stage iiibes',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ive',\r\n 'stage ivs',\r\n 'stage ives',\r\n 'stage ivae',\r\n 'stage ivas',\r\n 'stage ivaes',\r\n 'stage ivb',\r\n 'stage ivbe',\r\n 'stage ivbs',\r\n 'stage ivbes'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\r\n $row[stagingSystem]\r\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n \r\n return result;\r\n })"]}}}},"created":{},"deleted":{}},"exposure":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"tobacco_smoking_status":{"restrictions":{"codeList":{"left":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"],"right":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Smoking history not documented"],"data":{"added":[],"deleted":["Not applicable"]}}}},"tobacco_type":{"restrictions":{"codeList":{"left":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"right":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Roll-ups","Snuff","Unknown","Waterpipe"],"data":{"added":[],"deleted":["Not applicable","Pipe"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n // check tobacco related fields\r\n if ($name === 'tobacco_type') {\r\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\r\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\r\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\r\n }\r\n else if ($row.tobacco_smoking_status.toLowerCase() === 'smoking history not documented') {\r\n result = { valid: false, message: `The 'tobacco_smoking_status' field (smoking status not documented) is inconsistent if donor smoked '${$row.tobacco_type}'.`};\r\n }\r\n else if ($row.tobacco_smoking_status.toLowerCase() === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if donor is a lifelong non-smoker.`}\r\n }\r\n }\r\n else {\r\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\r\n if (smokerCategories.includes($row.tobacco_smoking_status.toLowerCase())) {\r\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\r\n }\r\n }\r\n }\r\n }\r\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\r\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\r\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\r\n }\r\n }\r\n return result;\r\n })"]}}},"pack_years_smoked":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n // check tobacco related fields\r\n if ($name === 'tobacco_type') {\r\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\r\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\r\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\r\n }\r\n else if ($row.tobacco_smoking_status.toLowerCase() === 'smoking history not documented') {\r\n result = { valid: false, message: `The 'tobacco_smoking_status' field (smoking status not documented) is inconsistent if donor smoked '${$row.tobacco_type}'.`};\r\n }\r\n else if ($row.tobacco_smoking_status.toLowerCase() === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if donor is a lifelong non-smoker.`}\r\n }\r\n }\r\n else {\r\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\r\n if (smokerCategories.includes($row.tobacco_smoking_status.toLowerCase())) {\r\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\r\n }\r\n }\r\n }\r\n }\r\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\r\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\r\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\r\n }\r\n }\r\n return result;\r\n })"]}}},"alcohol_history":{"restrictions":{"codeList":{"left":["Yes","No","Not applicable","Unknown"],"right":["Yes","No","Unknown"],"data":{"added":[],"deleted":["Not applicable"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\r\n noOrUnknownAllowedCategories = [\"none\", \"occasional drinker (< once a month)\", \"unknown\"];\r\n \r\n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\r\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\r\n if ((!$field || $field == null || checkforEmpty($field)) && alcoholHistoryCategories.includes(alcoholConsumptionCategory)) {\r\n result = {valid:false, message: `If the donor is a '${alcoholConsumptionCategory}', then the 'alcohol_history' field must be submitted as well.`};\r\n }\r\n if ((!$field || $field === null || checkforEmpty($field) || $field.trim().toLowerCase() === 'no') && (!(noOrUnknownAllowedCategories.includes(alcoholConsumptionCategory)))) {\r\n result = {valid:false, message: `If the donor is a '${alcoholConsumptionCategory}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\r\n }\r\n }\r\n return result;\r\n })"]}}},"alcohol_consumption_category":{"restrictions":{"codeList":{"left":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"right":["Daily Drinker","None","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"data":{"added":[],"deleted":["Not applicable"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\r\n \r\n if (!$field || $field === null || checkforEmpty($field)) {\r\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\r\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\r\n }\r\n }\r\n else {\r\n alcoholConsumptionCategory = $field.trim().toLowerCase();\r\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\r\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\r\n }\r\n }\r\n return result;\r\n })"]}}},"alcohol_type":{"restrictions":{"codeList":{"left":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"right":["Beer","Liquor","Other","Unknown","Wine"],"data":{"added":[],"deleted":["Not applicable"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n exclusionTerms = [\"no\", \"none\", \"unknown\"]; \r\n requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\r\n \r\n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\r\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\r\n if ($field && $field != null && !(checkforEmpty($field))) {\r\n if (exclusionTerms.includes(alcoholConsumptionCategory)) {\r\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field should not be submitted.`};\r\n }\r\n }\r\n else {\r\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\r\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\r\n }\r\n }\r\n }\r\n if ($field && $field != null && !(checkforEmpty($field)) && (!$row.alcohol_consumption_category || $row.alcohol_consumption_category === null || checkforEmpty($row.alcohol_consumption_category))) {\r\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\r\n }\r\n return result;\r\n })"]}}},"opiate_use":{"restrictions":{"codeList":{"left":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"],"right":["Never","Unknown","Yes, currently","Yes, only in the past"],"data":{"added":[],"deleted":["Not applicable"]}}}},"hot_drinks_consumption":{"restrictions":{"codeList":{"left":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"],"right":["Never","Unknown","Yes, currently","Yes, only in the past"],"data":{"added":[],"deleted":["Not applicable"]}}}},"red_meat_frequency":{"restrictions":{"codeList":{"left":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"],"right":["Never","Less than once a month","1-3 times a month","Once or twice a week","Most days but not every day","Every day","Unknown"],"data":{"added":[],"deleted":["Not applicable"]}}}},"processed_meat_frequency":{"restrictions":{"codeList":{"left":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"],"right":["Never","Less than once a month","1-3 times a month","Once or twice a week","Most days but not every day","Every day","Unknown"],"data":{"added":[],"deleted":["Not applicable"]}}}},"soft_drinks_frequency":{"restrictions":{"codeList":{"left":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"],"right":["Never","Less than once a month","1-3 times a month","Once or twice a week","Most days but not every day","Every day","Unknown"],"data":{"added":[],"deleted":["Not applicable"]}}}},"exercise_frequency":{"restrictions":{"codeList":{"left":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"],"right":["Never","Less than once a month","1-3 times a month","Once or twice a week","Most days but not every day","Every day","Unknown"],"data":{"added":[],"deleted":["Not applicable"]}}}},"exercise_intensity":{"restrictions":{"codeList":{"left":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"right":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Vigorous: Increase in the heart beat substantially with heavy perspiration"],"data":{"added":[],"deleted":["Not applicable","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($field != null || !(checkforEmpty($field))) {\r\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency)) && $row.exercise_frequency.trim().toLowerCase() === \"never\") {\r\n result = {valid: false, message: `The 'exercise_frequency' field cannot be 'never' if the '${$name}' field is submitted.`};\r\n }\r\n } \r\n return result;\r\n })"]}}}},"created":{},"deleted":{}},"family_history":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"family_relative_id":{"meta":{"primaryId":{"left":true,"right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"relationship_type":{"restrictions":{"codeList":{"left":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"],"right":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Sister","Son","Unknown"],"data":{"added":[],"deleted":["Maternal Uncle","Paternal Uncle","Uncle"]}}}},"age_of_relative_at_diagnosis":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n if ($row.relative_with_cancer_history != null) {\r\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\r\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\r\n };\r\n }\r\n }\r\n else {\r\n if (currField || currField != null) {\r\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"]}}},"cancer_type_code_of_relative":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n if ($row.relative_with_cancer_history != null) {\r\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\r\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\r\n };\r\n }\r\n }\r\n else {\r\n if (currField || currField != null) {\r\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"]}}},"cause_of_death_of_relative":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n if ($row.relative_vital_status && $row.relative_vital_status != null) {\r\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\r\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\r\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\r\n }\r\n }\r\n else {\r\n if ($field || $field != null) {\r\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\r\n }\r\n }\r\n return result;\r\n })"]}}},"relative_survival_time":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n if ($row.relative_with_cancer_history != null) {\r\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\r\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\r\n };\r\n }\r\n }\r\n else {\r\n if (currField || currField != null) {\r\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"]}}}},"created":{},"deleted":{}},"biomarker":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"deleted","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"deleted","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"deleted","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"deleted","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"deleted","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"deleted","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"deleted","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"deleted","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"deleted","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"deleted","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"deleted","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"deleted","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"deleted","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"deleted","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"deleted","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"deleted","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}}},"comorbidity":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"laterality_of_prior_malignancy":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n const invalidTypes = [\"no\", \"unknown\"]\r\n \r\n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\r\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\r\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"]}}},"age_at_comorbidity_diagnosis":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n const invalidTypes = [\"no\", \"unknown\"]\r\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\r\n \r\n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\r\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\r\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\r\n }\r\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\r\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\r\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\r\n }\r\n }\r\n }\r\n return result;\r\n })"]}}},"comorbidity_type_code":{"meta":{"notes":{"left":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n const invalidTypes = [\"no\", \"unknown\"]\r\n /* check if ICD-10 code is for neoplasms */\r\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\r\n\r\n \r\n if (neoplasmCode($row.comorbidity_type_code)) { \r\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\r\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\r\n }\r\n }\r\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\r\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\r\n }\r\n return result;\r\n })"]}}},"comorbidity_treatment_status":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n const invalidTypes = [\"no\", \"unknown\"]\r\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\r\n \r\n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\r\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\r\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\r\n }\r\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\r\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\r\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\r\n }\r\n }\r\n }\r\n return result;\r\n })"]}}},"comorbidity_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n const invalidTypes = [\"no\", \"unknown\"]\r\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\r\n \r\n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\r\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\r\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\r\n }\r\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\r\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\r\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\r\n }\r\n }\r\n }\r\n return result;\r\n })"]}}}},"created":{},"deleted":{}}}} diff --git a/website/static/data/schemas/diffs/1.24/1.24-diff-1.11.json b/website/static/data/schemas/diffs/1.24/1.24-diff-1.11.json new file mode 100644 index 00000000..3dd2c160 --- /dev/null +++ b/website/static/data/schemas/diffs/1.24/1.24-diff-1.11.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":[],"deleted":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \r\n const designation = $row.tumour_normal_designation.trim().toLowerCase();\r\n const specimen_type = $field.trim().toLowerCase();\r\n \r\n if (designation === \"normal\") {\r\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\r\n if (!validTypes.includes(specimen_type)) {\r\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\r\n }\r\n }\r\n else if (designation === \"tumour\") {\r\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\r\n if (invalidTypes.includes(specimen_type)) {\r\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\r\n }\r\n }\r\n }\r\n return result;\r\n })"]}}},"submitter_sample_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased"],"right":["Alive","Deceased","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"cause_of_death":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n \r\n if ($row.vital_status != null) {\r\n const vitalStatus = $row.vital_status.trim().toLowerCase();\r\n\r\n if (!currField && vitalStatus === \"deceased\") {\r\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\r\n }\r\n else if (currField && vitalStatus != \"deceased\"){\r\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\r\n }\r\n }\r\n else if (($row.vital_status === null) && (currField)) {\r\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\r\n }\r\n return result;\r\n })"]}}},"survival_time":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n \r\n if ($row.vital_status != null) {\r\n const vitalStatus = $row.vital_status.trim().toLowerCase();\r\n\r\n if (!currField && vitalStatus === \"deceased\") {\r\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\r\n }\r\n else if (currField && vitalStatus != \"deceased\"){\r\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\r\n }\r\n }\r\n else if (($row.vital_status === null) && (currField)) {\r\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\r\n }\r\n return result;\r\n })"]}}},"primary_site":{"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva"],"data":{"added":[],"deleted":["Unknown primary site"]}}}},"genetic_disorders":{"description":{"left":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","right":"Indicate presence of any hereditary genetic disorders. (Reference: Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)"},"restrictions":{"codeList":{"left":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"],"right":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Serrated Polyposis Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"],"data":{"added":[],"deleted":["None","Not applicable","Unknown"]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)","right":"Indicate the donor's age at which the first menstruation event occurred. (Reference: NCIt C19666)"}},"hrt_type":{"restrictions":{"codeList":{"left":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"],"right":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Other","Patch","Pill","Unknown"],"data":{"added":[],"deleted":["Not applicable"]}}}},"hrt_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n const type = $name.trim().toLowerCase().split('_duration')[0];\r\n const hormoneType = type + `_type`;\r\n \r\n if ($field != null && !(checkforEmpty($field))) {\r\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\r\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\r\n }\r\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\") {\r\n const submittedValue = $row[hormoneType].toLowerCase()\r\n result = {valid: false, message: `If '${$name}' is submitted, then '${hormoneType}' field cannot be '${submittedValue}'.`};\r\n }\r\n\r\n }\r\n return result;\r\n })"]}}},"contraception_type":{"restrictions":{"codeList":{"left":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"],"right":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Other","Progestin-only pill","Unknown","Vaginal ring"],"data":{"added":[],"deleted":["Not applicable","Oral contraceptive pill"]}}}},"contraception_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n const type = $name.trim().toLowerCase().split('_duration')[0];\r\n const hormoneType = type + `_type`;\r\n \r\n if ($field != null && !(checkforEmpty($field))) {\r\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\r\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\r\n }\r\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\") {\r\n const submittedValue = $row[hormoneType].toLowerCase()\r\n result = {valid: false, message: `If '${$name}' is submitted, then '${hormoneType}' field cannot be '${submittedValue}'.`};\r\n }\r\n\r\n }\r\n return result;\r\n })"]}}}},"created":{},"deleted":{"lost_to_followup_after_clinical_event_id":{"changeType":"deleted","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}}},"specimen":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"pathological_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\r\n\r\n \r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\r\n if (!($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n /* This is not a required field, so first ensure that it exists */\r\n else if ($field) {\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"pathological_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"pathological_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"pathological_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS"],"data":{"added":[],"deleted":["Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_stage_group')[0];\r\n\r\n const stagingSystem = stagingName + `_tumour_staging_system`;\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\r\n result.valid = false;\r\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\r\n result.message = msg;\r\n }\r\n else if (!($row[stagingSystem]) && $field) {\r\n result.valid = false;\r\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\r\n result.message = msg;\r\n }\r\n else if ($row[stagingSystem] && $field) {\r\n let codeList = [];\r\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage ii bulky',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ies',\r\n 'stage iae',\r\n 'stage ias',\r\n 'stage iaes',\r\n 'stage ib',\r\n 'stage ibe',\r\n 'stage ibs',\r\n 'stage ibes',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iies',\r\n 'stage iiae',\r\n 'stage iias',\r\n 'stage iiaes',\r\n 'stage iib',\r\n 'stage iibe',\r\n 'stage iibs',\r\n 'stage iibes',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iiies',\r\n 'stage iiiae',\r\n 'stage iiias',\r\n 'stage iiiaes',\r\n 'stage iiib',\r\n 'stage iiibe',\r\n 'stage iiibs',\r\n 'stage iiibes',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ive',\r\n 'stage ivs',\r\n 'stage ives',\r\n 'stage ivae',\r\n 'stage ivas',\r\n 'stage ivaes',\r\n 'stage ivb',\r\n 'stage ivbe',\r\n 'stage ivbs',\r\n 'stage ivbes'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\r\n $row[stagingSystem]\r\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n \r\n return result;\r\n })"]}}},"specimen_acquisition_interval":{"restrictions":{"range":{"left":null,"right":{"min":0}}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"data":{"added":[],"deleted":["Unknown"]}}}},"specimen_storage":{"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"data":{"added":[],"deleted":["Unknown"]}}}},"reference_pathology_confirmed":{"description":{"left":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)","right":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist."}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.tumour_grading_system && $field) {\r\n let codeList = [];\r\n const tieredGradingList = ['gx','g1','g2','g3'];\r\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\r\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\r\n case 'two-tier grading system':\r\n codeList = [\r\n 'low grade',\r\n 'high grade',\r\n ];\r\n break;\r\n case 'three-tier grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'four-tier grading system':\r\n codeList = [\r\n 'gx',\r\n 'g1',\r\n 'g2',\r\n 'g3',\r\n 'g4',\r\n ];\r\n break;\r\n case 'grading system for gists':\r\n codeList = [\r\n 'low',\r\n 'high',\r\n ];\r\n break;\r\n case 'grading system for gnets':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'isup grading system':\r\n codeList = [\r\n 'gx',\r\n 'g1',\r\n 'g2',\r\n 'g3',\r\n 'g4',\r\n ];\r\n break;\r\n case 'who grading system for cns tumours':\r\n codeList = [\r\n 'grade i',\r\n 'grade ii',\r\n 'grade iii',\r\n 'grade iv',\r\n ];\r\n break;\r\n case 'fnclcc grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'gleason grade group system':\r\n codeList = [\r\n 'grade group 1',\r\n 'grade group 2',\r\n 'grade group 3',\r\n 'grade group 4',\r\n 'grade group 5',\r\n ];\r\n break;\r\n case 'scarff-bloom-richardson grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'nuclear grading system for dcis':\r\n codeList = tieredGradingList;\r\n break;\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase())) {\r\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\r\n $row.tumour_grading_system\r\n }', 'tumour_grade' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\r\n result.valid = false;\r\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })"]}}},"percent_tumour_cells":{"restrictions":{"script":{"left":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"],"right":null}}},"percent_proliferating_cells":{"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}}},"percent_inflammatory_tissue":{"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}}},"percent_stromal_cells":{"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}}},"percent_necrosis":{"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}}}},"created":{},"deleted":{"specimen_laterality":{"changeType":"deleted","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"percent_tumour_cells_measurement_method":{"changeType":"deleted","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"number_lymph_nodes_examined":{"meta":{"notes":{"left":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n /* checks for a string just consisting of whitespacei */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\r\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\r\n \r\n if ($row.lymph_nodes_examined_status != null) {\r\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\r\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\r\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\r\n if (lymphNodesExaminedStatus === \"yes\") { \r\n if (parseInt($field) <= 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n else if (parseInt($field) > 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n \r\n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\r\n else if ($name === \"number_lymph_nodes_positive\") {\r\n if (lymphNodesExaminedStatus === \"yes\") {\r\n if (checkforEmpty($field) || $field == null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n else if (parseInt($field) < 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n else if ($field || $field != null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n }\r\n return result;\r\n})"]}}},"number_lymph_nodes_positive":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n /* checks for a string just consisting of whitespacei */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\r\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\r\n \r\n if ($row.lymph_nodes_examined_status != null) {\r\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\r\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\r\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\r\n if (lymphNodesExaminedStatus === \"yes\") { \r\n if (parseInt($field) <= 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n else if (parseInt($field) > 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n \r\n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\r\n else if ($name === \"number_lymph_nodes_positive\") {\r\n if (lymphNodesExaminedStatus === \"yes\") {\r\n if (checkforEmpty($field) || $field == null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n else if (parseInt($field) < 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n else if ($field || $field != null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n }\r\n return result;\r\n})"]}}},"clinical_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\r\n\r\n \r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\r\n if (!($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n /* This is not a required field, so first ensure that it exists */\r\n else if ($field) {\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"clinical_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"clinical_n_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null}}},"clinical_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"clinical_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS"],"data":{"added":[],"deleted":["Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_stage_group')[0];\r\n\r\n const stagingSystem = stagingName + `_tumour_staging_system`;\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\r\n result.valid = false;\r\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\r\n result.message = msg;\r\n }\r\n else if (!($row[stagingSystem]) && $field) {\r\n result.valid = false;\r\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\r\n result.message = msg;\r\n }\r\n else if ($row[stagingSystem] && $field) {\r\n let codeList = [];\r\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage ii bulky',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ies',\r\n 'stage iae',\r\n 'stage ias',\r\n 'stage iaes',\r\n 'stage ib',\r\n 'stage ibe',\r\n 'stage ibs',\r\n 'stage ibes',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iies',\r\n 'stage iiae',\r\n 'stage iias',\r\n 'stage iiaes',\r\n 'stage iib',\r\n 'stage iibe',\r\n 'stage iibs',\r\n 'stage iibes',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iiies',\r\n 'stage iiiae',\r\n 'stage iiias',\r\n 'stage iiiaes',\r\n 'stage iiib',\r\n 'stage iiibe',\r\n 'stage iiibs',\r\n 'stage iiibes',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ive',\r\n 'stage ivs',\r\n 'stage ives',\r\n 'stage ivae',\r\n 'stage ivas',\r\n 'stage ivaes',\r\n 'stage ivb',\r\n 'stage ivbe',\r\n 'stage ivbs',\r\n 'stage ivbes'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\r\n $row[stagingSystem]\r\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n \r\n return result;\r\n })"]}}},"performance_status":{"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"data":{"added":[],"deleted":["Unknown"]}}}}},"created":{},"deleted":{"laterality":{"changeType":"deleted","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_method":{"changeType":"deleted","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}}},"treatment":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":[],"deleted":["End of life care"]}}}},"is_primary_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]},"codeList":{"left":["Yes","No"],"right":["Yes","No","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"line_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\r\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\r\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\r\n if (isPrimaryTreatment === 'yes') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\r\n }\r\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\r\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\r\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\r\n }\r\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\r\n else if (isPrimaryTreatment === 'unknown') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'unknown'.`};\r\n }\r\n }\r\n return result;\r\n })"]}}},"treatment_start_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"treatment_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]}}},"days_per_cycle":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]}}},"number_of_cycles":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]}}},"treatment_intent":{"description":{"left":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","right":"Indicate the intended disease outcome for which the treatment is given. (Reference: NCIt C124307)"},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]},"codeList":{"left":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"],"right":["Curative","Palliative","Unknown"],"data":{"added":["Unknown"],"deleted":["Diagnostic","Forensic","Guidance","Preventative","Screening","Supportive"]}}}},"treatment_setting":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]},"codeList":{"left":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"],"right":["Adjuvant","Advanced/Metastatic","Neoadjuvant","Not applicable"],"data":{"added":["Not applicable"],"deleted":["Conditioning","Induction","Maintenance","Mobilization","Preventative","Radiosensitization","Salvage"]}}}},"response_to_treatment":{"description":{"left":"The donor's response to the applied treatment regimen.","right":"The donor's response to the applied treatment regimen. (Source: RECIST)"},"meta":{"dependsOn":{"left":"treatment.response_to_treatment_criteria_method","right":"treatment.treatment_type"},"notes":{"left":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]},"codeList":{"left":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"],"right":["Complete response","Disease progression","NED","Partial response","Stable disease"],"data":{"added":["Disease progression","NED"],"deleted":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease"]}}}},"outcome_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]}}},"toxicity_type":{"restrictions":{"codeList":{"left":["Hematological","Non-hematological","Not applicable","Unknown"],"right":["Hematological","Non-hematological"],"data":{"added":[],"deleted":["Not applicable","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($field != null && !(checkforEmpty($field))) {\r\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \r\n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\r\n \r\n /* toxicityType should only be submitted if treatment was terminated early due to acute toxicity ('outcome_of_treatment' is 'Treatment stopped due to acute toxicity'). */\r\n if (outcomeOfTreatment != \"treatment stopped due to acute toxicity\") {\r\n result = { valid: false, message: `The 'outcome_of_treatment' field should be 'Treatment stopped due to acute toxicity' if the '${$name}' field is submitted.`};\r\n }\r\n }\r\n else {\r\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\r\n }\r\n }\r\n return result;\r\n })"]}}},"hematological_toxicity":{"restrictions":{"codeList":{"left":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"right":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5"],"data":{"added":[],"deleted":["Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($field != null && !(checkforEmpty($field))) {\r\n if (($row.toxicity_type != null && !(checkforEmpty($row.toxicity_type)))) { \r\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\r\n \r\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\r\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\r\n }\r\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\r\n }\r\n }\r\n else {\r\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"]}}},"non-hematological_toxicity":{"restrictions":{"codeList":{"left":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"right":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"data":{"added":[],"deleted":["Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($field != null && !(checkforEmpty($field))) {\r\n if (($row.toxicity_type != null && !(checkforEmpty($row.toxicity_type)))) { \r\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\r\n \r\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\r\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\r\n }\r\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\r\n }\r\n }\r\n else {\r\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"]}}},"adverse_events":{"restrictions":{"codeList":{"left":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"right":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"data":{"added":[],"deleted":["None","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]}}},"clinical_trials_database":{"meta":{"notes":{"left":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added.","right":null}},"restrictions":{"codeList":{"left":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"],"right":["NCI Clinical Trials","EU Clinical Trials Register"],"data":{"added":[],"deleted":["Not applicable","Unknown"]}}}},"clinical_trial_number":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n //regex check for clinical trial number\r\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\r\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\r\n\r\n // list of valid clinical trial databases\r\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\r\n \r\n if ($row.clinical_trials_database && $field) {\r\n const trialNumber = $field.trim();\r\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\r\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\r\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\r\n }\r\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\r\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\r\n }\r\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\r\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database.`};\r\n }\r\n }\r\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\r\n result = {valid: true, message: \"Ok\"};\r\n }\r\n else if ($row.clinical_trials_database && !$field) {\r\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\r\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\r\n } \r\n }\r\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\r\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\r\n }\r\n return result;\r\n })"]}}}},"created":{},"deleted":{"response_to_treatment_criteria_method":{"changeType":"deleted","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}}}},"chemotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"dependsOn":{"left":"chemotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"dependsOn":{"left":"chemotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"chemotherapy_dosage_units":{"changeType":"created","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate the total actual drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true,"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"deleted","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"deleted","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"deleted","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"deleted","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"hormone_drug_dosage_units":{"changeType":"created","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true,"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"deleted","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"radiation":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"radiation_therapy_dosage":{"valueType":{"left":"number","right":"integer"}},"anatomical_site_irradiated":{"description":{"left":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)","right":"Indicate localization site where radiation therapy was administered."},"restrictions":{"codeList":{"left":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"right":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"data":{"added":["Bone","Extremities","Head-Neck","Peritoneum"],"deleted":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"]}}}}},"created":{},"deleted":{"radiation_boost":{"changeType":"deleted","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"deleted","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}}},"immunotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"dependsOn":{"left":"immunotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"dependsOn":{"left":"immunotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"},"displayName":{"left":"Chemotherapy Drug Name","right":"Immunotherapy Drug Name"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"deleted","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"surgery":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"deleted","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"deleted","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"deleted","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"deleted","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"deleted","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"deleted","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"deleted","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"deleted","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"deleted","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"deleted","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"deleted","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"deleted","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"deleted","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"deleted","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}}},"follow_up":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_follow_up_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"interval_of_followup":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"treatment.submitter_treatment_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"relapse_type":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n if ($row.disease_status_at_followup != null) {\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n }\r\n return result;\r\n })"]}}},"relapse_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n if ($row.disease_status_at_followup != null) {\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const intervalOfFollowup = parseInt($row.interval_of_followup);\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n relapseInterval = parseInt($field);\r\n if (relapseInterval > intervalOfFollowup) {\r\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\r\n }\r\n }\r\n }\r\n return result;\r\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"method_of_progression_status":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n if ($row.disease_status_at_followup != null) {\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n }\r\n return result;\r\n })"]}}},"anatomic_site_progression_or_recurrence":{"description":{"left":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","right":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344."},"meta":{"examples":{"left":"C50.1|C18","right":"C50.1,C18"},"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n if ($row.disease_status_at_followup != null) {\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n }\r\n return result;\r\n })"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\r\n\r\n \r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\r\n if (!($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n /* This is not a required field, so first ensure that it exists */\r\n else if ($field) {\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })","(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n if ($row.disease_status_at_followup != null) {\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n }\r\n return result;\r\n })"]}}},"recurrence_t_category":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"recurrence_n_category":{"meta":{"core":{"left":null,"right":true}}},"recurrence_m_category":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"recurrence_stage_group":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS"],"data":{"added":[],"deleted":["Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_stage_group')[0];\r\n\r\n const stagingSystem = stagingName + `_tumour_staging_system`;\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\r\n result.valid = false;\r\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\r\n result.message = msg;\r\n }\r\n else if (!($row[stagingSystem]) && $field) {\r\n result.valid = false;\r\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\r\n result.message = msg;\r\n }\r\n else if ($row[stagingSystem] && $field) {\r\n let codeList = [];\r\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage ii bulky',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ies',\r\n 'stage iae',\r\n 'stage ias',\r\n 'stage iaes',\r\n 'stage ib',\r\n 'stage ibe',\r\n 'stage ibs',\r\n 'stage ibes',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iies',\r\n 'stage iiae',\r\n 'stage iias',\r\n 'stage iiaes',\r\n 'stage iib',\r\n 'stage iibe',\r\n 'stage iibs',\r\n 'stage iibes',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iiies',\r\n 'stage iiiae',\r\n 'stage iiias',\r\n 'stage iiiaes',\r\n 'stage iiib',\r\n 'stage iiibe',\r\n 'stage iiibs',\r\n 'stage iiibes',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ive',\r\n 'stage ivs',\r\n 'stage ives',\r\n 'stage ivae',\r\n 'stage ivas',\r\n 'stage ivaes',\r\n 'stage ivb',\r\n 'stage ivbe',\r\n 'stage ivbs',\r\n 'stage ivbes'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\r\n $row[stagingSystem]\r\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n \r\n return result;\r\n })"]}}},"posttherapy_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\r\n\r\n \r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\r\n if (!($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n /* This is not a required field, so first ensure that it exists */\r\n else if ($field) {\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"posttherapy_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"posttherapy_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"posttherapy_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS"],"data":{"added":[],"deleted":["Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_stage_group')[0];\r\n\r\n const stagingSystem = stagingName + `_tumour_staging_system`;\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\r\n result.valid = false;\r\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\r\n result.message = msg;\r\n }\r\n else if (!($row[stagingSystem]) && $field) {\r\n result.valid = false;\r\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\r\n result.message = msg;\r\n }\r\n else if ($row[stagingSystem] && $field) {\r\n let codeList = [];\r\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage ii bulky',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ies',\r\n 'stage iae',\r\n 'stage ias',\r\n 'stage iaes',\r\n 'stage ib',\r\n 'stage ibe',\r\n 'stage ibs',\r\n 'stage ibes',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iies',\r\n 'stage iiae',\r\n 'stage iias',\r\n 'stage iiaes',\r\n 'stage iib',\r\n 'stage iibe',\r\n 'stage iibs',\r\n 'stage iibes',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iiies',\r\n 'stage iiiae',\r\n 'stage iiias',\r\n 'stage iiiaes',\r\n 'stage iiib',\r\n 'stage iiibe',\r\n 'stage iiibs',\r\n 'stage iiibes',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ive',\r\n 'stage ivs',\r\n 'stage ives',\r\n 'stage ivae',\r\n 'stage ivas',\r\n 'stage ivaes',\r\n 'stage ivb',\r\n 'stage ivbe',\r\n 'stage ivbs',\r\n 'stage ivbes'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\r\n $row[stagingSystem]\r\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n \r\n return result;\r\n })"]}}}},"created":{},"deleted":{}},"exposure":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"tobacco_smoking_status":{"restrictions":{"codeList":{"left":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"],"right":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Smoking history not documented"],"data":{"added":[],"deleted":["Not applicable"]}}}},"tobacco_type":{"restrictions":{"codeList":{"left":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"right":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Roll-ups","Snuff","Unknown","Waterpipe"],"data":{"added":[],"deleted":["Not applicable","Pipe"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n // check tobacco related fields\r\n if ($name === 'tobacco_type') {\r\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\r\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\r\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\r\n }\r\n else if ($row.tobacco_smoking_status.toLowerCase() === 'smoking history not documented') {\r\n result = { valid: false, message: `The 'tobacco_smoking_status' field (smoking status not documented) is inconsistent if donor smoked '${$row.tobacco_type}'.`};\r\n }\r\n else if ($row.tobacco_smoking_status.toLowerCase() === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if donor is a lifelong non-smoker.`}\r\n }\r\n }\r\n else {\r\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\r\n if (smokerCategories.includes($row.tobacco_smoking_status.toLowerCase())) {\r\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\r\n }\r\n }\r\n }\r\n }\r\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\r\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\r\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\r\n }\r\n }\r\n return result;\r\n })"]}}},"pack_years_smoked":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n // check tobacco related fields\r\n if ($name === 'tobacco_type') {\r\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\r\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\r\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\r\n }\r\n else if ($row.tobacco_smoking_status.toLowerCase() === 'smoking history not documented') {\r\n result = { valid: false, message: `The 'tobacco_smoking_status' field (smoking status not documented) is inconsistent if donor smoked '${$row.tobacco_type}'.`};\r\n }\r\n else if ($row.tobacco_smoking_status.toLowerCase() === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if donor is a lifelong non-smoker.`}\r\n }\r\n }\r\n else {\r\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\r\n if (smokerCategories.includes($row.tobacco_smoking_status.toLowerCase())) {\r\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\r\n }\r\n }\r\n }\r\n }\r\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\r\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\r\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\r\n }\r\n }\r\n return result;\r\n })"]}}},"alcohol_history":{"restrictions":{"codeList":{"left":["Yes","No","Not applicable","Unknown"],"right":["Yes","No","Unknown"],"data":{"added":[],"deleted":["Not applicable"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\r\n noOrUnknownAllowedCategories = [\"none\", \"occasional drinker (< once a month)\", \"unknown\"];\r\n \r\n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\r\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\r\n if ((!$field || $field == null || checkforEmpty($field)) && alcoholHistoryCategories.includes(alcoholConsumptionCategory)) {\r\n result = {valid:false, message: `If the donor is a '${alcoholConsumptionCategory}', then the 'alcohol_history' field must be submitted as well.`};\r\n }\r\n if ((!$field || $field === null || checkforEmpty($field) || $field.trim().toLowerCase() === 'no') && (!(noOrUnknownAllowedCategories.includes(alcoholConsumptionCategory)))) {\r\n result = {valid:false, message: `If the donor is a '${alcoholConsumptionCategory}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\r\n }\r\n }\r\n return result;\r\n })"]}}},"alcohol_consumption_category":{"restrictions":{"codeList":{"left":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"right":["Daily Drinker","None","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"data":{"added":[],"deleted":["Not applicable"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\r\n \r\n if (!$field || $field === null || checkforEmpty($field)) {\r\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\r\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\r\n }\r\n }\r\n else {\r\n alcoholConsumptionCategory = $field.trim().toLowerCase();\r\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\r\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\r\n }\r\n }\r\n return result;\r\n })"]}}},"alcohol_type":{"restrictions":{"codeList":{"left":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"right":["Beer","Liquor","Other","Unknown","Wine"],"data":{"added":[],"deleted":["Not applicable"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n exclusionTerms = [\"no\", \"none\", \"unknown\"]; \r\n requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\r\n \r\n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\r\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\r\n if ($field && $field != null && !(checkforEmpty($field))) {\r\n if (exclusionTerms.includes(alcoholConsumptionCategory)) {\r\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field should not be submitted.`};\r\n }\r\n }\r\n else {\r\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\r\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\r\n }\r\n }\r\n }\r\n if ($field && $field != null && !(checkforEmpty($field)) && (!$row.alcohol_consumption_category || $row.alcohol_consumption_category === null || checkforEmpty($row.alcohol_consumption_category))) {\r\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\r\n }\r\n return result;\r\n })"]}}},"opiate_use":{"restrictions":{"codeList":{"left":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"],"right":["Never","Unknown","Yes, currently","Yes, only in the past"],"data":{"added":[],"deleted":["Not applicable"]}}}},"hot_drinks_consumption":{"restrictions":{"codeList":{"left":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"],"right":["Never","Unknown","Yes, currently","Yes, only in the past"],"data":{"added":[],"deleted":["Not applicable"]}}}},"red_meat_frequency":{"restrictions":{"codeList":{"left":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"],"right":["Never","Less than once a month","1-3 times a month","Once or twice a week","Most days but not every day","Every day","Unknown"],"data":{"added":[],"deleted":["Not applicable"]}}}},"processed_meat_frequency":{"restrictions":{"codeList":{"left":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"],"right":["Never","Less than once a month","1-3 times a month","Once or twice a week","Most days but not every day","Every day","Unknown"],"data":{"added":[],"deleted":["Not applicable"]}}}},"soft_drinks_frequency":{"restrictions":{"codeList":{"left":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"],"right":["Never","Less than once a month","1-3 times a month","Once or twice a week","Most days but not every day","Every day","Unknown"],"data":{"added":[],"deleted":["Not applicable"]}}}},"exercise_frequency":{"restrictions":{"codeList":{"left":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"],"right":["Never","Less than once a month","1-3 times a month","Once or twice a week","Most days but not every day","Every day","Unknown"],"data":{"added":[],"deleted":["Not applicable"]}}}},"exercise_intensity":{"restrictions":{"codeList":{"left":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"right":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Vigorous: Increase in the heart beat substantially with heavy perspiration"],"data":{"added":[],"deleted":["Not applicable","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($field != null || !(checkforEmpty($field))) {\r\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency)) && $row.exercise_frequency.trim().toLowerCase() === \"never\") {\r\n result = {valid: false, message: `The 'exercise_frequency' field cannot be 'never' if the '${$name}' field is submitted.`};\r\n }\r\n } \r\n return result;\r\n })"]}}}},"created":{},"deleted":{}},"family_history":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"family_relative_id":{"meta":{"primaryId":{"left":true,"right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"age_of_relative_at_diagnosis":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n if ($row.relative_with_cancer_history != null) {\r\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\r\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\r\n };\r\n }\r\n }\r\n else {\r\n if (currField || currField != null) {\r\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"]}}},"cancer_type_code_of_relative":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n if ($row.relative_with_cancer_history != null) {\r\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\r\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\r\n };\r\n }\r\n }\r\n else {\r\n if (currField || currField != null) {\r\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"]}}},"cause_of_death_of_relative":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n if ($row.relative_vital_status && $row.relative_vital_status != null) {\r\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\r\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\r\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\r\n }\r\n }\r\n else {\r\n if ($field || $field != null) {\r\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\r\n }\r\n }\r\n return result;\r\n })"]}}},"relative_survival_time":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n if ($row.relative_with_cancer_history != null) {\r\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\r\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\r\n };\r\n }\r\n }\r\n else {\r\n if (currField || currField != null) {\r\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"]}}}},"created":{},"deleted":{}},"biomarker":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"meta":{"notes":{"left":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required.","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n let missing = true;\r\n\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\r\n \r\n if (!$field || checkforEmpty($field) || $field === null) { \r\n for (let idField of identifierFields) {\r\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\r\n continue;\r\n }\r\n else {\r\n missing = false;\r\n }\r\n }\r\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\r\n result = {\r\n valid: false,\r\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\r\n }\r\n }\r\n else if ($field && !(checkforEmpty($field)) && $field != null) {\r\n for (let idField of identifierFields) {\r\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\r\n result = {\r\n valid: false,\r\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\r\n break;\r\n }\r\n }\r\n }\r\n return result;\r\n })"]}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null},"notes":{"left":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required.","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n let missing = true;\r\n\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\r\n \r\n if (!$field || checkforEmpty($field) || $field === null) { \r\n for (let idField of identifierFields) {\r\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\r\n continue;\r\n }\r\n else {\r\n missing = false;\r\n }\r\n }\r\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\r\n result = {\r\n valid: false,\r\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\r\n }\r\n }\r\n else if ($field && !(checkforEmpty($field)) && $field != null) {\r\n for (let idField of identifierFields) {\r\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\r\n result = {\r\n valid: false,\r\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\r\n break;\r\n }\r\n }\r\n }\r\n return result;\r\n })"]}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"treatment.submitter_treatment_id","right":null},"notes":{"left":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required.","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n let missing = true;\r\n\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\r\n \r\n if (!$field || checkforEmpty($field) || $field === null) { \r\n for (let idField of identifierFields) {\r\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\r\n continue;\r\n }\r\n else {\r\n missing = false;\r\n }\r\n }\r\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\r\n result = {\r\n valid: false,\r\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\r\n }\r\n }\r\n else if ($field && !(checkforEmpty($field)) && $field != null) {\r\n for (let idField of identifierFields) {\r\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\r\n result = {\r\n valid: false,\r\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\r\n break;\r\n }\r\n }\r\n }\r\n return result;\r\n })"]}}},"submitter_follow_up_id":{"meta":{"foreignKey":{"left":"follow_up.submitter_follow_up_id","right":null},"notes":{"left":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required.","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n let missing = true;\r\n\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\r\n \r\n if (!$field || checkforEmpty($field) || $field === null) { \r\n for (let idField of identifierFields) {\r\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\r\n continue;\r\n }\r\n else {\r\n missing = false;\r\n }\r\n }\r\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\r\n result = {\r\n valid: false,\r\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\r\n }\r\n }\r\n else if ($field && !(checkforEmpty($field)) && $field != null) {\r\n for (let idField of identifierFields) {\r\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\r\n result = {\r\n valid: false,\r\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\r\n break;\r\n }\r\n }\r\n }\r\n return result;\r\n })"]}}},"test_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n let missing = true;\r\n\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\r\n \r\n if (!$field || checkforEmpty($field) || $field === null) { \r\n for (let idField of identifierFields) {\r\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\r\n continue;\r\n }\r\n else {\r\n missing = false;\r\n }\r\n }\r\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\r\n result = {\r\n valid: false,\r\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\r\n }\r\n }\r\n else if ($field && !(checkforEmpty($field)) && $field != null) {\r\n for (let idField of identifierFields) {\r\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\r\n result = {\r\n valid: false,\r\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\r\n break;\r\n }\r\n }\r\n }\r\n return result;\r\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}}},"created":{"ldl_level":{"changeType":"created","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldl_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}}},"deleted":{"ldh_level":{"changeType":"deleted","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}}}},"comorbidity":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"laterality_of_prior_malignancy":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n const invalidTypes = [\"no\", \"unknown\"]\r\n \r\n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\r\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\r\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"]}}},"age_at_comorbidity_diagnosis":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n const invalidTypes = [\"no\", \"unknown\"]\r\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\r\n \r\n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\r\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\r\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\r\n }\r\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\r\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\r\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\r\n }\r\n }\r\n }\r\n return result;\r\n })"]}}},"comorbidity_type_code":{"meta":{"notes":{"left":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n const invalidTypes = [\"no\", \"unknown\"]\r\n /* check if ICD-10 code is for neoplasms */\r\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\r\n\r\n \r\n if (neoplasmCode($row.comorbidity_type_code)) { \r\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\r\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\r\n }\r\n }\r\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\r\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\r\n }\r\n return result;\r\n })"]}}},"comorbidity_treatment_status":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n const invalidTypes = [\"no\", \"unknown\"]\r\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\r\n \r\n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\r\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\r\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\r\n }\r\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\r\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\r\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\r\n }\r\n }\r\n }\r\n return result;\r\n })"]}}},"comorbidity_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n const invalidTypes = [\"no\", \"unknown\"]\r\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\r\n \r\n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\r\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\r\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\r\n }\r\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\r\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\r\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\r\n }\r\n }\r\n }\r\n return result;\r\n })"]}}}},"created":{},"deleted":{}}}} diff --git a/website/static/data/schemas/diffs/1.24/1.24-diff-1.12.json b/website/static/data/schemas/diffs/1.24/1.24-diff-1.12.json new file mode 100644 index 00000000..fee38c51 --- /dev/null +++ b/website/static/data/schemas/diffs/1.24/1.24-diff-1.12.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":[],"deleted":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \r\n const designation = $row.tumour_normal_designation.trim().toLowerCase();\r\n const specimen_type = $field.trim().toLowerCase();\r\n \r\n if (designation === \"normal\") {\r\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\r\n if (!validTypes.includes(specimen_type)) {\r\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\r\n }\r\n }\r\n else if (designation === \"tumour\") {\r\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\r\n if (invalidTypes.includes(specimen_type)) {\r\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\r\n }\r\n }\r\n }\r\n return result;\r\n })"]}}},"submitter_sample_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased"],"right":["Alive","Deceased","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"cause_of_death":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n \r\n if ($row.vital_status != null) {\r\n const vitalStatus = $row.vital_status.trim().toLowerCase();\r\n\r\n if (!currField && vitalStatus === \"deceased\") {\r\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\r\n }\r\n else if (currField && vitalStatus != \"deceased\"){\r\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\r\n }\r\n }\r\n else if (($row.vital_status === null) && (currField)) {\r\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\r\n }\r\n return result;\r\n })"]}}},"survival_time":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n \r\n if ($row.vital_status != null) {\r\n const vitalStatus = $row.vital_status.trim().toLowerCase();\r\n\r\n if (!currField && vitalStatus === \"deceased\") {\r\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\r\n }\r\n else if (currField && vitalStatus != \"deceased\"){\r\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\r\n }\r\n }\r\n else if (($row.vital_status === null) && (currField)) {\r\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\r\n }\r\n return result;\r\n })"]}}},"primary_site":{"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva"],"data":{"added":[],"deleted":["Unknown primary site"]}}}},"genetic_disorders":{"description":{"left":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","right":"Indicate presence of any hereditary genetic disorders. (Reference: Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)"},"restrictions":{"codeList":{"left":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"],"right":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Serrated Polyposis Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"],"data":{"added":[],"deleted":["None","Not applicable","Unknown"]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)","right":"Indicate the donor's age at which the first menstruation event occurred. (Reference: NCIt C19666)"}},"hrt_type":{"restrictions":{"codeList":{"left":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"],"right":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Other","Patch","Pill","Unknown"],"data":{"added":[],"deleted":["Not applicable"]}}}},"hrt_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n const type = $name.trim().toLowerCase().split('_duration')[0];\r\n const hormoneType = type + `_type`;\r\n \r\n if ($field != null && !(checkforEmpty($field))) {\r\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\r\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\r\n }\r\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\") {\r\n const submittedValue = $row[hormoneType].toLowerCase()\r\n result = {valid: false, message: `If '${$name}' is submitted, then '${hormoneType}' field cannot be '${submittedValue}'.`};\r\n }\r\n\r\n }\r\n return result;\r\n })"]}}},"contraception_type":{"restrictions":{"codeList":{"left":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"],"right":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Other","Progestin-only pill","Unknown","Vaginal ring"],"data":{"added":[],"deleted":["Not applicable","Oral contraceptive pill"]}}}},"contraception_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n const type = $name.trim().toLowerCase().split('_duration')[0];\r\n const hormoneType = type + `_type`;\r\n \r\n if ($field != null && !(checkforEmpty($field))) {\r\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\r\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\r\n }\r\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\") {\r\n const submittedValue = $row[hormoneType].toLowerCase()\r\n result = {valid: false, message: `If '${$name}' is submitted, then '${hormoneType}' field cannot be '${submittedValue}'.`};\r\n }\r\n\r\n }\r\n return result;\r\n })"]}}}},"created":{},"deleted":{"lost_to_followup_after_clinical_event_id":{"changeType":"deleted","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}}},"specimen":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"pathological_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\r\n\r\n \r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\r\n if (!($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n /* This is not a required field, so first ensure that it exists */\r\n else if ($field) {\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"pathological_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"pathological_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"pathological_stage_group":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_stage_group')[0];\r\n\r\n const stagingSystem = stagingName + `_tumour_staging_system`;\r\n const tCategory = `${stagingName}_t_category`;\r\n const nCategory = `${stagingName}_n_category`;\r\n const mCategory = `${stagingName}_m_category`;\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\r\n result.valid = false;\r\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\r\n result.message = msg;\r\n }\r\n else if (!($row[stagingSystem]) && $field) {\r\n result.valid = false;\r\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\r\n result.message = msg;\r\n }\r\n else if ($row[stagingSystem] && $field) {\r\n let codeList = [];\r\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage ii bulky',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ies',\r\n 'stage iae',\r\n 'stage ias',\r\n 'stage iaes',\r\n 'stage ib',\r\n 'stage ibe',\r\n 'stage ibs',\r\n 'stage ibes',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iies',\r\n 'stage iiae',\r\n 'stage iias',\r\n 'stage iiaes',\r\n 'stage iib',\r\n 'stage iibe',\r\n 'stage iibs',\r\n 'stage iibes',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iiies',\r\n 'stage iiiae',\r\n 'stage iiias',\r\n 'stage iiiaes',\r\n 'stage iiib',\r\n 'stage iiibe',\r\n 'stage iiibs',\r\n 'stage iiibes',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ive',\r\n 'stage ivs',\r\n 'stage ives',\r\n 'stage ivae',\r\n 'stage ivas',\r\n 'stage ivaes',\r\n 'stage ivb',\r\n 'stage ivbe',\r\n 'stage ivbs',\r\n 'stage ivbes'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\r\n $row[stagingSystem]\r\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\r\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\r\n result = {\r\n valid: false,\r\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\r\n };\r\n }\r\n }\r\n }\r\n return result;\r\n })"]}}},"specimen_acquisition_interval":{"restrictions":{"range":{"left":null,"right":{"min":0}}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"data":{"added":[],"deleted":["Unknown"]}}}},"specimen_storage":{"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"data":{"added":[],"deleted":["Unknown"]}}}},"reference_pathology_confirmed":{"description":{"left":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)","right":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist."}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.tumour_grading_system && $field) {\r\n let codeList = [];\r\n const tieredGradingList = ['gx','g1','g2','g3'];\r\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\r\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\r\n case 'two-tier grading system':\r\n codeList = [\r\n 'low grade',\r\n 'high grade',\r\n ];\r\n break;\r\n case 'three-tier grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'four-tier grading system':\r\n codeList = [\r\n 'gx',\r\n 'g1',\r\n 'g2',\r\n 'g3',\r\n 'g4',\r\n ];\r\n break;\r\n case 'grading system for gists':\r\n codeList = [\r\n 'low',\r\n 'high',\r\n ];\r\n break;\r\n case 'grading system for gnets':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'isup grading system':\r\n codeList = [\r\n 'gx',\r\n 'g1',\r\n 'g2',\r\n 'g3',\r\n 'g4',\r\n ];\r\n break;\r\n case 'who grading system for cns tumours':\r\n codeList = [\r\n 'grade i',\r\n 'grade ii',\r\n 'grade iii',\r\n 'grade iv',\r\n ];\r\n break;\r\n case 'fnclcc grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'gleason grade group system':\r\n codeList = [\r\n 'grade group 1',\r\n 'grade group 2',\r\n 'grade group 3',\r\n 'grade group 4',\r\n 'grade group 5',\r\n ];\r\n break;\r\n case 'scarff-bloom-richardson grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'nuclear grading system for dcis':\r\n codeList = tieredGradingList;\r\n break;\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase())) {\r\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\r\n $row.tumour_grading_system\r\n }', 'tumour_grade' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\r\n result.valid = false;\r\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })"]}}},"percent_tumour_cells":{"restrictions":{"script":{"left":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"],"right":null}}},"percent_proliferating_cells":{"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}}},"percent_inflammatory_tissue":{"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}}},"percent_stromal_cells":{"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}}},"percent_necrosis":{"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}}}},"created":{},"deleted":{"specimen_laterality":{"changeType":"deleted","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"percent_tumour_cells_measurement_method":{"changeType":"deleted","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"number_lymph_nodes_examined":{"meta":{"notes":{"left":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n /* checks for a string just consisting of whitespacei */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\r\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\r\n \r\n if ($row.lymph_nodes_examined_status != null) {\r\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\r\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\r\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\r\n if (lymphNodesExaminedStatus === \"yes\") { \r\n if (parseInt($field) <= 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n else if (parseInt($field) > 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n \r\n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\r\n else if ($name === \"number_lymph_nodes_positive\") {\r\n if (lymphNodesExaminedStatus === \"yes\") {\r\n if (checkforEmpty($field) || $field == null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n else if (parseInt($field) < 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n else if ($field || $field != null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n }\r\n return result;\r\n})"]}}},"number_lymph_nodes_positive":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n /* checks for a string just consisting of whitespacei */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\r\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\r\n \r\n if ($row.lymph_nodes_examined_status != null) {\r\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\r\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\r\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\r\n if (lymphNodesExaminedStatus === \"yes\") { \r\n if (parseInt($field) <= 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n else if (parseInt($field) > 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n \r\n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\r\n else if ($name === \"number_lymph_nodes_positive\") {\r\n if (lymphNodesExaminedStatus === \"yes\") {\r\n if (checkforEmpty($field) || $field == null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n else if (parseInt($field) < 0) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n else if ($field || $field != null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\r\n };\r\n }\r\n }\r\n }\r\n return result;\r\n})"]}}},"clinical_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\r\n\r\n \r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\r\n if (!($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n /* This is not a required field, so first ensure that it exists */\r\n else if ($field) {\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"clinical_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"clinical_n_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null}}},"clinical_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"clinical_stage_group":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_stage_group')[0];\r\n\r\n const stagingSystem = stagingName + `_tumour_staging_system`;\r\n const tCategory = `${stagingName}_t_category`;\r\n const nCategory = `${stagingName}_n_category`;\r\n const mCategory = `${stagingName}_m_category`;\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\r\n result.valid = false;\r\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\r\n result.message = msg;\r\n }\r\n else if (!($row[stagingSystem]) && $field) {\r\n result.valid = false;\r\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\r\n result.message = msg;\r\n }\r\n else if ($row[stagingSystem] && $field) {\r\n let codeList = [];\r\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage ii bulky',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ies',\r\n 'stage iae',\r\n 'stage ias',\r\n 'stage iaes',\r\n 'stage ib',\r\n 'stage ibe',\r\n 'stage ibs',\r\n 'stage ibes',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iies',\r\n 'stage iiae',\r\n 'stage iias',\r\n 'stage iiaes',\r\n 'stage iib',\r\n 'stage iibe',\r\n 'stage iibs',\r\n 'stage iibes',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iiies',\r\n 'stage iiiae',\r\n 'stage iiias',\r\n 'stage iiiaes',\r\n 'stage iiib',\r\n 'stage iiibe',\r\n 'stage iiibs',\r\n 'stage iiibes',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ive',\r\n 'stage ivs',\r\n 'stage ives',\r\n 'stage ivae',\r\n 'stage ivas',\r\n 'stage ivaes',\r\n 'stage ivb',\r\n 'stage ivbe',\r\n 'stage ivbs',\r\n 'stage ivbes'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\r\n $row[stagingSystem]\r\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\r\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\r\n result = {\r\n valid: false,\r\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\r\n };\r\n }\r\n }\r\n }\r\n return result;\r\n })"]}}},"performance_status":{"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"data":{"added":[],"deleted":["Unknown"]}}}}},"created":{},"deleted":{"laterality":{"changeType":"deleted","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_method":{"changeType":"deleted","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}}},"treatment":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":[],"deleted":["End of life care"]}}}},"is_primary_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]},"codeList":{"left":["Yes","No"],"right":["Yes","No","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"line_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\r\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\r\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\r\n if (isPrimaryTreatment === 'yes') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\r\n }\r\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\r\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\r\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\r\n }\r\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\r\n else if (isPrimaryTreatment === 'unknown') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'unknown'.`};\r\n }\r\n }\r\n return result;\r\n })"]}}},"treatment_start_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"treatment_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]}}},"days_per_cycle":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]}}},"number_of_cycles":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]}}},"treatment_intent":{"description":{"left":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","right":"Indicate the intended disease outcome for which the treatment is given. (Reference: NCIt C124307)"},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]},"codeList":{"left":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"],"right":["Curative","Palliative","Unknown"],"data":{"added":["Unknown"],"deleted":["Diagnostic","Forensic","Guidance","Preventative","Screening","Supportive"]}}}},"treatment_setting":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]},"codeList":{"left":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"],"right":["Adjuvant","Advanced/Metastatic","Neoadjuvant","Not applicable"],"data":{"added":["Not applicable"],"deleted":["Conditioning","Induction","Maintenance","Mobilization","Preventative","Radiosensitization","Salvage"]}}}},"response_to_treatment":{"description":{"left":"The donor's response to the applied treatment regimen.","right":"The donor's response to the applied treatment regimen. (Source: RECIST)"},"meta":{"dependsOn":{"left":"treatment.response_to_treatment_criteria_method","right":"treatment.treatment_type"},"notes":{"left":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]},"codeList":{"left":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"],"right":["Complete response","Disease progression","NED","Partial response","Stable disease"],"data":{"added":["Disease progression","NED"],"deleted":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease"]}}}},"outcome_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]}}},"toxicity_type":{"restrictions":{"codeList":{"left":["Hematological","Non-hematological","Not applicable","Unknown"],"right":["Hematological","Non-hematological"],"data":{"added":[],"deleted":["Not applicable","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($field != null && !(checkforEmpty($field))) {\r\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \r\n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\r\n \r\n /* toxicityType should only be submitted if treatment was terminated early due to acute toxicity ('outcome_of_treatment' is 'Treatment stopped due to acute toxicity'). */\r\n if (outcomeOfTreatment != \"treatment stopped due to acute toxicity\") {\r\n result = { valid: false, message: `The 'outcome_of_treatment' field should be 'Treatment stopped due to acute toxicity' if the '${$name}' field is submitted.`};\r\n }\r\n }\r\n else {\r\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\r\n }\r\n }\r\n return result;\r\n })"]}}},"hematological_toxicity":{"restrictions":{"codeList":{"left":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"right":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5"],"data":{"added":[],"deleted":["Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($field != null && !(checkforEmpty($field))) {\r\n if (($row.toxicity_type != null && !(checkforEmpty($row.toxicity_type)))) { \r\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\r\n \r\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\r\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\r\n }\r\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\r\n }\r\n }\r\n else {\r\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"]}}},"non-hematological_toxicity":{"restrictions":{"codeList":{"left":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"right":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"data":{"added":[],"deleted":["Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($field != null && !(checkforEmpty($field))) {\r\n if (($row.toxicity_type != null && !(checkforEmpty($row.toxicity_type)))) { \r\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\r\n \r\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\r\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\r\n }\r\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\r\n }\r\n }\r\n else {\r\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"]}}},"adverse_events":{"restrictions":{"codeList":{"left":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"right":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"data":{"added":[],"deleted":["None","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ($row.treatment_type != null) {\r\n const treatmentType = $row.treatment_type;\r\n if (!(treatmentType.includes(\"No treatment\"))) {\r\n if (coreFields.includes($name)) {\r\n if (!$field || checkforEmpty($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n }\r\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]}}},"clinical_trials_database":{"meta":{"notes":{"left":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added.","right":null}},"restrictions":{"codeList":{"left":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"],"right":["NCI Clinical Trials","EU Clinical Trials Register"],"data":{"added":[],"deleted":["Not applicable","Unknown"]}}}},"clinical_trial_number":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n //regex check for clinical trial number\r\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\r\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\r\n\r\n // list of valid clinical trial databases\r\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\r\n \r\n if ($row.clinical_trials_database && $field) {\r\n const trialNumber = $field.trim();\r\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\r\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\r\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\r\n }\r\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\r\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\r\n }\r\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\r\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database.`};\r\n }\r\n }\r\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\r\n result = {valid: true, message: \"Ok\"};\r\n }\r\n else if ($row.clinical_trials_database && !$field) {\r\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\r\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\r\n } \r\n }\r\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\r\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\r\n }\r\n return result;\r\n })"]}}}},"created":{},"deleted":{"response_to_treatment_criteria_method":{"changeType":"deleted","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}}}},"chemotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"dependsOn":{"left":"chemotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"dependsOn":{"left":"chemotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"chemotherapy_dosage_units":{"changeType":"created","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate the total actual drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true,"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"deleted","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"deleted","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"deleted","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"deleted","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"hormone_drug_dosage_units":{"changeType":"created","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true,"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"deleted","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"radiation":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"radiation_therapy_dosage":{"valueType":{"left":"number","right":"integer"}},"anatomical_site_irradiated":{"description":{"left":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)","right":"Indicate localization site where radiation therapy was administered."},"restrictions":{"codeList":{"left":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"right":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"data":{"added":["Bone","Extremities","Head-Neck","Peritoneum"],"deleted":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"]}}}}},"created":{},"deleted":{"radiation_boost":{"changeType":"deleted","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"deleted","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}}},"immunotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"dependsOn":{"left":"immunotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"dependsOn":{"left":"immunotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"},"displayName":{"left":"Chemotherapy Drug Name","right":"Immunotherapy Drug Name"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"deleted","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"surgery":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"deleted","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"deleted","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"deleted","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"deleted","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"deleted","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"deleted","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"deleted","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"deleted","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"deleted","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"deleted","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"deleted","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"deleted","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"deleted","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"deleted","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}}},"follow_up":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_follow_up_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"interval_of_followup":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"treatment.submitter_treatment_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"relapse_type":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n if ($row.disease_status_at_followup != null) {\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n }\r\n return result;\r\n })"]}}},"relapse_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n if ($row.disease_status_at_followup != null) {\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const intervalOfFollowup = parseInt($row.interval_of_followup);\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n relapseInterval = parseInt($field);\r\n if (relapseInterval > intervalOfFollowup) {\r\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\r\n }\r\n }\r\n }\r\n return result;\r\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"method_of_progression_status":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n if ($row.disease_status_at_followup != null) {\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n }\r\n return result;\r\n })"]}}},"anatomic_site_progression_or_recurrence":{"description":{"left":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","right":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344."},"meta":{"examples":{"left":"C50.1|C18","right":"C50.1,C18"},"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n if ($row.disease_status_at_followup != null) {\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n }\r\n return result;\r\n })"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\r\n\r\n \r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\r\n if (!($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n /* This is not a required field, so first ensure that it exists */\r\n else if ($field) {\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })","(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n if ($row.disease_status_at_followup != null) {\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n }\r\n return result;\r\n })"]}}},"recurrence_t_category":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"recurrence_n_category":{"meta":{"core":{"left":null,"right":true}}},"recurrence_m_category":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"recurrence_stage_group":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_stage_group')[0];\r\n\r\n const stagingSystem = stagingName + `_tumour_staging_system`;\r\n const tCategory = `${stagingName}_t_category`;\r\n const nCategory = `${stagingName}_n_category`;\r\n const mCategory = `${stagingName}_m_category`;\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\r\n result.valid = false;\r\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\r\n result.message = msg;\r\n }\r\n else if (!($row[stagingSystem]) && $field) {\r\n result.valid = false;\r\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\r\n result.message = msg;\r\n }\r\n else if ($row[stagingSystem] && $field) {\r\n let codeList = [];\r\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage ii bulky',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ies',\r\n 'stage iae',\r\n 'stage ias',\r\n 'stage iaes',\r\n 'stage ib',\r\n 'stage ibe',\r\n 'stage ibs',\r\n 'stage ibes',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iies',\r\n 'stage iiae',\r\n 'stage iias',\r\n 'stage iiaes',\r\n 'stage iib',\r\n 'stage iibe',\r\n 'stage iibs',\r\n 'stage iibes',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iiies',\r\n 'stage iiiae',\r\n 'stage iiias',\r\n 'stage iiiaes',\r\n 'stage iiib',\r\n 'stage iiibe',\r\n 'stage iiibs',\r\n 'stage iiibes',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ive',\r\n 'stage ivs',\r\n 'stage ives',\r\n 'stage ivae',\r\n 'stage ivas',\r\n 'stage ivaes',\r\n 'stage ivb',\r\n 'stage ivbe',\r\n 'stage ivbs',\r\n 'stage ivbes'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\r\n $row[stagingSystem]\r\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\r\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\r\n result = {\r\n valid: false,\r\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\r\n };\r\n }\r\n }\r\n }\r\n return result;\r\n })"]}}},"posttherapy_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\r\n\r\n \r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\r\n if (!($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n /* This is not a required field, so first ensure that it exists */\r\n else if ($field) {\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"posttherapy_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"posttherapy_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"posttherapy_stage_group":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_stage_group')[0];\r\n\r\n const stagingSystem = stagingName + `_tumour_staging_system`;\r\n const tCategory = `${stagingName}_t_category`;\r\n const nCategory = `${stagingName}_n_category`;\r\n const mCategory = `${stagingName}_m_category`;\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\r\n result.valid = false;\r\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\r\n result.message = msg;\r\n }\r\n else if (!($row[stagingSystem]) && $field) {\r\n result.valid = false;\r\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\r\n result.message = msg;\r\n }\r\n else if ($row[stagingSystem] && $field) {\r\n let codeList = [];\r\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage ii bulky',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ies',\r\n 'stage iae',\r\n 'stage ias',\r\n 'stage iaes',\r\n 'stage ib',\r\n 'stage ibe',\r\n 'stage ibs',\r\n 'stage ibes',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iies',\r\n 'stage iiae',\r\n 'stage iias',\r\n 'stage iiaes',\r\n 'stage iib',\r\n 'stage iibe',\r\n 'stage iibs',\r\n 'stage iibes',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iiies',\r\n 'stage iiiae',\r\n 'stage iiias',\r\n 'stage iiiaes',\r\n 'stage iiib',\r\n 'stage iiibe',\r\n 'stage iiibs',\r\n 'stage iiibes',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ive',\r\n 'stage ivs',\r\n 'stage ives',\r\n 'stage ivae',\r\n 'stage ivas',\r\n 'stage ivaes',\r\n 'stage ivb',\r\n 'stage ivbe',\r\n 'stage ivbs',\r\n 'stage ivbes'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\r\n $row[stagingSystem]\r\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\r\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\r\n result = {\r\n valid: false,\r\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\r\n };\r\n }\r\n }\r\n }\r\n return result;\r\n })"]}}}},"created":{},"deleted":{}},"exposure":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"tobacco_smoking_status":{"restrictions":{"codeList":{"left":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"],"right":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Smoking history not documented"],"data":{"added":[],"deleted":["Not applicable"]}}}},"tobacco_type":{"restrictions":{"codeList":{"left":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"right":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"data":{"added":[],"deleted":["Not applicable"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n // check tobacco related fields\r\n if ($name === 'tobacco_type') {\r\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\r\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\r\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\r\n }\r\n else if ($row.tobacco_smoking_status.toLowerCase() === 'smoking history not documented') {\r\n result = { valid: false, message: `The 'tobacco_smoking_status' field (smoking status not documented) is inconsistent if donor smoked '${$row.tobacco_type}'.`};\r\n }\r\n else if ($row.tobacco_smoking_status.toLowerCase() === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if donor is a lifelong non-smoker.`}\r\n }\r\n }\r\n else {\r\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\r\n if (smokerCategories.includes($row.tobacco_smoking_status.toLowerCase())) {\r\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\r\n }\r\n }\r\n }\r\n }\r\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\r\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\r\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\r\n }\r\n }\r\n return result;\r\n })"]}}},"pack_years_smoked":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n // check tobacco related fields\r\n if ($name === 'tobacco_type') {\r\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\r\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\r\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\r\n }\r\n else if ($row.tobacco_smoking_status.toLowerCase() === 'smoking history not documented') {\r\n result = { valid: false, message: `The 'tobacco_smoking_status' field (smoking status not documented) is inconsistent if donor smoked '${$row.tobacco_type}'.`};\r\n }\r\n else if ($row.tobacco_smoking_status.toLowerCase() === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)') {\r\n result = { valid: false, message: `The '${$name}' field should not be submitted if donor is a lifelong non-smoker.`}\r\n }\r\n }\r\n else {\r\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\r\n if (smokerCategories.includes($row.tobacco_smoking_status.toLowerCase())) {\r\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\r\n }\r\n }\r\n }\r\n }\r\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\r\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\r\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\r\n }\r\n }\r\n return result;\r\n })"]}}},"alcohol_history":{"restrictions":{"codeList":{"left":["Yes","No","Not applicable","Unknown"],"right":["Yes","No","Unknown"],"data":{"added":[],"deleted":["Not applicable"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\r\n noOrUnknownAllowedCategories = [\"none\", \"occasional drinker (< once a month)\", \"unknown\"];\r\n \r\n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\r\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\r\n if ((!$field || $field == null || checkforEmpty($field)) && alcoholHistoryCategories.includes(alcoholConsumptionCategory)) {\r\n result = {valid:false, message: `If the donor is a '${alcoholConsumptionCategory}', then the 'alcohol_history' field must be submitted as well.`};\r\n }\r\n if ((!$field || $field === null || checkforEmpty($field) || $field.trim().toLowerCase() === 'no') && (!(noOrUnknownAllowedCategories.includes(alcoholConsumptionCategory)))) {\r\n result = {valid:false, message: `If the donor is a '${alcoholConsumptionCategory}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\r\n }\r\n }\r\n return result;\r\n })"]}}},"alcohol_consumption_category":{"restrictions":{"codeList":{"left":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"right":["Daily Drinker","None","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"data":{"added":[],"deleted":["Not applicable"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\r\n \r\n if (!$field || $field === null || checkforEmpty($field)) {\r\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\r\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\r\n }\r\n }\r\n else {\r\n alcoholConsumptionCategory = $field.trim().toLowerCase();\r\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\r\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\r\n }\r\n }\r\n return result;\r\n })"]}}},"alcohol_type":{"restrictions":{"codeList":{"left":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"right":["Beer","Liquor","Other","Unknown","Wine"],"data":{"added":[],"deleted":["Not applicable"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n exclusionTerms = [\"no\", \"none\", \"unknown\"]; \r\n requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\r\n \r\n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\r\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\r\n if ($field && $field != null && !(checkforEmpty($field))) {\r\n if (exclusionTerms.includes(alcoholConsumptionCategory)) {\r\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field should not be submitted.`};\r\n }\r\n }\r\n else {\r\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\r\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\r\n }\r\n }\r\n }\r\n if ($field && $field != null && !(checkforEmpty($field)) && (!$row.alcohol_consumption_category || $row.alcohol_consumption_category === null || checkforEmpty($row.alcohol_consumption_category))) {\r\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\r\n }\r\n return result;\r\n })"]}}},"opiate_use":{"restrictions":{"codeList":{"left":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"],"right":["Never","Unknown","Yes, currently","Yes, only in the past"],"data":{"added":[],"deleted":["Not applicable"]}}}},"hot_drinks_consumption":{"restrictions":{"codeList":{"left":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"],"right":["Never","Unknown","Yes, currently","Yes, only in the past"],"data":{"added":[],"deleted":["Not applicable"]}}}},"red_meat_frequency":{"restrictions":{"codeList":{"left":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"],"right":["Never","Less than once a month","1-3 times a month","Once or twice a week","Most days but not every day","Every day","Unknown"],"data":{"added":[],"deleted":["Not applicable"]}}}},"processed_meat_frequency":{"restrictions":{"codeList":{"left":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"],"right":["Never","Less than once a month","1-3 times a month","Once or twice a week","Most days but not every day","Every day","Unknown"],"data":{"added":[],"deleted":["Not applicable"]}}}},"soft_drinks_frequency":{"restrictions":{"codeList":{"left":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"],"right":["Never","Less than once a month","1-3 times a month","Once or twice a week","Most days but not every day","Every day","Unknown"],"data":{"added":[],"deleted":["Not applicable"]}}}},"exercise_frequency":{"restrictions":{"codeList":{"left":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"],"right":["Never","Less than once a month","1-3 times a month","Once or twice a week","Most days but not every day","Every day","Unknown"],"data":{"added":[],"deleted":["Not applicable"]}}}},"exercise_intensity":{"restrictions":{"codeList":{"left":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"right":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Vigorous: Increase in the heart beat substantially with heavy perspiration"],"data":{"added":[],"deleted":["Not applicable","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($field != null || !(checkforEmpty($field))) {\r\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency)) && $row.exercise_frequency.trim().toLowerCase() === \"never\") {\r\n result = {valid: false, message: `The 'exercise_frequency' field cannot be 'never' if the '${$name}' field is submitted.`};\r\n }\r\n } \r\n return result;\r\n })"]}}}},"created":{},"deleted":{}},"family_history":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"family_relative_id":{"meta":{"primaryId":{"left":true,"right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"age_of_relative_at_diagnosis":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n if ($row.relative_with_cancer_history != null) {\r\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\r\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\r\n };\r\n }\r\n }\r\n else {\r\n if (currField || currField != null) {\r\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"]}}},"cancer_type_code_of_relative":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n if ($row.relative_with_cancer_history != null) {\r\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\r\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\r\n };\r\n }\r\n }\r\n else {\r\n if (currField || currField != null) {\r\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"]}}},"cause_of_death_of_relative":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n if ($row.relative_vital_status && $row.relative_vital_status != null) {\r\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\r\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\r\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\r\n }\r\n }\r\n else {\r\n if ($field || $field != null) {\r\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\r\n }\r\n }\r\n return result;\r\n })"]}}},"relative_survival_time":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n if ($row.relative_with_cancer_history != null) {\r\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\r\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\r\n result = {\r\n valid: false,\r\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\r\n };\r\n }\r\n }\r\n else {\r\n if (currField || currField != null) {\r\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"]}}}},"created":{},"deleted":{}},"biomarker":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"meta":{"notes":{"left":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required.","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n let missing = true;\r\n\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\r\n \r\n if (!$field || checkforEmpty($field) || $field === null) { \r\n for (let idField of identifierFields) {\r\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\r\n continue;\r\n }\r\n else {\r\n missing = false;\r\n }\r\n }\r\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\r\n result = {\r\n valid: false,\r\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\r\n }\r\n }\r\n else if ($field && !(checkforEmpty($field)) && $field != null) {\r\n for (let idField of identifierFields) {\r\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\r\n result = {\r\n valid: false,\r\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\r\n break;\r\n }\r\n }\r\n }\r\n return result;\r\n })"]}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null},"notes":{"left":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required.","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n let missing = true;\r\n\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\r\n \r\n if (!$field || checkforEmpty($field) || $field === null) { \r\n for (let idField of identifierFields) {\r\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\r\n continue;\r\n }\r\n else {\r\n missing = false;\r\n }\r\n }\r\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\r\n result = {\r\n valid: false,\r\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\r\n }\r\n }\r\n else if ($field && !(checkforEmpty($field)) && $field != null) {\r\n for (let idField of identifierFields) {\r\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\r\n result = {\r\n valid: false,\r\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\r\n break;\r\n }\r\n }\r\n }\r\n return result;\r\n })"]}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"treatment.submitter_treatment_id","right":null},"notes":{"left":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required.","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n let missing = true;\r\n\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\r\n \r\n if (!$field || checkforEmpty($field) || $field === null) { \r\n for (let idField of identifierFields) {\r\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\r\n continue;\r\n }\r\n else {\r\n missing = false;\r\n }\r\n }\r\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\r\n result = {\r\n valid: false,\r\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\r\n }\r\n }\r\n else if ($field && !(checkforEmpty($field)) && $field != null) {\r\n for (let idField of identifierFields) {\r\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\r\n result = {\r\n valid: false,\r\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\r\n break;\r\n }\r\n }\r\n }\r\n return result;\r\n })"]}}},"submitter_follow_up_id":{"meta":{"foreignKey":{"left":"follow_up.submitter_follow_up_id","right":null},"notes":{"left":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required.","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n let missing = true;\r\n\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\r\n \r\n if (!$field || checkforEmpty($field) || $field === null) { \r\n for (let idField of identifierFields) {\r\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\r\n continue;\r\n }\r\n else {\r\n missing = false;\r\n }\r\n }\r\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\r\n result = {\r\n valid: false,\r\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\r\n }\r\n }\r\n else if ($field && !(checkforEmpty($field)) && $field != null) {\r\n for (let idField of identifierFields) {\r\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\r\n result = {\r\n valid: false,\r\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\r\n break;\r\n }\r\n }\r\n }\r\n return result;\r\n })"]}}},"test_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n let missing = true;\r\n\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\r\n \r\n if (!$field || checkforEmpty($field) || $field === null) { \r\n for (let idField of identifierFields) {\r\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\r\n continue;\r\n }\r\n else {\r\n missing = false;\r\n }\r\n }\r\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\r\n result = {\r\n valid: false,\r\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\r\n }\r\n }\r\n else if ($field && !(checkforEmpty($field)) && $field != null) {\r\n for (let idField of identifierFields) {\r\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\r\n result = {\r\n valid: false,\r\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\r\n break;\r\n }\r\n }\r\n }\r\n return result;\r\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}}},"created":{},"deleted":{}},"comorbidity":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"laterality_of_prior_malignancy":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n const invalidTypes = [\"no\", \"unknown\"]\r\n \r\n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\r\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\r\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\r\n }\r\n }\r\n return result;\r\n })"]}}},"age_at_comorbidity_diagnosis":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n const invalidTypes = [\"no\", \"unknown\"]\r\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\r\n \r\n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\r\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\r\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\r\n }\r\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\r\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\r\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\r\n }\r\n }\r\n }\r\n return result;\r\n })"]}}},"comorbidity_type_code":{"meta":{"notes":{"left":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n const invalidTypes = [\"no\", \"unknown\"]\r\n /* check if ICD-10 code is for neoplasms */\r\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\r\n\r\n \r\n if (neoplasmCode($row.comorbidity_type_code)) { \r\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\r\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\r\n }\r\n }\r\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\r\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\r\n }\r\n return result;\r\n })"]}}},"comorbidity_treatment_status":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n const invalidTypes = [\"no\", \"unknown\"]\r\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\r\n \r\n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\r\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\r\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\r\n }\r\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\r\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\r\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\r\n }\r\n }\r\n }\r\n return result;\r\n })"]}}},"comorbidity_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n\r\n \r\n /* checks for a string just consisting of whitespace */\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n const invalidTypes = [\"no\", \"unknown\"]\r\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\r\n \r\n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\r\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\r\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\r\n }\r\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\r\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\r\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\r\n }\r\n }\r\n }\r\n return result;\r\n })"]}}}},"created":{},"deleted":{}}}} diff --git a/website/static/data/schemas/diffs/1.24/1.24-diff-1.13.json b/website/static/data/schemas/diffs/1.24/1.24-diff-1.13.json new file mode 100644 index 00000000..a7644bec --- /dev/null +++ b/website/static/data/schemas/diffs/1.24/1.24-diff-1.13.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":[],"deleted":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"]}}}},"submitter_sample_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"primary_site":{"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva"],"data":{"added":[],"deleted":["Unknown primary site"]}}}},"genetic_disorders":{"description":{"left":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","right":"Indicate presence of any hereditary genetic disorders. (Reference: Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)"},"restrictions":{"codeList":{"left":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"],"right":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Serrated Polyposis Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"],"data":{"added":[],"deleted":["None","Not applicable","Unknown"]}}}},"hrt_type":{"restrictions":{"codeList":{"left":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"],"right":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Other","Patch","Pill","Unknown"],"data":{"added":[],"deleted":["Not applicable"]}}}},"hrt_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\") {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If '${$name}' is submitted, then '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n\n }\n return result;\n })"]}}},"contraception_type":{"restrictions":{"codeList":{"left":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"],"right":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Other","Progestin-only pill","Unknown","Vaginal ring"],"data":{"added":[],"deleted":["Not applicable","Oral contraceptive pill"]}}}},"contraception_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\") {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If '${$name}' is submitted, then '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n\n }\n return result;\n })"]}}}},"created":{},"deleted":{"lost_to_followup_after_clinical_event_id":{"changeType":"deleted","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}}},"specimen":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"pathological_tumour_staging_system":{"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["Revised International staging system (R-ISS)"]}}}},"pathological_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX"],"data":{"added":[],"deleted":["Not applicable"]}}}},"specimen_acquisition_interval":{"restrictions":{"range":{"left":null,"right":{"min":0}}}},"specimen_laterality":{"description":{"left":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","right":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR 2007875)"},"restrictions":{"codeList":{"left":["Left","Not applicable","Right","Unknown"],"right":["Left","Right","Unknown"],"data":{"added":[],"deleted":["Not applicable"]}}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"data":{"added":[],"deleted":["Unknown"]}}}},"specimen_storage":{"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"data":{"added":[],"deleted":["Unknown"]}}}},"reference_pathology_confirmed":{"description":{"left":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)","right":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist."}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"percent_tumour_cells":{"restrictions":{"script":{"left":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"],"right":null}}}},"created":{},"deleted":{"percent_tumour_cells_measurement_method":{"changeType":"deleted","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"laterality":{"description":{"left":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","right":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR 827)"}},"clinical_tumour_staging_system":{"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["Revised International staging system (R-ISS)"]}}}},"clinical_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX"],"data":{"added":[],"deleted":["Not applicable"]}}}},"performance_status":{"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"data":{"added":[],"deleted":["Unknown"]}}}}},"created":{},"deleted":{"lymph_nodes_examined_method":{"changeType":"deleted","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}}},"treatment":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":[],"deleted":["End of life care"]}}}},"is_primary_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Yes","No"],"right":["Yes","No","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"line_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'unknown') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'unknown'.`};\n }\n }\n return result;\n })"]}}},"treatment_start_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"treatment_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]}}},"days_per_cycle":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]}}},"number_of_cycles":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_intent":{"description":{"left":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","right":"Indicate the intended disease outcome for which the treatment is given. (Reference: NCIt C124307)"},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"],"right":["Curative","Palliative","Unknown"],"data":{"added":["Unknown"],"deleted":["Diagnostic","Forensic","Guidance","Preventative","Screening","Supportive"]}}}},"treatment_setting":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"],"right":["Adjuvant","Advanced/Metastatic","Neoadjuvant","Not applicable"],"data":{"added":["Not applicable"],"deleted":["Conditioning","Induction","Maintenance","Mobilization","Preventative","Radiosensitization","Salvage"]}}}},"response_to_treatment":{"description":{"left":"The donor's response to the applied treatment regimen.","right":"The donor's response to the applied treatment regimen. (Source: RECIST)"},"meta":{"dependsOn":{"left":"treatment.response_to_treatment_criteria_method","right":"treatment.treatment_type"},"notes":{"left":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"],"right":["Complete response","Disease progression","NED","Partial response","Stable disease"],"data":{"added":["Disease progression","NED"],"deleted":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease"]}}}},"outcome_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]}}},"toxicity_type":{"restrictions":{"codeList":{"left":["Hematological","Non-hematological","Not applicable","Unknown"],"right":["Hematological","Non-hematological"],"data":{"added":[],"deleted":["Not applicable","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n \n /* toxicityType should only be submitted if treatment was terminated early due to acute toxicity ('outcome_of_treatment' is 'Treatment stopped due to acute toxicity'). */\n if (outcomeOfTreatment != \"treatment stopped due to acute toxicity\") {\n result = { valid: false, message: `The 'outcome_of_treatment' field should be 'Treatment stopped due to acute toxicity' if the '${$name}' field is submitted.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"]}}},"hematological_toxicity":{"restrictions":{"codeList":{"left":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"right":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5"],"data":{"added":[],"deleted":["Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n if (($row.toxicity_type != null && !(checkforEmpty($row.toxicity_type)))) { \n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n \n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}},"non-hematological_toxicity":{"restrictions":{"codeList":{"left":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"right":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"data":{"added":[],"deleted":["Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n if (($row.toxicity_type != null && !(checkforEmpty($row.toxicity_type)))) { \n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n \n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}},"adverse_events":{"restrictions":{"codeList":{"left":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"right":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"data":{"added":[],"deleted":["None","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]}}},"clinical_trials_database":{"meta":{"notes":{"left":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added.","right":null}},"restrictions":{"codeList":{"left":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"],"right":["NCI Clinical Trials","EU Clinical Trials Register"],"data":{"added":[],"deleted":["Not applicable","Unknown"]}}}},"clinical_trial_number":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"]}}}},"created":{},"deleted":{"response_to_treatment_criteria_method":{"changeType":"deleted","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}}}},"chemotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"dependsOn":{"left":"chemotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"dependsOn":{"left":"chemotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"chemotherapy_dosage_units":{"changeType":"created","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate the total actual drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true,"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"deleted","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"hormone_drug_dosage_units":{"changeType":"created","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true,"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"deleted","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"radiation":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{"radiation_boost":{"changeType":"deleted","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"deleted","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}}},"immunotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"dependsOn":{"left":"immunotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"dependsOn":{"left":"immunotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"},"displayName":{"left":"Chemotherapy Drug Name","right":"Immunotherapy Drug Name"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"deleted","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"surgery":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"deleted","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"deleted","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"deleted","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"deleted","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"deleted","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"deleted","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"deleted","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"deleted","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"deleted","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"deleted","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"deleted","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"deleted","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"deleted","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"deleted","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}}},"follow_up":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_follow_up_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"interval_of_followup":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"treatment.submitter_treatment_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"relapse_type":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"]}}},"relapse_interval":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"method_of_progression_status":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"]}}},"anatomic_site_progression_or_recurrence":{"description":{"left":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","right":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344."},"meta":{"examples":{"left":"C50.1|C18","right":"C50.1,C18"},"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["Revised International staging system (R-ISS)"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"]}}},"recurrence_t_category":{"meta":{"core":{"left":null,"right":true}}},"recurrence_n_category":{"meta":{"core":{"left":null,"right":true}}},"recurrence_m_category":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX"],"data":{"added":[],"deleted":["Not applicable"]}}}},"recurrence_stage_group":{"meta":{"core":{"left":null,"right":true}}},"posttherapy_tumour_staging_system":{"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["Revised International staging system (R-ISS)"]}}}},"posttherapy_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX"],"data":{"added":[],"deleted":["Not applicable"]}}}}},"created":{},"deleted":{}},"exposure":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"tobacco_smoking_status":{"restrictions":{"codeList":{"left":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"],"right":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Smoking history not documented"],"data":{"added":[],"deleted":["Not applicable"]}}}},"tobacco_type":{"restrictions":{"codeList":{"left":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"right":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"data":{"added":[],"deleted":["Not applicable"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else if ($row.tobacco_smoking_status.toLowerCase() === 'smoking history not documented') {\n result = { valid: false, message: `The 'tobacco_smoking_status' field (smoking status not documented) is inconsistent if donor smoked '${$row.tobacco_type}'.`};\n }\n else if ($row.tobacco_smoking_status.toLowerCase() === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if donor is a lifelong non-smoker.`}\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}}},"pack_years_smoked":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else if ($row.tobacco_smoking_status.toLowerCase() === 'smoking history not documented') {\n result = { valid: false, message: `The 'tobacco_smoking_status' field (smoking status not documented) is inconsistent if donor smoked '${$row.tobacco_type}'.`};\n }\n else if ($row.tobacco_smoking_status.toLowerCase() === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if donor is a lifelong non-smoker.`}\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}}},"alcohol_history":{"restrictions":{"codeList":{"left":["Yes","No","Not applicable","Unknown"],"right":["Yes","No","Unknown"],"data":{"added":[],"deleted":["Not applicable"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n noOrUnknownAllowedCategories = [\"none\", \"occasional drinker (< once a month)\", \"unknown\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ((!$field || $field == null || checkforEmpty($field)) && alcoholHistoryCategories.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `If the donor is a '${alcoholConsumptionCategory}', then the 'alcohol_history' field must be submitted as well.`};\n }\n if ((!$field || $field === null || checkforEmpty($field) || $field.trim().toLowerCase() === 'no') && (!(noOrUnknownAllowedCategories.includes(alcoholConsumptionCategory)))) {\n result = {valid:false, message: `If the donor is a '${alcoholConsumptionCategory}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n }\n return result;\n })"]}}},"alcohol_consumption_category":{"restrictions":{"codeList":{"left":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"right":["Daily Drinker","None","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"data":{"added":[],"deleted":["Not applicable"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}}},"alcohol_type":{"restrictions":{"codeList":{"left":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"right":["Beer","Liquor","Other","Unknown","Wine"],"data":{"added":[],"deleted":["Not applicable"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n exclusionTerms = [\"no\", \"none\", \"unknown\"]; \n requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (exclusionTerms.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field should not be submitted.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n if ($field && $field != null && !(checkforEmpty($field)) && (!$row.alcohol_consumption_category || $row.alcohol_consumption_category === null || checkforEmpty($row.alcohol_consumption_category))) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n return result;\n })"]}}},"opiate_use":{"restrictions":{"codeList":{"left":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"],"right":["Never","Unknown","Yes, currently","Yes, only in the past"],"data":{"added":[],"deleted":["Not applicable"]}}}},"hot_drinks_consumption":{"restrictions":{"codeList":{"left":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"],"right":["Never","Unknown","Yes, currently","Yes, only in the past"],"data":{"added":[],"deleted":["Not applicable"]}}}},"red_meat_frequency":{"restrictions":{"codeList":{"left":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"],"right":["Never","Less than once a month","1-3 times a month","Once or twice a week","Most days but not every day","Every day","Unknown"],"data":{"added":[],"deleted":["Not applicable"]}}}},"processed_meat_frequency":{"restrictions":{"codeList":{"left":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"],"right":["Never","Less than once a month","1-3 times a month","Once or twice a week","Most days but not every day","Every day","Unknown"],"data":{"added":[],"deleted":["Not applicable"]}}}},"soft_drinks_frequency":{"restrictions":{"codeList":{"left":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"],"right":["Never","Less than once a month","1-3 times a month","Once or twice a week","Most days but not every day","Every day","Unknown"],"data":{"added":[],"deleted":["Not applicable"]}}}},"exercise_frequency":{"restrictions":{"codeList":{"left":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"],"right":["Never","Less than once a month","1-3 times a month","Once or twice a week","Most days but not every day","Every day","Unknown"],"data":{"added":[],"deleted":["Not applicable"]}}}},"exercise_intensity":{"restrictions":{"codeList":{"left":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"right":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Vigorous: Increase in the heart beat substantially with heavy perspiration"],"data":{"added":[],"deleted":["Not applicable","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null || !(checkforEmpty($field))) {\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency)) && $row.exercise_frequency.trim().toLowerCase() === \"never\") {\n result = {valid: false, message: `The 'exercise_frequency' field cannot be 'never' if the '${$name}' field is submitted.`};\n }\n } \n return result;\n })"]}}}},"created":{},"deleted":{}},"family_history":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"family_relative_id":{"meta":{"primaryId":{"left":true,"right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"biomarker":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"treatment.submitter_treatment_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_follow_up_id":{"meta":{"foreignKey":{"left":"follow_up.submitter_follow_up_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"test_interval":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}}},"created":{},"deleted":{}},"comorbidity":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}}}} diff --git a/website/static/data/schemas/diffs/1.24/1.24-diff-1.14.json b/website/static/data/schemas/diffs/1.24/1.24-diff-1.14.json new file mode 100644 index 00000000..e25dd016 --- /dev/null +++ b/website/static/data/schemas/diffs/1.24/1.24-diff-1.14.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":[],"deleted":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"]}}}},"submitter_sample_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"primary_site":{"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva"],"data":{"added":[],"deleted":["Unknown primary site"]}}}}},"created":{},"deleted":{"lost_to_followup_after_clinical_event_id":{"changeType":"deleted","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}}},"specimen":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"pathological_tumour_staging_system":{"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["Revised International staging system (R-ISS)"]}}}},"pathological_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX"],"data":{"added":[],"deleted":["Not applicable"]}}}},"specimen_acquisition_interval":{"restrictions":{"range":{"left":null,"right":{"min":0}}}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"percent_tumour_cells":{"restrictions":{"script":{"left":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"],"right":null}}}},"created":{},"deleted":{"percent_tumour_cells_measurement_method":{"changeType":"deleted","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"clinical_tumour_staging_system":{"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["Revised International staging system (R-ISS)"]}}}},"clinical_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX"],"data":{"added":[],"deleted":["Not applicable"]}}}}},"created":{},"deleted":{"lymph_nodes_examined_method":{"changeType":"deleted","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}}},"treatment":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":[],"deleted":["End of life care"]}}}},"is_primary_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Yes","No"],"right":["Yes","No","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"line_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'unknown') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'unknown'.`};\n }\n }\n return result;\n })"]}}},"treatment_start_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"treatment_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]}}},"days_per_cycle":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]}}},"number_of_cycles":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_intent":{"description":{"left":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","right":"Indicate the intended disease outcome for which the treatment is given. (Reference: NCIt C124307)"},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"],"right":["Curative","Palliative","Unknown"],"data":{"added":["Unknown"],"deleted":["Diagnostic","Forensic","Guidance","Preventative","Screening","Supportive"]}}}},"treatment_setting":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"],"right":["Adjuvant","Advanced/Metastatic","Neoadjuvant","Not applicable"],"data":{"added":["Not applicable"],"deleted":["Conditioning","Induction","Maintenance","Mobilization","Preventative","Radiosensitization","Salvage"]}}}},"response_to_treatment":{"description":{"left":"The donor's response to the applied treatment regimen.","right":"The donor's response to the applied treatment regimen. (Source: RECIST)"},"meta":{"dependsOn":{"left":"treatment.response_to_treatment_criteria_method","right":"treatment.treatment_type"},"notes":{"left":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"],"right":["Complete response","Disease progression","NED","Partial response","Stable disease"],"data":{"added":["Disease progression","NED"],"deleted":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease"]}}}},"outcome_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]}}},"adverse_events":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]}}}},"created":{},"deleted":{"response_to_treatment_criteria_method":{"changeType":"deleted","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}}}},"chemotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"dependsOn":{"left":"chemotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"dependsOn":{"left":"chemotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"chemotherapy_dosage_units":{"changeType":"created","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate the total actual drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true,"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"deleted","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"hormone_drug_dosage_units":{"changeType":"created","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true,"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"deleted","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"radiation":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{"radiation_boost":{"changeType":"deleted","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"deleted","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}}},"immunotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"dependsOn":{"left":"immunotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"dependsOn":{"left":"immunotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"},"displayName":{"left":"Chemotherapy Drug Name","right":"Immunotherapy Drug Name"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"deleted","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"surgery":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"surgery_type":{"restrictions":{"codeList":{"left":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"],"right":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"],"data":{"added":[],"deleted":["Hemithyroidectomy","Near-total thyroidectomy","Subtotal thyroidectomy","Total thyroidectomy"]}}}}},"created":{},"deleted":{}},"follow_up":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_follow_up_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"interval_of_followup":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"treatment.submitter_treatment_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"relapse_type":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"]}}},"relapse_interval":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"method_of_progression_status":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"]}}},"anatomic_site_progression_or_recurrence":{"description":{"left":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","right":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344."},"meta":{"examples":{"left":"C50.1|C18","right":"C50.1,C18"},"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["Revised International staging system (R-ISS)"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"]}}},"recurrence_t_category":{"meta":{"core":{"left":null,"right":true}}},"recurrence_n_category":{"meta":{"core":{"left":null,"right":true}}},"recurrence_m_category":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX"],"data":{"added":[],"deleted":["Not applicable"]}}}},"recurrence_stage_group":{"meta":{"core":{"left":null,"right":true}}},"posttherapy_tumour_staging_system":{"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["Revised International staging system (R-ISS)"]}}}},"posttherapy_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX"],"data":{"added":[],"deleted":["Not applicable"]}}}}},"created":{},"deleted":{}},"exposure":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"family_history":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"family_relative_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"biomarker":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"treatment.submitter_treatment_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_follow_up_id":{"meta":{"foreignKey":{"left":"follow_up.submitter_follow_up_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"test_interval":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}}},"created":{},"deleted":{}},"comorbidity":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}}}} diff --git a/website/static/data/schemas/diffs/1.24/1.24-diff-1.15.json b/website/static/data/schemas/diffs/1.24/1.24-diff-1.15.json new file mode 100644 index 00000000..a8cd910d --- /dev/null +++ b/website/static/data/schemas/diffs/1.24/1.24-diff-1.15.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":[],"deleted":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"]}}}},"submitter_sample_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"primary_site":{"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva"],"data":{"added":[],"deleted":["Unknown primary site"]}}}}},"created":{},"deleted":{"lost_to_followup_after_clinical_event_id":{"changeType":"deleted","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}}},"specimen":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"pathological_tumour_staging_system":{"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["Revised International staging system (R-ISS)"]}}}},"pathological_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX"],"data":{"added":[],"deleted":["Not applicable"]}}}},"specimen_acquisition_interval":{"restrictions":{"range":{"left":null,"right":{"min":0}}}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"percent_tumour_cells":{"restrictions":{"script":{"left":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"],"right":null}}}},"created":{},"deleted":{"percent_tumour_cells_measurement_method":{"changeType":"deleted","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"clinical_tumour_staging_system":{"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["Revised International staging system (R-ISS)"]}}}},"clinical_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX"],"data":{"added":[],"deleted":["Not applicable"]}}}}},"created":{},"deleted":{"lymph_nodes_examined_method":{"changeType":"deleted","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}}},"treatment":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":[],"deleted":["End of life care"]}}}},"is_primary_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Yes","No"],"right":["Yes","No","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"line_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'unknown') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'unknown'.`};\n }\n }\n return result;\n })"]}}},"treatment_start_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"treatment_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]}}},"days_per_cycle":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]}}},"number_of_cycles":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_intent":{"description":{"left":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","right":"Indicate the intended disease outcome for which the treatment is given. (Reference: NCIt C124307)"},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"],"right":["Curative","Palliative","Unknown"],"data":{"added":["Unknown"],"deleted":["Diagnostic","Forensic","Guidance","Preventative","Screening","Supportive"]}}}},"treatment_setting":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"],"right":["Adjuvant","Advanced/Metastatic","Neoadjuvant","Not applicable"],"data":{"added":["Not applicable"],"deleted":["Conditioning","Induction","Maintenance","Mobilization","Preventative","Radiosensitization","Salvage"]}}}},"response_to_treatment":{"description":{"left":"The donor's response to the applied treatment regimen.","right":"The donor's response to the applied treatment regimen. (Source: RECIST)"},"meta":{"dependsOn":{"left":"treatment.response_to_treatment_criteria_method","right":"treatment.treatment_type"},"notes":{"left":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"],"right":["Complete response","Disease progression","NED","Partial response","Stable disease"],"data":{"added":["Disease progression","NED"],"deleted":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease"]}}}},"outcome_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]}}},"adverse_events":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]}}}},"created":{},"deleted":{"response_to_treatment_criteria_method":{"changeType":"deleted","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}}}},"chemotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"dependsOn":{"left":"chemotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"dependsOn":{"left":"chemotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"chemotherapy_dosage_units":{"changeType":"created","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate the total actual drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true,"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"deleted","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"hormone_drug_dosage_units":{"changeType":"created","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true,"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"deleted","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"radiation":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{"radiation_boost":{"changeType":"deleted","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"deleted","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}}},"immunotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"dependsOn":{"left":"immunotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"dependsOn":{"left":"immunotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"},"displayName":{"left":"Chemotherapy Drug Name","right":"Immunotherapy Drug Name"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"deleted","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"surgery":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"follow_up":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_follow_up_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"interval_of_followup":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"treatment.submitter_treatment_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"relapse_type":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"]}}},"relapse_interval":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"method_of_progression_status":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"]}}},"anatomic_site_progression_or_recurrence":{"description":{"left":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","right":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344."},"meta":{"examples":{"left":"C50.1|C18","right":"C50.1,C18"},"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["Revised International staging system (R-ISS)"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"]}}},"recurrence_t_category":{"meta":{"core":{"left":null,"right":true}}},"recurrence_n_category":{"meta":{"core":{"left":null,"right":true}}},"recurrence_m_category":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX"],"data":{"added":[],"deleted":["Not applicable"]}}}},"recurrence_stage_group":{"meta":{"core":{"left":null,"right":true}}},"posttherapy_tumour_staging_system":{"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["Revised International staging system (R-ISS)"]}}}},"posttherapy_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX"],"data":{"added":[],"deleted":["Not applicable"]}}}}},"created":{},"deleted":{}},"exposure":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"family_history":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"family_relative_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"biomarker":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"treatment.submitter_treatment_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_follow_up_id":{"meta":{"foreignKey":{"left":"follow_up.submitter_follow_up_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"test_interval":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}}},"created":{},"deleted":{}},"comorbidity":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}}}} diff --git a/website/static/data/schemas/diffs/1.24/1.24-diff-1.16.json b/website/static/data/schemas/diffs/1.24/1.24-diff-1.16.json new file mode 100644 index 00000000..19ded27b --- /dev/null +++ b/website/static/data/schemas/diffs/1.24/1.24-diff-1.16.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":[],"deleted":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"]}}}},"submitter_sample_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{"lost_to_followup_after_clinical_event_id":{"changeType":"deleted","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}}},"specimen":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"specimen_acquisition_interval":{"restrictions":{"range":{"left":null,"right":{"min":0}}}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"percent_tumour_cells":{"restrictions":{"script":{"left":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"],"right":null}}}},"created":{},"deleted":{"percent_tumour_cells_measurement_method":{"changeType":"deleted","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"lymph_nodes_examined_method":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable'];\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n return result;\n})"]}}}},"created":{},"deleted":{}},"treatment":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":[],"deleted":["End of life care"]}}}},"is_primary_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}},"treatment_start_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"treatment_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}},"days_per_cycle":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}},"number_of_cycles":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}},"treatment_intent":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}},"treatment_setting":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}},"response_to_treatment_criteria_method":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}},"response_to_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"]},"codeList":{"left":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"],"right":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed stable disease","Progressive disease","Stable disease"],"data":{"added":[],"deleted":["Physician assessed progressive disease"]}}}},"outcome_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}},"adverse_events":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}}},"created":{},"deleted":{}},"chemotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"dependsOn":{"left":"chemotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"dependsOn":{"left":"chemotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"chemotherapy_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"data":{"added":[],"deleted":["mg"]}}}},"prescribed_cumulative_drug_dose":{"meta":{"validationDependency":{"left":true,"right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"]}}},"actual_cumulative_drug_dose":{"meta":{"validationDependency":{"left":true,"right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"]}}}},"created":{},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"hormone_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"data":{"added":[],"deleted":["mg"]}}}}},"created":{},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"radiation":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{"radiation_boost":{"changeType":"deleted","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"deleted","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}}},"immunotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"dependsOn":{"left":"immunotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"dependsOn":{"left":"immunotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"},"displayName":{"left":"Chemotherapy Drug Name","right":"Immunotherapy Drug Name"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"immunotherapy_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"data":{"added":[],"deleted":["mg"]}}}}},"created":{},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"surgery":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"follow_up":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_follow_up_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"interval_of_followup":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"relapse_interval":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"anatomic_site_progression_or_recurrence":{"description":{"left":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","right":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344."},"meta":{"examples":{"left":"C50.1|C18","right":"C50.1,C18"},"notes":{"left":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file.","right":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}}}},"created":{},"deleted":{}},"exposure":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"family_history":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"family_relative_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"biomarker":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_follow_up_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"test_interval":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}}},"created":{},"deleted":{}},"comorbidity":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}}}} diff --git a/website/static/data/schemas/diffs/1.24/1.24-diff-1.17.json b/website/static/data/schemas/diffs/1.24/1.24-diff-1.17.json new file mode 100644 index 00000000..0d7fb04b --- /dev/null +++ b/website/static/data/schemas/diffs/1.24/1.24-diff-1.17.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":[],"deleted":["Cell line - derived from metastatic tumour","Xenograft - derived from metastatic tumour"]}}}},"submitter_sample_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{"lost_to_followup_after_clinical_event_id":{"changeType":"deleted","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}}},"specimen":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"specimen_acquisition_interval":{"restrictions":{"range":{"left":null,"right":{"min":0}}}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"percent_tumour_cells":{"restrictions":{"script":{"left":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"],"right":null}}}},"created":{},"deleted":{}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"lymph_nodes_examined_method":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"]}}}},"created":{},"deleted":{}},"treatment":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":[],"deleted":["End of life care"]}}}},"is_primary_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}},"treatment_start_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"treatment_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}},"days_per_cycle":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}},"number_of_cycles":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}},"treatment_intent":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}},"treatment_setting":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}},"response_to_treatment_criteria_method":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}},"response_to_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"]},"codeList":{"left":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"],"right":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed stable disease","Progressive disease","Stable disease"],"data":{"added":[],"deleted":["Physician assessed progressive disease"]}}}},"outcome_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}},"adverse_events":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}}},"created":{},"deleted":{}},"chemotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"dependsOn":{"left":"chemotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"dependsOn":{"left":"chemotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"chemotherapy_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"data":{"added":[],"deleted":["mg"]}}}},"prescribed_cumulative_drug_dose":{"meta":{"validationDependency":{"left":true,"right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"]}}},"actual_cumulative_drug_dose":{"meta":{"validationDependency":{"left":true,"right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"]}}}},"created":{},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"hormone_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"data":{"added":[],"deleted":["mg"]}}}}},"created":{},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"radiation":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{"radiation_boost":{"changeType":"deleted","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"deleted","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}}},"immunotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"dependsOn":{"left":"immunotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"dependsOn":{"left":"immunotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"},"displayName":{"left":"Chemotherapy Drug Name","right":"Immunotherapy Drug Name"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"immunotherapy_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"data":{"added":[],"deleted":["mg"]}}}}},"created":{},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"surgery":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"follow_up":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_follow_up_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"interval_of_followup":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"relapse_interval":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}}},"created":{},"deleted":{}},"exposure":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"family_history":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"family_relative_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"biomarker":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_follow_up_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"test_interval":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}}},"created":{},"deleted":{}},"comorbidity":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}}}} diff --git a/website/static/data/schemas/diffs/1.24/1.24-diff-1.18.json b/website/static/data/schemas/diffs/1.24/1.24-diff-1.18.json new file mode 100644 index 00000000..c430a039 --- /dev/null +++ b/website/static/data/schemas/diffs/1.24/1.24-diff-1.18.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":[],"deleted":["Cell line - derived from metastatic tumour","Xenograft - derived from metastatic tumour"]}}}},"submitter_sample_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{"lost_to_followup_after_clinical_event_id":{"changeType":"deleted","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}}},"specimen":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"specimen_acquisition_interval":{"restrictions":{"range":{"left":null,"right":{"min":0}}}},"percent_tumour_cells":{"restrictions":{"script":{"left":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"],"right":null}}}},"created":{},"deleted":{}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"treatment":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":[],"deleted":["End of life care"]}}}},"is_primary_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}},"treatment_start_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"treatment_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}},"days_per_cycle":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}},"number_of_cycles":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}},"treatment_intent":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}},"treatment_setting":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}},"response_to_treatment_criteria_method":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}},"response_to_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"]},"codeList":{"left":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"],"right":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed stable disease","Progressive disease","Stable disease"],"data":{"added":[],"deleted":["Physician assessed progressive disease"]}}}},"outcome_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}},"adverse_events":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}}},"created":{},"deleted":{}},"chemotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"dependsOn":{"left":"chemotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"dependsOn":{"left":"chemotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"chemotherapy_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"data":{"added":[],"deleted":["mg"]}}}}},"created":{},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"hormone_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"data":{"added":[],"deleted":["mg"]}}}}},"created":{},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"radiation":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{"radiation_boost":{"changeType":"deleted","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"deleted","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}}},"immunotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"dependsOn":{"left":"immunotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"dependsOn":{"left":"immunotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"},"displayName":{"left":"Chemotherapy Drug Name","right":"Immunotherapy Drug Name"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"immunotherapy_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"data":{"added":[],"deleted":["mg"]}}}}},"created":{},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"surgery":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"follow_up":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_follow_up_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"interval_of_followup":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"relapse_interval":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}}},"created":{},"deleted":{}},"exposure":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"family_history":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"family_relative_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"biomarker":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_follow_up_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"test_interval":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}}},"created":{},"deleted":{}},"comorbidity":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}}}} diff --git a/website/static/data/schemas/diffs/1.24/1.24-diff-1.19.json b/website/static/data/schemas/diffs/1.24/1.24-diff-1.19.json new file mode 100644 index 00000000..2a1a5fcf --- /dev/null +++ b/website/static/data/schemas/diffs/1.24/1.24-diff-1.19.json @@ -0,0 +1 @@ +{"schemas":{"specimen":{"updated":{"specimen_acquisition_interval":{"restrictions":{"range":{"left":null,"right":{"min":0}}}},"percent_tumour_cells":{"restrictions":{"script":{"left":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"],"right":null}}}},"created":{},"deleted":{}},"treatment":{"updated":{"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":[],"deleted":["End of life care"]}}}},"is_primary_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}},"treatment_start_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"treatment_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}},"days_per_cycle":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}},"number_of_cycles":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}},"treatment_intent":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}},"treatment_setting":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}},"response_to_treatment_criteria_method":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}},"response_to_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"]}}},"outcome_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}},"adverse_events":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['treatment_start_interval', 'treatment_duration', 'is_primary_treatment', 'treatment_intent', 'treatment_setting', 'response_to_treatment_criteria_method', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const treatmentType = ($row.treatment_type).map(value => value.toLowerCase());\n \n if (!treatmentType.includes(\"no treatment\") && coreFields.includes($name) && (!$field || $field === null || checkforEmpty($field))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentType}'`};\n }\n else if (treatmentType.includes(\"no treatment\") && ($field && $field != null && !(checkforEmpty($field)))) {\n if (coreFields.includes($name) || (typeof($field) === 'string' && $field.trim().toLowerCase() != 'not applicable') || typeof($field) === 'number') {\n result = { valid: false, message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentType}'`};\n }\n }\n return result;\n })"]}}}},"created":{},"deleted":{}},"chemotherapy":{"updated":{"drug_rxnormcui":{"meta":{"dependsOn":{"left":"chemotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"dependsOn":{"left":"chemotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"chemotherapy_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"data":{"added":[],"deleted":["mg"]}}}}},"created":{},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"hormone_therapy":{"updated":{"drug_rxnormcui":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"hormone_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"data":{"added":[],"deleted":["mg"]}}}}},"created":{},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"radiation":{"updated":{},"created":{},"deleted":{"radiation_boost":{"changeType":"deleted","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"deleted","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}}},"immunotherapy":{"updated":{"drug_rxnormcui":{"meta":{"dependsOn":{"left":"immunotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"dependsOn":{"left":"immunotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"},"displayName":{"left":"Chemotherapy Drug Name","right":"Immunotherapy Drug Name"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"immunotherapy_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"data":{"added":[],"deleted":["mg"]}}}}},"created":{},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"follow_up":{"updated":{"interval_of_followup":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"relapse_interval":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}}},"created":{},"deleted":{}},"biomarker":{"updated":{"test_interval":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}}},"created":{},"deleted":{}}}} diff --git a/website/static/data/schemas/diffs/1.24/1.24-diff-1.2.json b/website/static/data/schemas/diffs/1.24/1.24-diff-1.2.json new file mode 100644 index 00000000..bfb42c89 --- /dev/null +++ b/website/static/data/schemas/diffs/1.24/1.24-diff-1.2.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":[],"deleted":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n const row = $row;\n let result = {valid: true, message: \"Ok\"};\n \n const designation = row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\"){\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when tumour_normal_designation is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when tumour_normal_designation is set to Tumour.\"};\n }\n }\n return result;\n })"]}}},"submitter_sample_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased"],"right":["Alive","Deceased","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"cause_of_death":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })"]}}},"survival_time":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })"]},"range":{"left":{"exclusiveMin":0},"right":null}}},"primary_site":{"meta":{"notes":{"left":"To include multiple values, separate values with a pipe delimiter '|' within your file.","right":null},"examples":{"left":"Breast|Ovary","right":null}},"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Not Reported","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva","Unknown"],"data":{"added":["Not Reported","Unknown"],"deleted":["Unknown primary site"]}}}},"height":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"weight":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"bmi":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"menopause_status":{"description":{"left":"Indicate the donor's menopause status at the time of primary diagnosis. (Reference: caDSR CDE ID 2434914)","right":"Indicate the donor's menopause status at the time of primary diagnosis. (Codelist reference: NCI CDE ID: 2434914)"},"restrictions":{"codeList":{"left":["Not applicable","Perimenopausal","Postmenopausal","Premenopausal","Unknown"],"right":["Indeterminate or unknown","Not applicable","Perimenopausal","Postmenopausal","Premenopausal"],"data":{"added":["Indeterminate or unknown"],"deleted":["Unknown"]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)","right":"Indicate the donor's age of menarche, the first occurrence of menstruation."},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"number_of_pregnancies":{"description":{"left":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)","right":"Indicate the number of pregnancies a donor has had."},"restrictions":{"range":{"left":{"min":0},"right":null}}},"number_of_children":{"description":{"left":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)","right":"Indicate the number of children the donor has birthed."},"restrictions":{"range":{"left":{"min":0},"right":null}}}},"created":{"prior_malignancy":{"changeType":"created","description":"Prior malignancy affecting donor.","name":"prior_malignancy","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy","examples":"C41.1, C16.9, C00.5, D46.9"}},"cancer_type_prior_malignancy":{"changeType":"created","description":"The code to represent the cancer type of a prior malignancy using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","name":"cancer_type_prior_malignancy","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"valueType":"string","meta":{"displayName":"Cancer Type Prior Malignancy"}},"age_at_prior_malignancy":{"changeType":"created","description":"If donor has history of prior malignancy, indicate age at previous diagnosis, in years.","name":"age_at_prior_malignancy","valueType":"integer","meta":{"displayName":"Age at Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"created","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Codelist reference: NCI CDE: 4122391)","name":"laterality_of_prior_malignancy","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality at Prior Malignancy"}}},"deleted":{"genetic_disorders":{"changeType":"deleted","description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},"hrt_type":{"changeType":"deleted","description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},"hrt_duration":{"changeType":"deleted","description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},"contraception_type":{"changeType":"deleted","description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},"contraception_duration":{"changeType":"deleted","description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},"lost_to_followup_after_clinical_event_id":{"changeType":"deleted","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}}},"specimen":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null},"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"pathological_tumour_staging_system":{"meta":{"validationDependency":{"left":true,"right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"pathological_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"pathological_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"pathological_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.pathological_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.pathological_tumour_staging_system && $row.pathological_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'pathological_tumour_staging_system' is set to '${\n $row.pathological_tumour_staging_system\n }', 'pathological_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"data":{"added":[],"deleted":["Unknown"]}}}},"specimen_storage":{"description":{"left":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured.","right":"Indicate the method of specimen storage for specimens that were not extracted freshly or immediately cultured."},"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"data":{"added":[],"deleted":["Unknown"]}}}},"reference_pathology_confirmed":{"description":{"left":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)","right":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist."}},"tumour_grading_system":{"meta":{"validationDependency":{"left":true,"right":null}}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = \"'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.\";\n result.message = msg;\n }\n }\n return result;\n })"]}}},"percent_tumour_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)","right":"Indicate a value, in decimals, that represents the percentage of infiltration by tumour cells in a specimen."},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null},"script":{"left":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"],"right":null}}},"percent_proliferating_cells":{"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_inflammatory_tissue":{"description":{"left":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)","right":"Indicate a value, in decimals, that represents local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_stromal_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)","right":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a malignant tumour specimen but are not malignant such as fibroblasts, vascular structures, etc."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_necrosis":{"description":{"left":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)","right":"Indicate a value, in decimals, that represents the percentage of cell death in a malignant tumour specimen."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":"This field is only required if the specimen is a tumour."},"core":{"left":null,"right":true}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}}},"created":{},"deleted":{"specimen_laterality":{"changeType":"deleted","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"percent_tumour_cells_measurement_method":{"changeType":"deleted","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"age_at_diagnosis":{"restrictions":{"range":{"left":{"exclusiveMin":0,"max":90},"right":null}}},"number_lymph_nodes_examined":{"description":{"left":"The total number of lymph nodes tested for the presence of cancer. (Reference: caDSR CDE ID 3)","right":"The total number of lymph nodes tested for the presence of cancer. (Reference: NCI CDE ID: 3)"},"meta":{"dependsOn":{"left":"primary_diagnosis.lymph_nodes_examined_status","right":null},"notes":{"left":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":null},"range":{"left":{"min":0},"right":null}}},"number_lymph_nodes_positive":{"description":{"left":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: caDSR CDE ID 6113694)","right":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: NCI CDE ID: 6113694)"},"meta":{"dependsOn":{"left":"primary_diagnosis.lymph_nodes_examined_status","right":null},"notes":{"left":"This field is only required if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":null},"range":{"left":{"min":0},"right":null},"required":{"left":null,"right":true}}},"clinical_tumour_staging_system":{"meta":{"validationDependency":{"left":true,"right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}},"required":{"left":null,"right":true}}},"clinical_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"clinical_n_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null}}},"clinical_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"clinical_stage_group":{"description":{"left":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage.","right":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.)."},"meta":{"examples":{"left":"Stage I, Stage IIB","right":null}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.clinical_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'clinical_tumour_staging_system' is set to '${\n $row.clinical_tumour_staging_system\n }', 'clinical_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })"]},"required":{"left":null,"right":true}}},"presenting_symptoms":{"restrictions":{"codeList":{"left":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Loss of Appetite","Nausea","None","Not Reported","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Swelling in the Neck","Unknown","Vomiting","Weight Loss"],"right":["Abdominal Pain","Anemia","Back Pain","Bloating","Cholangitis","Constipation","Dark Urine","Decreased Appetite","Diabetes","Diarrhea","Fatigue","Fever","Hypoglycemia","Jaundice","Loss of Appetite","Nausea","None","Pale Stools","Pancreatitis","Pruritus/Itchiness","Steatorrhea","Unknown","Vomiting","Weight Loss"],"data":{"added":[],"deleted":["Not Reported","Swelling in the Neck"]}}}},"performance_status":{"description":{"left":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status).","right":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference source: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status)."},"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"data":{"added":[],"deleted":["Unknown"]}}}}},"created":{},"deleted":{"laterality":{"changeType":"deleted","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_status":{"changeType":"deleted","name":"lymph_nodes_examined_status","description":"Indicate if lymph nodes were examined for metastases.","valueType":"string","restrictions":{"required":true,"codeList":["Cannot be determined","No","No lymph nodes found in resected specimen","Not applicable","Yes"]},"meta":{"core":true,"displayName":"Lymph Nodes Examined Status"}},"lymph_nodes_examined_method":{"changeType":"deleted","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}}},"treatment":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null},"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":[],"deleted":["End of life care"]}}}},"is_primary_treatment":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"codeList":{"left":["Yes","No"],"right":["Yes","No","Unknown"],"data":{"added":["Unknown"],"deleted":[]}},"required":{"left":null,"right":true}}},"line_of_treatment":{"meta":{"dependsOn":{"left":"treatment.is_primary_treatment","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"],"right":null}}},"treatment_start_interval":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"treatment_duration":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null},"required":{"left":null,"right":true}}},"days_per_cycle":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null}}},"number_of_cycles":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null}}},"treatment_intent":{"description":{"left":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","right":"Indicate the intended disease outcome for which the treatment is given. (Reference: CDISC [NCIt code: C124307])"},"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"codeList":{"left":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"],"right":["Curative","Palliative","Unknown"],"data":{"added":["Unknown"],"deleted":["Diagnostic","Forensic","Guidance","Preventative","Screening","Supportive"]}},"required":{"left":null,"right":true}}},"treatment_setting":{"description":{"left":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: NCIt C124308)","right":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: CDISC [NCIt code: C124308])"},"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"codeList":{"left":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"],"right":["Adjuvant","Advanced/Metastatic","Neoadjuvant","Not applicable"],"data":{"added":["Not applicable"],"deleted":["Conditioning","Induction","Maintenance","Mobilization","Preventative","Radiosensitization","Salvage"]}},"required":{"left":null,"right":true}}},"response_to_treatment":{"description":{"left":"The donor's response to the applied treatment regimen.","right":"The donor's response to the applied treatment regimen. (Source: RECIST)"},"meta":{"dependsOn":{"left":"treatment.response_to_treatment_criteria_method","right":null},"notes":{"left":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"right":null},"codeList":{"left":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"],"right":["Complete response","Disease progression","NED","Partial response","Stable disease"],"data":{"added":["Disease progression","NED"],"deleted":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease"]}},"required":{"left":null,"right":true}}},"outcome_of_treatment":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null}}},"toxicity_type":{"description":{"left":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity.","right":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hemotological toxicity or non-hemotological toxicity."},"meta":{"dependsOn":{"left":"treatment.outcome_of_treatment","right":null}},"restrictions":{"codeList":{"left":["Hematological","Non-hematological","Not applicable","Unknown"],"right":["Hemotological","Non-hemotological"],"data":{"added":["Hemotological","Non-hemotological"],"deleted":["Hematological","Non-hematological","Not applicable","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"],"right":null}}},"adverse_events":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"codeList":{"left":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"right":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"data":{"added":[],"deleted":["None","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null}}},"clinical_trials_database":{"meta":{"notes":{"left":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added.","right":null}},"restrictions":{"codeList":{"left":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"],"right":["NCI Clinical Trials","EU Clinical Trials Register"],"data":{"added":[],"deleted":["Not applicable","Unknown"]}}}},"clinical_trial_number":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: 'The submitted NCI clinical trial number is in incorrect format.'};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: \"The submitted EudraCT clinical trial number is in incorrect format.\"};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: \"The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database.\"};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: \"'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.\"};\n } \n }\n return result;\n })"]}}}},"created":{"age_at_consent_for_treatment":{"changeType":"created","name":"age_at_consent_for_treatment","description":"Indicate the age of donor when consent was given for treatment.","valueType":"integer","meta":{"displayName":"Age At Consent For Treatment"}},"hemotological_toxicity":{"changeType":"created","name":"hemotological_toxicity","description":"Indicate the hemotological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5"]},"meta":{"displayName":"Hemotological Toxicity","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"response_to_treatment_criteria_method":{"changeType":"deleted","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},"hematological_toxicity":{"changeType":"deleted","name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"non-hematological_toxicity":{"changeType":"deleted","name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"chemotherapy":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"dependsOn":{"left":"chemotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"description":{"left":"Name of agent or drug administered to donor as part of the treatment regimen.","right":"Name of agent or drug administered to patient as part of the treatment regimen."},"meta":{"dependsOn":{"left":"chemotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"chemotherapy_dosage_units":{"changeType":"created","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate the total drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"deleted","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"deleted","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"deleted","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"deleted","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"description":{"left":"Name of agent or drug administered to donor as part of the treatment regimen.","right":"Name of agent or drug administered to patient as part of the treatment regimen."},"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"hormone_drug_dosage_units":{"changeType":"created","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"deleted","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"radiation":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"radiation_therapy_fractions":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"radiation_therapy_dosage":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"anatomical_site_irradiated":{"description":{"left":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)","right":"Indicate localization site where radiation therapy was administered."},"restrictions":{"codeList":{"left":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"right":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"data":{"added":["Bone","Extremities","Head-Neck","Peritoneum"],"deleted":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"]}}}}},"created":{},"deleted":{"radiation_boost":{"changeType":"deleted","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"deleted","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}}},"immunotherapy":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"immunotherapy_type":{"changeType":"deleted","name":"immunotherapy_type","valueType":"string","description":"Indicate the type of immunotherapy administered to donor.","meta":{"displayName":"Immunotherapy Type","core":true},"restrictions":{"required":true,"codeList":["Cell-based","Immune checkpoint inhibitors","Monoclonal antibodies other than immune checkpoint inhibitors","Other immunomodulatory substances"]}},"drug_rxnormcui":{"changeType":"deleted","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"deleted","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"deleted","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"surgery":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"deleted","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"deleted","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"deleted","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"deleted","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"deleted","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"deleted","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"deleted","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"deleted","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"deleted","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"deleted","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"deleted","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"deleted","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"deleted","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"deleted","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}}},"follow_up":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_follow_up_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null},"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"treatment.submitter_treatment_id","right":null},"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"weight_at_followup":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"relapse_type":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })"]}}},"relapse_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `'${$name}' cannot be greater than the 'interval_of_followup'.` }\n }\n }\n return result;\n })"]}}},"method_of_progression_status":{"description":{"left":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Reference: caDSR CDE ID 6161031)","right":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Codelist reference: NCI CDE ID: 6161031)"},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })"]}}},"recurrence_t_category":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"recurrence_n_category":{"meta":{"core":{"left":null,"right":true}}},"recurrence_m_category":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"recurrence_stage_group":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.recurrence_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.recurrence_tumour_staging_system && $row.recurrence_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'recurrence_tumour_staging_system' is set to '${\n $row.recurrence_tumour_staging_system\n }', 'recurrence_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"posttherapy_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"posttherapy_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"posttherapy_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"posttherapy_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.posttherapy_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.posttherapy_tumour_staging_system && $row.posttherapy_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'posttherapy_tumour_staging_system' is set to '${\n $row.posttherapy_tumour_staging_system\n }', 'posttherapy_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })"]}}}},"created":{"anatomic_site_progression_or_recurrences":{"changeType":"created","description":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1,C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}}},"deleted":{"anatomic_site_progression_or_recurrence":{"changeType":"deleted","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"exposure":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"deleted","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"deleted","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"deleted","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"deleted","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"deleted","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"deleted","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"deleted","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"deleted","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"deleted","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"deleted","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"deleted","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}}},"family_history":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"family_relative_id":{"changeType":"deleted","description":"Unique identifier of the relative, assigned by the data provider.","name":"family_relative_id","valueType":"string","meta":{"displayName":"Family Relative ID","primaryId":true,"notes":"This field is required to ensure that family members are identified in unique records. Ids can be as simple as an incremented numeral to ensure uniqueness."},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"relative_with_cancer_history":{"changeType":"deleted","description":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","name":"relative_with_cancer_history","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Relative with Cancer History"}},"relationship_type":{"changeType":"deleted","description":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","name":"relationship_type","restrictions":{"codeList":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"]},"valueType":"string","meta":{"displayName":"Relationship Type"}},"gender_of_relative":{"changeType":"deleted","description":"The self-reported gender of related individual.","name":"gender_of_relative","restrictions":{"codeList":["Female","Male","Other","Unknown"]},"valueType":"string","meta":{"displayName":"Gender of Relative"}},"age_of_relative_at_diagnosis":{"changeType":"deleted","description":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","name":"age_of_relative_at_diagnosis","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","displayName":"Age Of Relative At Diagnosis"}},"cancer_type_code_of_relative":{"changeType":"deleted","name":"cancer_type_code_of_relative","valueType":"string","description":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"examples":"C41.1,C16.9,C00.5,D46.9","dependsOn":"family_history.relative_with_cancer_history","displayName":"Cancer Type Code (ICD-10) of Relative"}},"relative_vital_status":{"changeType":"deleted","description":"Relative's last known state of living or deceased.","name":"relative_vital_status","restrictions":{"codeList":["Alive","Deceased","Unknown"]},"valueType":"string","meta":{"displayName":"Vital Status of Relative"}},"cause_of_death_of_relative":{"changeType":"deleted","description":"Indicate the cause of the death of the relative.","name":"cause_of_death_of_relative","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]},"valueType":"string","meta":{"dependsOn":"family_history.relative_vital_status","displayName":"Cause of Death of Relative"}},"relative_survival_time":{"changeType":"deleted","description":"Indicate how long, in days, the relative survived from the time they were diagnosed with cancer.","name":"relative_survival_time","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","units":"days","displayName":"Survival Time Of Relative"}}}},"biomarker":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"deleted","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"deleted","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"deleted","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"deleted","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"deleted","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"deleted","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"deleted","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"deleted","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"deleted","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"deleted","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"deleted","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"deleted","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"deleted","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"deleted","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"deleted","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"deleted","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}}},"comorbidity":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"deleted","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"deleted","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"deleted","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"deleted","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"deleted","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"deleted","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}}}}} diff --git a/website/static/data/schemas/diffs/1.24/1.24-diff-1.20.json b/website/static/data/schemas/diffs/1.24/1.24-diff-1.20.json new file mode 100644 index 00000000..6f6f97a7 --- /dev/null +++ b/website/static/data/schemas/diffs/1.24/1.24-diff-1.20.json @@ -0,0 +1 @@ +{"schemas":{"specimen":{"updated":{"specimen_acquisition_interval":{"restrictions":{"range":{"left":null,"right":{"min":0}}}},"percent_tumour_cells":{"restrictions":{"script":{"left":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"],"right":null}}}},"created":{},"deleted":{}},"treatment":{"updated":{"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":[],"deleted":["End of life care"]}}}},"treatment_start_interval":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}}},"created":{},"deleted":{}},"chemotherapy":{"updated":{"drug_rxnormcui":{"meta":{"dependsOn":{"left":"chemotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"dependsOn":{"left":"chemotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"chemotherapy_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"data":{"added":[],"deleted":["mg"]}}}}},"created":{},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"hormone_therapy":{"updated":{"drug_rxnormcui":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"hormone_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"data":{"added":[],"deleted":["mg"]}}}}},"created":{},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"radiation":{"updated":{},"created":{},"deleted":{"radiation_boost":{"changeType":"deleted","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"deleted","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}}},"immunotherapy":{"updated":{"drug_rxnormcui":{"meta":{"dependsOn":{"left":"immunotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"dependsOn":{"left":"immunotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"},"displayName":{"left":"Chemotherapy Drug Name","right":"Immunotherapy Drug Name"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"immunotherapy_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"data":{"added":[],"deleted":["mg"]}}}}},"created":{},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"follow_up":{"updated":{"interval_of_followup":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"relapse_interval":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}}},"created":{},"deleted":{}},"biomarker":{"updated":{"test_interval":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}}},"created":{},"deleted":{}}}} diff --git a/website/static/data/schemas/diffs/1.24/1.24-diff-1.21.json b/website/static/data/schemas/diffs/1.24/1.24-diff-1.21.json new file mode 100644 index 00000000..e48b5d12 --- /dev/null +++ b/website/static/data/schemas/diffs/1.24/1.24-diff-1.21.json @@ -0,0 +1 @@ +{"schemas":{"specimen":{"updated":{"specimen_acquisition_interval":{"restrictions":{"range":{"left":null,"right":{"min":0}}}}},"created":{},"deleted":{}},"treatment":{"updated":{"treatment_start_interval":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}}},"created":{},"deleted":{}},"chemotherapy":{"updated":{"drug_rxnormcui":{"meta":{"dependsOn":{"left":"chemotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"dependsOn":{"left":"chemotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"chemotherapy_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"data":{"added":[],"deleted":["mg"]}}}}},"created":{},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"hormone_therapy":{"updated":{"drug_rxnormcui":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"hormone_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"data":{"added":[],"deleted":["mg"]}}}}},"created":{},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"radiation":{"updated":{},"created":{},"deleted":{"radiation_boost":{"changeType":"deleted","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"deleted","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}}},"immunotherapy":{"updated":{"drug_rxnormcui":{"meta":{"dependsOn":{"left":"immunotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"dependsOn":{"left":"immunotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"},"displayName":{"left":"Chemotherapy Drug Name","right":"Immunotherapy Drug Name"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"immunotherapy_drug_dose_units":{"restrictions":{"codeList":{"left":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"],"right":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"],"data":{"added":[],"deleted":["mg"]}}}}},"created":{},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"follow_up":{"updated":{"interval_of_followup":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"relapse_interval":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}}},"created":{},"deleted":{}},"biomarker":{"updated":{"test_interval":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}}},"created":{},"deleted":{}}}} diff --git a/website/static/data/schemas/diffs/1.24/1.24-diff-1.22.json b/website/static/data/schemas/diffs/1.24/1.24-diff-1.22.json new file mode 100644 index 00000000..6a2284e9 --- /dev/null +++ b/website/static/data/schemas/diffs/1.24/1.24-diff-1.22.json @@ -0,0 +1 @@ +{"schemas":{"specimen":{"updated":{"specimen_acquisition_interval":{"restrictions":{"range":{"left":null,"right":{"min":0}}}}},"created":{},"deleted":{}},"treatment":{"updated":{"treatment_start_interval":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}}},"created":{},"deleted":{}},"chemotherapy":{"updated":{"drug_rxnormcui":{"meta":{"dependsOn":{"left":"chemotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"dependsOn":{"left":"chemotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"hormone_therapy":{"updated":{"drug_rxnormcui":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"radiation":{"updated":{},"created":{},"deleted":{"radiation_boost":{"changeType":"deleted","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"deleted","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}}},"immunotherapy":{"updated":{"drug_rxnormcui":{"meta":{"dependsOn":{"left":"immunotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"dependsOn":{"left":"immunotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"},"displayName":{"left":"Chemotherapy Drug Name","right":"Immunotherapy Drug Name"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"follow_up":{"updated":{"interval_of_followup":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"relapse_interval":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}}},"created":{},"deleted":{}},"biomarker":{"updated":{"test_interval":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}}},"created":{},"deleted":{}}}} diff --git a/website/static/data/schemas/diffs/1.24/1.24-diff-1.23.json b/website/static/data/schemas/diffs/1.24/1.24-diff-1.23.json new file mode 100644 index 00000000..a94ac2bb --- /dev/null +++ b/website/static/data/schemas/diffs/1.24/1.24-diff-1.23.json @@ -0,0 +1 @@ +{"schemas":{"treatment":{"updated":{"treatment_start_interval":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}}},"created":{},"deleted":{}},"chemotherapy":{"updated":{"drug_rxnormcui":{"meta":{"dependsOn":{"left":"chemotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"dependsOn":{"left":"chemotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"hormone_therapy":{"updated":{"drug_rxnormcui":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"immunotherapy":{"updated":{"drug_rxnormcui":{"meta":{"dependsOn":{"left":"immunotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"dependsOn":{"left":"immunotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"},"displayName":{"left":"Chemotherapy Drug Name","right":"Immunotherapy Drug Name"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"follow_up":{"updated":{"interval_of_followup":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"relapse_interval":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}}},"created":{},"deleted":{}},"biomarker":{"updated":{"test_interval":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}}},"created":{},"deleted":{}}}} diff --git a/website/static/data/schemas/diffs/1.24/1.24-diff-1.3.json b/website/static/data/schemas/diffs/1.24/1.24-diff-1.3.json new file mode 100644 index 00000000..bf3fa9e8 --- /dev/null +++ b/website/static/data/schemas/diffs/1.24/1.24-diff-1.3.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":[],"deleted":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n const row = $row;\n let result = {valid: true, message: \"Ok\"};\n \n const designation = row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\"){\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when tumour_normal_designation is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when tumour_normal_designation is set to Tumour.\"};\n }\n }\n return result;\n })"]}}},"submitter_sample_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased"],"right":["Alive","Deceased","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"cause_of_death":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })"]}}},"survival_time":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })"]},"range":{"left":{"exclusiveMin":0},"right":null}}},"primary_site":{"meta":{"notes":{"left":"To include multiple values, separate values with a pipe delimiter '|' within your file.","right":null},"examples":{"left":"Breast|Ovary","right":null}},"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Not Reported","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva","Unknown"],"data":{"added":["Not Reported","Unknown"],"deleted":["Unknown primary site"]}}}},"height":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"weight":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"bmi":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"menopause_status":{"description":{"left":"Indicate the donor's menopause status at the time of primary diagnosis. (Reference: caDSR CDE ID 2434914)","right":"Indicate the donor's menopause status at the time of primary diagnosis. (Codelist reference: NCI CDE ID: 2434914)"},"restrictions":{"codeList":{"left":["Not applicable","Perimenopausal","Postmenopausal","Premenopausal","Unknown"],"right":["Indeterminate or unknown","Not applicable","Perimenopausal","Postmenopausal","Premenopausal"],"data":{"added":["Indeterminate or unknown"],"deleted":["Unknown"]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)","right":"Indicate the donor's age of menarche, the first occurrence of menstruation."},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"number_of_pregnancies":{"description":{"left":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)","right":"Indicate the number of pregnancies a donor has had."},"restrictions":{"range":{"left":{"min":0},"right":null}}},"number_of_children":{"description":{"left":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)","right":"Indicate the number of children the donor has birthed."},"restrictions":{"range":{"left":{"min":0},"right":null}}}},"created":{"prior_malignancy":{"changeType":"created","description":"Prior malignancy affecting donor.","name":"prior_malignancy","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy","examples":"C41.1, C16.9, C00.5, D46.9"}},"cancer_type_prior_malignancy":{"changeType":"created","description":"The code to represent the cancer type of a prior malignancy using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","name":"cancer_type_prior_malignancy","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"valueType":"string","meta":{"displayName":"Cancer Type Prior Malignancy"}},"age_at_prior_malignancy":{"changeType":"created","description":"If donor has history of prior malignancy, indicate age at previous diagnosis, in years.","name":"age_at_prior_malignancy","valueType":"integer","meta":{"displayName":"Age at Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"created","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Codelist reference: NCI CDE: 4122391)","name":"laterality_of_prior_malignancy","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality at Prior Malignancy"}}},"deleted":{"genetic_disorders":{"changeType":"deleted","description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},"hrt_type":{"changeType":"deleted","description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},"hrt_duration":{"changeType":"deleted","description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},"contraception_type":{"changeType":"deleted","description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},"contraception_duration":{"changeType":"deleted","description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},"lost_to_followup_after_clinical_event_id":{"changeType":"deleted","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}}},"specimen":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null},"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"pathological_tumour_staging_system":{"meta":{"validationDependency":{"left":true,"right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"pathological_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"pathological_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"pathological_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.pathological_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.pathological_tumour_staging_system && $row.pathological_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'pathological_tumour_staging_system' is set to '${\n $row.pathological_tumour_staging_system\n }', 'pathological_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"data":{"added":[],"deleted":["Unknown"]}}}},"specimen_storage":{"description":{"left":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured.","right":"Indicate the method of specimen storage for specimens that were not extracted freshly or immediately cultured."},"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"data":{"added":[],"deleted":["Unknown"]}}}},"reference_pathology_confirmed":{"description":{"left":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)","right":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist."}},"tumour_grading_system":{"meta":{"validationDependency":{"left":true,"right":null}}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = \"'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.\";\n result.message = msg;\n }\n }\n return result;\n })"]}}},"percent_tumour_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)","right":"Indicate a value, in decimals, that represents the percentage of infiltration by tumour cells in a specimen."},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null},"script":{"left":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"],"right":null}}},"percent_proliferating_cells":{"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_inflammatory_tissue":{"description":{"left":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)","right":"Indicate a value, in decimals, that represents local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_stromal_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)","right":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a malignant tumour specimen but are not malignant such as fibroblasts, vascular structures, etc."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_necrosis":{"description":{"left":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)","right":"Indicate a value, in decimals, that represents the percentage of cell death in a malignant tumour specimen."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}}},"created":{},"deleted":{"specimen_laterality":{"changeType":"deleted","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"percent_tumour_cells_measurement_method":{"changeType":"deleted","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"age_at_diagnosis":{"restrictions":{"range":{"left":{"exclusiveMin":0,"max":90},"right":null}}},"number_lymph_nodes_examined":{"description":{"left":"The total number of lymph nodes tested for the presence of cancer. (Reference: caDSR CDE ID 3)","right":"The total number of lymph nodes tested for the presence of cancer. (Reference: NCI CDE ID: 3)"},"meta":{"dependsOn":{"left":"primary_diagnosis.lymph_nodes_examined_status","right":null},"notes":{"left":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":null},"range":{"left":{"min":0},"right":null}}},"number_lymph_nodes_positive":{"description":{"left":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: caDSR CDE ID 6113694)","right":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: NCI CDE ID: 6113694)"},"meta":{"dependsOn":{"left":"primary_diagnosis.lymph_nodes_examined_status","right":null},"notes":{"left":"This field is only required if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":null},"range":{"left":{"min":0},"right":null},"required":{"left":null,"right":true}}},"clinical_tumour_staging_system":{"meta":{"validationDependency":{"left":true,"right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}},"required":{"left":null,"right":true}}},"clinical_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"clinical_n_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null}}},"clinical_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"clinical_stage_group":{"description":{"left":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage.","right":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.)."},"meta":{"examples":{"left":"Stage I, Stage IIB","right":null}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.clinical_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'clinical_tumour_staging_system' is set to '${\n $row.clinical_tumour_staging_system\n }', 'clinical_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })"]},"required":{"left":null,"right":true}}},"performance_status":{"description":{"left":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status).","right":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference source: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status)."},"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"data":{"added":[],"deleted":["Unknown"]}}}}},"created":{},"deleted":{"laterality":{"changeType":"deleted","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_status":{"changeType":"deleted","name":"lymph_nodes_examined_status","description":"Indicate if lymph nodes were examined for metastases.","valueType":"string","restrictions":{"required":true,"codeList":["Cannot be determined","No","No lymph nodes found in resected specimen","Not applicable","Yes"]},"meta":{"core":true,"displayName":"Lymph Nodes Examined Status"}},"lymph_nodes_examined_method":{"changeType":"deleted","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}}},"treatment":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null},"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":[],"deleted":["End of life care"]}}}},"is_primary_treatment":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"codeList":{"left":["Yes","No"],"right":["Yes","No","Unknown"],"data":{"added":["Unknown"],"deleted":[]}},"required":{"left":null,"right":true}}},"line_of_treatment":{"meta":{"dependsOn":{"left":"treatment.is_primary_treatment","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"],"right":null}}},"treatment_start_interval":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"treatment_duration":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null},"required":{"left":null,"right":true}}},"days_per_cycle":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null}}},"number_of_cycles":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null}}},"treatment_intent":{"description":{"left":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","right":"Indicate the intended disease outcome for which the treatment is given. (Reference: CDISC [NCIt code: C124307])"},"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"codeList":{"left":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"],"right":["Curative","Palliative","Unknown"],"data":{"added":["Unknown"],"deleted":["Diagnostic","Forensic","Guidance","Preventative","Screening","Supportive"]}},"required":{"left":null,"right":true}}},"treatment_setting":{"description":{"left":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: NCIt C124308)","right":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: CDISC [NCIt code: C124308])"},"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"codeList":{"left":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"],"right":["Adjuvant","Advanced/Metastatic","Neoadjuvant","Not applicable"],"data":{"added":["Not applicable"],"deleted":["Conditioning","Induction","Maintenance","Mobilization","Preventative","Radiosensitization","Salvage"]}},"required":{"left":null,"right":true}}},"response_to_treatment":{"description":{"left":"The donor's response to the applied treatment regimen.","right":"The donor's response to the applied treatment regimen. (Source: RECIST)"},"meta":{"dependsOn":{"left":"treatment.response_to_treatment_criteria_method","right":null},"notes":{"left":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"right":null},"codeList":{"left":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"],"right":["Complete response","Disease progression","NED","Partial response","Stable disease"],"data":{"added":["Disease progression","NED"],"deleted":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease"]}},"required":{"left":null,"right":true}}},"outcome_of_treatment":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null}}},"toxicity_type":{"description":{"left":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity.","right":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hemotological toxicity or non-hemotological toxicity."},"meta":{"dependsOn":{"left":"treatment.outcome_of_treatment","right":null}},"restrictions":{"codeList":{"left":["Hematological","Non-hematological","Not applicable","Unknown"],"right":["Hemotological","Non-hemotological"],"data":{"added":["Hemotological","Non-hemotological"],"deleted":["Hematological","Non-hematological","Not applicable","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"],"right":null}}},"adverse_events":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"codeList":{"left":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"right":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"data":{"added":[],"deleted":["None","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null}}},"clinical_trials_database":{"meta":{"notes":{"left":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added.","right":null}},"restrictions":{"codeList":{"left":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"],"right":["NCI Clinical Trials","EU Clinical Trials Register"],"data":{"added":[],"deleted":["Not applicable","Unknown"]}}}},"clinical_trial_number":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: 'The submitted NCI clinical trial number is in incorrect format.'};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: \"The submitted EudraCT clinical trial number is in incorrect format.\"};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: \"The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database.\"};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: \"'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.\"};\n } \n }\n return result;\n })"]}}}},"created":{"age_at_consent_for_treatment":{"changeType":"created","name":"age_at_consent_for_treatment","description":"Indicate the age of donor when consent was given for treatment.","valueType":"integer","meta":{"displayName":"Age At Consent For Treatment"}},"hemotological_toxicity":{"changeType":"created","name":"hemotological_toxicity","description":"Indicate the hemotological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5"]},"meta":{"displayName":"Hemotological Toxicity","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"response_to_treatment_criteria_method":{"changeType":"deleted","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},"hematological_toxicity":{"changeType":"deleted","name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"non-hematological_toxicity":{"changeType":"deleted","name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"chemotherapy":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"dependsOn":{"left":"chemotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"description":{"left":"Name of agent or drug administered to donor as part of the treatment regimen.","right":"Name of agent or drug administered to patient as part of the treatment regimen."},"meta":{"dependsOn":{"left":"chemotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"chemotherapy_dosage_units":{"changeType":"created","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate the total actual drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"deleted","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"deleted","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"deleted","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"deleted","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"description":{"left":"Name of agent or drug administered to donor as part of the treatment regimen.","right":"Name of agent or drug administered to patient as part of the treatment regimen."},"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"hormone_drug_dosage_units":{"changeType":"created","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"deleted","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"radiation":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"radiation_therapy_fractions":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"radiation_therapy_dosage":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"anatomical_site_irradiated":{"description":{"left":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)","right":"Indicate localization site where radiation therapy was administered."},"restrictions":{"codeList":{"left":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"right":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"data":{"added":["Bone","Extremities","Head-Neck","Peritoneum"],"deleted":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"]}}}}},"created":{},"deleted":{"radiation_boost":{"changeType":"deleted","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"deleted","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}}},"immunotherapy":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"immunotherapy_type":{"changeType":"deleted","name":"immunotherapy_type","valueType":"string","description":"Indicate the type of immunotherapy administered to donor.","meta":{"displayName":"Immunotherapy Type","core":true},"restrictions":{"required":true,"codeList":["Cell-based","Immune checkpoint inhibitors","Monoclonal antibodies other than immune checkpoint inhibitors","Other immunomodulatory substances"]}},"drug_rxnormcui":{"changeType":"deleted","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"deleted","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"deleted","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"surgery":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"deleted","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"deleted","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"deleted","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"deleted","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"deleted","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"deleted","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"deleted","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"deleted","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"deleted","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"deleted","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"deleted","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"deleted","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"deleted","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"deleted","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}}},"follow_up":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_follow_up_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null},"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"treatment.submitter_treatment_id","right":null},"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}"}}},"weight_at_followup":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"relapse_type":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })"]}}},"relapse_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `'${$name}' cannot be greater than the 'interval_of_followup'.` }\n }\n }\n return result;\n })"]}}},"method_of_progression_status":{"description":{"left":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Reference: caDSR CDE ID 6161031)","right":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Codelist reference: NCI CDE ID: 6161031)"},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })"]}}},"recurrence_t_category":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"recurrence_n_category":{"meta":{"core":{"left":null,"right":true}}},"recurrence_m_category":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"recurrence_stage_group":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.recurrence_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.recurrence_tumour_staging_system && $row.recurrence_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'recurrence_tumour_staging_system' is set to '${\n $row.recurrence_tumour_staging_system\n }', 'recurrence_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"posttherapy_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"posttherapy_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"posttherapy_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"posttherapy_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.posttherapy_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.posttherapy_tumour_staging_system && $row.posttherapy_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'posttherapy_tumour_staging_system' is set to '${\n $row.posttherapy_tumour_staging_system\n }', 'posttherapy_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })"]}}}},"created":{"anatomic_site_progression_or_recurrences":{"changeType":"created","description":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1,C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}}},"deleted":{"anatomic_site_progression_or_recurrence":{"changeType":"deleted","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"exposure":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"deleted","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"deleted","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"deleted","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"deleted","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"deleted","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"deleted","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"deleted","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"deleted","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"deleted","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"deleted","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"deleted","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}}},"family_history":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"family_relative_id":{"changeType":"deleted","description":"Unique identifier of the relative, assigned by the data provider.","name":"family_relative_id","valueType":"string","meta":{"displayName":"Family Relative ID","primaryId":true,"notes":"This field is required to ensure that family members are identified in unique records. Ids can be as simple as an incremented numeral to ensure uniqueness."},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"relative_with_cancer_history":{"changeType":"deleted","description":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","name":"relative_with_cancer_history","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Relative with Cancer History"}},"relationship_type":{"changeType":"deleted","description":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","name":"relationship_type","restrictions":{"codeList":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"]},"valueType":"string","meta":{"displayName":"Relationship Type"}},"gender_of_relative":{"changeType":"deleted","description":"The self-reported gender of related individual.","name":"gender_of_relative","restrictions":{"codeList":["Female","Male","Other","Unknown"]},"valueType":"string","meta":{"displayName":"Gender of Relative"}},"age_of_relative_at_diagnosis":{"changeType":"deleted","description":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","name":"age_of_relative_at_diagnosis","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","displayName":"Age Of Relative At Diagnosis"}},"cancer_type_code_of_relative":{"changeType":"deleted","name":"cancer_type_code_of_relative","valueType":"string","description":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"examples":"C41.1,C16.9,C00.5,D46.9","dependsOn":"family_history.relative_with_cancer_history","displayName":"Cancer Type Code (ICD-10) of Relative"}},"relative_vital_status":{"changeType":"deleted","description":"Relative's last known state of living or deceased.","name":"relative_vital_status","restrictions":{"codeList":["Alive","Deceased","Unknown"]},"valueType":"string","meta":{"displayName":"Vital Status of Relative"}},"cause_of_death_of_relative":{"changeType":"deleted","description":"Indicate the cause of the death of the relative.","name":"cause_of_death_of_relative","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]},"valueType":"string","meta":{"dependsOn":"family_history.relative_vital_status","displayName":"Cause of Death of Relative"}},"relative_survival_time":{"changeType":"deleted","description":"Indicate how long, in days, the relative survived from the time they were diagnosed with cancer.","name":"relative_survival_time","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","units":"days","displayName":"Survival Time Of Relative"}}}},"biomarker":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"deleted","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"deleted","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"deleted","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"deleted","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"deleted","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"deleted","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"deleted","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"deleted","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"deleted","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"deleted","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"deleted","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"deleted","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"deleted","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"deleted","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"deleted","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"deleted","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}}},"comorbidity":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"deleted","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"deleted","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"deleted","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"deleted","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"deleted","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"deleted","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}}}}} diff --git a/website/static/data/schemas/diffs/1.24/1.24-diff-1.4.json b/website/static/data/schemas/diffs/1.24/1.24-diff-1.4.json new file mode 100644 index 00000000..a3038130 --- /dev/null +++ b/website/static/data/schemas/diffs/1.24/1.24-diff-1.4.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":[],"deleted":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n const row = $row;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n const designation = row.tumour_normal_designation.trim().toLowerCase();\r\n const specimen_type = $field.trim().toLowerCase();\r\n \r\n if (designation === \"normal\"){\r\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\r\n if (!validTypes.includes(specimen_type)){\r\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when tumour_normal_designation is set to Normal.\"};\r\n }\r\n }\r\n else if (designation === \"tumour\") {\r\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\r\n if (invalidTypes.includes(specimen_type)){\r\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when tumour_normal_designation is set to Tumour.\"};\r\n }\r\n }\r\n return result;\r\n })"]}}},"submitter_sample_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased"],"right":["Alive","Deceased","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"cause_of_death":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n const vitalStatus = $row.vital_status.trim().toLowerCase();\r\n \r\n if (!currField && vitalStatus === \"deceased\"){\r\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\r\n }\r\n else if (currField && vitalStatus != \"deceased\"){\r\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\r\n }\r\n return result;\r\n })"]}}},"survival_time":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n const vitalStatus = $row.vital_status.trim().toLowerCase();\r\n \r\n if (!currField && vitalStatus === \"deceased\"){\r\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\r\n }\r\n else if (currField && vitalStatus != \"deceased\"){\r\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\r\n }\r\n return result;\r\n })"]},"range":{"left":{"exclusiveMin":0},"right":null}}},"primary_site":{"meta":{"notes":{"left":"To include multiple values, separate values with a pipe delimiter '|' within your file.","right":null},"examples":{"left":"Breast|Ovary","right":null}},"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Not Reported","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva","Unknown"],"data":{"added":["Not Reported","Unknown"],"deleted":["Unknown primary site"]}}}},"height":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"weight":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"bmi":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"menopause_status":{"description":{"left":"Indicate the donor's menopause status at the time of primary diagnosis. (Reference: caDSR CDE ID 2434914)","right":"Indicate the donor's menopause status at the time of primary diagnosis. (Codelist reference: NCI CDE ID: 2434914)"},"restrictions":{"codeList":{"left":["Not applicable","Perimenopausal","Postmenopausal","Premenopausal","Unknown"],"right":["Indeterminate or unknown","Not applicable","Perimenopausal","Postmenopausal","Premenopausal"],"data":{"added":["Indeterminate or unknown"],"deleted":["Unknown"]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)","right":"Indicate the donor's age of menarche, the first occurrence of menstruation."},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"number_of_pregnancies":{"description":{"left":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)","right":"Indicate the number of pregnancies a donor has had."},"restrictions":{"range":{"left":{"min":0},"right":null}}},"number_of_children":{"description":{"left":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)","right":"Indicate the number of children the donor has birthed."},"restrictions":{"range":{"left":{"min":0},"right":null}}}},"created":{"prior_malignancy":{"changeType":"created","description":"Prior malignancy affecting donor.","name":"prior_malignancy","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy","examples":"C41.1, C16.9, C00.5, D46.9"}},"cancer_type_prior_malignancy":{"changeType":"created","description":"The code to represent the cancer type of a prior malignancy using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","name":"cancer_type_prior_malignancy","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"valueType":"string","meta":{"displayName":"Cancer Type Prior Malignancy"}},"age_at_prior_malignancy":{"changeType":"created","description":"If donor has history of prior malignancy, indicate age at previous diagnosis, in years.","name":"age_at_prior_malignancy","valueType":"integer","meta":{"displayName":"Age at Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"created","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Codelist reference: NCI CDE: 4122391)","name":"laterality_of_prior_malignancy","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality at Prior Malignancy"}}},"deleted":{"genetic_disorders":{"changeType":"deleted","description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},"hrt_type":{"changeType":"deleted","description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},"hrt_duration":{"changeType":"deleted","description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},"contraception_type":{"changeType":"deleted","description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},"contraception_duration":{"changeType":"deleted","description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},"lost_to_followup_after_clinical_event_id":{"changeType":"deleted","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}}},"specimen":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null},"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"pathological_tumour_staging_system":{"meta":{"validationDependency":{"left":true,"right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n /* This is not a required field, so first ensure that it exists */\r\n if ($field) {\r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"pathological_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"pathological_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"pathological_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.pathological_tumour_staging_system && $field) {\r\n let codeList = [];\r\n switch ($row.pathological_tumour_staging_system && $row.pathological_tumour_staging_system.trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb',\r\n 'stage ive',\r\n 'stage ivs'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When 'pathological_tumour_staging_system' is set to '${\r\n $row.pathological_tumour_staging_system\r\n }', 'pathological_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })"]}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"data":{"added":[],"deleted":["Unknown"]}}}},"specimen_storage":{"description":{"left":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured.","right":"Indicate the method of specimen storage for specimens that were not extracted freshly or immediately cultured."},"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"data":{"added":[],"deleted":["Unknown"]}}}},"reference_pathology_confirmed":{"description":{"left":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)","right":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist."}},"tumour_grading_system":{"meta":{"validationDependency":{"left":true,"right":null}}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.tumour_grading_system && $field) {\r\n let codeList = [];\r\n const tieredGradingList = ['gx','g1','g2','g3'];\r\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\r\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\r\n case 'two-tier grading system':\r\n codeList = [\r\n 'low grade',\r\n 'high grade',\r\n ];\r\n break;\r\n case 'three-tier grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'four-tier grading system':\r\n codeList = [\r\n 'gx',\r\n 'g1',\r\n 'g2',\r\n 'g3',\r\n 'g4',\r\n ];\r\n break;\r\n case 'grading system for gists':\r\n codeList = [\r\n 'low',\r\n 'high',\r\n ];\r\n break;\r\n case 'grading system for gnets':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'isup grading system':\r\n codeList = [\r\n 'gx',\r\n 'g1',\r\n 'g2',\r\n 'g3',\r\n 'g4',\r\n ];\r\n break;\r\n case 'who grading system for cns tumours':\r\n codeList = [\r\n 'grade i',\r\n 'grade ii',\r\n 'grade iii',\r\n 'grade iv',\r\n ];\r\n break;\r\n case 'fnclcc grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'gleason grade group system':\r\n codeList = [\r\n 'grade group 1',\r\n 'grade group 2',\r\n 'grade group 3',\r\n 'grade group 4',\r\n 'grade group 5',\r\n ];\r\n break;\r\n case 'scarff-bloom-richardson grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'nuclear grading system for dcis':\r\n codeList = tieredGradingList;\r\n break;\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase())) {\r\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\r\n $row.tumour_grading_system\r\n }', 'tumour_grade' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\r\n result.valid = false;\r\n const msg = \"'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.\";\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })"]}}},"percent_tumour_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)","right":"Indicate a value, in decimals, that represents the percentage of infiltration by tumour cells in a specimen."},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null},"script":{"left":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"],"right":null}}},"percent_proliferating_cells":{"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_inflammatory_tissue":{"description":{"left":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)","right":"Indicate a value, in decimals, that represents local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_stromal_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)","right":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a malignant tumour specimen but are not malignant such as fibroblasts, vascular structures, etc."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_necrosis":{"description":{"left":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)","right":"Indicate a value, in decimals, that represents the percentage of cell death in a malignant tumour specimen."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}}},"created":{},"deleted":{"specimen_laterality":{"changeType":"deleted","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"percent_tumour_cells_measurement_method":{"changeType":"deleted","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"age_at_diagnosis":{"restrictions":{"range":{"left":{"exclusiveMin":0,"max":90},"right":null}}},"number_lymph_nodes_examined":{"description":{"left":"The total number of lymph nodes tested for the presence of cancer. (Reference: caDSR CDE ID 3)","right":"The total number of lymph nodes tested for the presence of cancer. (Reference: NCI CDE ID: 3)"},"meta":{"dependsOn":{"left":"primary_diagnosis.lymph_nodes_examined_status","right":null},"notes":{"left":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":null},"range":{"left":{"min":0},"right":null}}},"number_lymph_nodes_positive":{"description":{"left":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: caDSR CDE ID 6113694)","right":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: NCI CDE ID: 6113694)"},"meta":{"dependsOn":{"left":"primary_diagnosis.lymph_nodes_examined_status","right":null},"notes":{"left":"This field is only required if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":null},"range":{"left":{"min":0},"right":null},"required":{"left":null,"right":true}}},"clinical_tumour_staging_system":{"meta":{"validationDependency":{"left":true,"right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n /* This is not a required field, so first ensure that it exists */\r\n if ($field) {\r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}},"required":{"left":null,"right":true}}},"clinical_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"clinical_n_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null}}},"clinical_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"clinical_stage_group":{"description":{"left":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage.","right":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.)."},"meta":{"examples":{"left":"Stage I, Stage IIB","right":null}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.clinical_tumour_staging_system && $field) {\r\n let codeList = [];\r\n switch ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system.trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb',\r\n 'stage ive',\r\n 'stage ivs'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When 'clinical_tumour_staging_system' is set to '${\r\n $row.clinical_tumour_staging_system\r\n }', 'clinical_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })"]},"required":{"left":null,"right":true}}},"performance_status":{"description":{"left":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status).","right":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference source: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status)."},"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"data":{"added":[],"deleted":["Unknown"]}}}}},"created":{},"deleted":{"laterality":{"changeType":"deleted","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_status":{"changeType":"deleted","name":"lymph_nodes_examined_status","description":"Indicate if lymph nodes were examined for metastases.","valueType":"string","restrictions":{"required":true,"codeList":["Cannot be determined","No","No lymph nodes found in resected specimen","Not applicable","Yes"]},"meta":{"core":true,"displayName":"Lymph Nodes Examined Status"}},"lymph_nodes_examined_method":{"changeType":"deleted","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}}},"treatment":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null},"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":[],"deleted":["End of life care"]}}}},"is_primary_treatment":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"codeList":{"left":["Yes","No"],"right":["Yes","No","Unknown"],"data":{"added":["Unknown"],"deleted":[]}},"required":{"left":null,"right":true}}},"line_of_treatment":{"meta":{"dependsOn":{"left":"treatment.is_primary_treatment","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"],"right":null}}},"treatment_start_interval":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"treatment_duration":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null},"required":{"left":null,"right":true}}},"days_per_cycle":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null}}},"number_of_cycles":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null}}},"treatment_intent":{"description":{"left":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","right":"Indicate the intended disease outcome for which the treatment is given. (Reference: CDISC [NCIt code: C124307])"},"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"codeList":{"left":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"],"right":["Curative","Palliative","Unknown"],"data":{"added":["Unknown"],"deleted":["Diagnostic","Forensic","Guidance","Preventative","Screening","Supportive"]}},"required":{"left":null,"right":true}}},"treatment_setting":{"description":{"left":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: NCIt C124308)","right":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: CDISC [NCIt code: C124308])"},"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"codeList":{"left":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"],"right":["Adjuvant","Advanced/Metastatic","Neoadjuvant","Not applicable"],"data":{"added":["Not applicable"],"deleted":["Conditioning","Induction","Maintenance","Mobilization","Preventative","Radiosensitization","Salvage"]}},"required":{"left":null,"right":true}}},"response_to_treatment":{"description":{"left":"The donor's response to the applied treatment regimen.","right":"The donor's response to the applied treatment regimen. (Source: RECIST)"},"meta":{"dependsOn":{"left":"treatment.response_to_treatment_criteria_method","right":null},"notes":{"left":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"right":null},"codeList":{"left":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"],"right":["Complete response","Disease progression","NED","Partial response","Stable disease"],"data":{"added":["Disease progression","NED"],"deleted":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease"]}},"required":{"left":null,"right":true}}},"outcome_of_treatment":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null}}},"toxicity_type":{"description":{"left":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity.","right":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hemotological toxicity or non-hemotological toxicity."},"meta":{"dependsOn":{"left":"treatment.outcome_of_treatment","right":null}},"restrictions":{"codeList":{"left":["Hematological","Non-hematological","Not applicable","Unknown"],"right":["Hemotological","Non-hemotological"],"data":{"added":["Hemotological","Non-hemotological"],"deleted":["Hematological","Non-hematological","Not applicable","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"],"right":null}}},"adverse_events":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"codeList":{"left":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"right":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"data":{"added":[],"deleted":["None","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null}}},"clinical_trials_database":{"meta":{"notes":{"left":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added.","right":null}},"restrictions":{"codeList":{"left":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"],"right":["NCI Clinical Trials","EU Clinical Trials Register"],"data":{"added":[],"deleted":["Not applicable","Unknown"]}}}},"clinical_trial_number":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n //regex check for clinical trial number\r\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\r\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\r\n\r\n // list of valid clinical trial databases\r\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\r\n \r\n if ($row.clinical_trials_database && $field) {\r\n const trialNumber = $field.trim();\r\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\r\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\r\n result = {valid: false, message: 'The submitted NCI clinical trial number is in incorrect format.'};\r\n }\r\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\r\n result = {valid: false, message: \"The submitted EudraCT clinical trial number is in incorrect format.\"};\r\n }\r\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\r\n result = {valid: false, message: \"The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database.\"};\r\n }\r\n }\r\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\r\n result = {valid: true, message: \"Ok\"};\r\n }\r\n else if ($row.clinical_trials_database && !$field) {\r\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\r\n result = {valid: false, message: \"'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.\"};\r\n } \r\n }\r\n return result;\r\n })"]}}}},"created":{"age_at_consent_for_treatment":{"changeType":"created","name":"age_at_consent_for_treatment","description":"Indicate the age of donor when consent was given for treatment.","valueType":"integer","meta":{"displayName":"Age At Consent For Treatment"}},"hemotological_toxicity":{"changeType":"created","name":"hemotological_toxicity","description":"Indicate the hemotological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5"]},"meta":{"displayName":"Hemotological Toxicity","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"response_to_treatment_criteria_method":{"changeType":"deleted","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},"hematological_toxicity":{"changeType":"deleted","name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"non-hematological_toxicity":{"changeType":"deleted","name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"chemotherapy":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"dependsOn":{"left":"chemotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"description":{"left":"Name of agent or drug administered to donor as part of the treatment regimen.","right":"Name of agent or drug administered to patient as part of the treatment regimen."},"meta":{"dependsOn":{"left":"chemotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"chemotherapy_dosage_units":{"changeType":"created","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate the total actual drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"deleted","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"deleted","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"deleted","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"deleted","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"description":{"left":"Name of agent or drug administered to donor as part of the treatment regimen.","right":"Name of agent or drug administered to patient as part of the treatment regimen."},"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"hormone_drug_dosage_units":{"changeType":"created","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"deleted","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"radiation":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"radiation_therapy_fractions":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"radiation_therapy_dosage":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"anatomical_site_irradiated":{"description":{"left":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)","right":"Indicate localization site where radiation therapy was administered."},"restrictions":{"codeList":{"left":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"right":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"data":{"added":["Bone","Extremities","Head-Neck","Peritoneum"],"deleted":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"]}}}}},"created":{},"deleted":{"radiation_boost":{"changeType":"deleted","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"deleted","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}}},"immunotherapy":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"immunotherapy_type":{"changeType":"deleted","name":"immunotherapy_type","valueType":"string","description":"Indicate the type of immunotherapy administered to donor.","meta":{"displayName":"Immunotherapy Type","core":true},"restrictions":{"required":true,"codeList":["Cell-based","Immune checkpoint inhibitors","Monoclonal antibodies other than immune checkpoint inhibitors","Other immunomodulatory substances"]}},"drug_rxnormcui":{"changeType":"deleted","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"deleted","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"deleted","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"surgery":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"deleted","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"deleted","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"deleted","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"deleted","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"deleted","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"deleted","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"deleted","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"deleted","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"deleted","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"deleted","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"deleted","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"deleted","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"deleted","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"deleted","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}}},"follow_up":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_follow_up_id":{"meta":{"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null},"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"treatment.submitter_treatment_id","right":null},"notes":{"left":null,"right":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`."}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"weight_at_followup":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"relapse_type":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })"]}}},"relapse_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const intervalOfFollowup = parseInt($row.interval_of_followup);\r\n\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n relapseInterval = parseInt($field);\r\n if (relapseInterval > intervalOfFollowup) {\r\n result = {valid: false, message: `'${$name}' cannot be greater than the 'interval_of_followup'.` }\r\n }\r\n }\r\n return result;\r\n })"]}}},"method_of_progression_status":{"description":{"left":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Reference: caDSR CDE ID 6161031)","right":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Codelist reference: NCI CDE ID: 6161031)"},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n /* This is not a required field, so first ensure that it exists */\r\n if ($field) {\r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })","(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })"]}}},"recurrence_t_category":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"recurrence_n_category":{"meta":{"core":{"left":null,"right":true}}},"recurrence_m_category":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"recurrence_stage_group":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.recurrence_tumour_staging_system && $field) {\r\n let codeList = [];\r\n switch ($row.recurrence_tumour_staging_system && $row.recurrence_tumour_staging_system.trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb',\r\n 'stage ive',\r\n 'stage ivs'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When 'recurrence_tumour_staging_system' is set to '${\r\n $row.recurrence_tumour_staging_system\r\n }', 'recurrence_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })"]}}},"posttherapy_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n /* This is not a required field, so first ensure that it exists */\r\n if ($field) {\r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"posttherapy_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"posttherapy_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"posttherapy_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.posttherapy_tumour_staging_system && $field) {\r\n let codeList = [];\r\n switch ($row.posttherapy_tumour_staging_system && $row.posttherapy_tumour_staging_system.trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb',\r\n 'stage ive',\r\n 'stage ivs'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When 'posttherapy_tumour_staging_system' is set to '${\r\n $row.posttherapy_tumour_staging_system\r\n }', 'posttherapy_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })"]}}}},"created":{"anatomic_site_progression_or_recurrences":{"changeType":"created","description":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1,C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}}},"deleted":{"anatomic_site_progression_or_recurrence":{"changeType":"deleted","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"exposure":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"deleted","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"deleted","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"deleted","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"deleted","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"deleted","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"deleted","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"deleted","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"deleted","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"deleted","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"deleted","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"deleted","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}}},"family_history":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"family_relative_id":{"changeType":"deleted","description":"Unique identifier of the relative, assigned by the data provider.","name":"family_relative_id","valueType":"string","meta":{"displayName":"Family Relative ID","primaryId":true,"notes":"This field is required to ensure that family members are identified in unique records. Ids can be as simple as an incremented numeral to ensure uniqueness."},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"relative_with_cancer_history":{"changeType":"deleted","description":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","name":"relative_with_cancer_history","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Relative with Cancer History"}},"relationship_type":{"changeType":"deleted","description":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","name":"relationship_type","restrictions":{"codeList":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"]},"valueType":"string","meta":{"displayName":"Relationship Type"}},"gender_of_relative":{"changeType":"deleted","description":"The self-reported gender of related individual.","name":"gender_of_relative","restrictions":{"codeList":["Female","Male","Other","Unknown"]},"valueType":"string","meta":{"displayName":"Gender of Relative"}},"age_of_relative_at_diagnosis":{"changeType":"deleted","description":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","name":"age_of_relative_at_diagnosis","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","displayName":"Age Of Relative At Diagnosis"}},"cancer_type_code_of_relative":{"changeType":"deleted","name":"cancer_type_code_of_relative","valueType":"string","description":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"examples":"C41.1,C16.9,C00.5,D46.9","dependsOn":"family_history.relative_with_cancer_history","displayName":"Cancer Type Code (ICD-10) of Relative"}},"relative_vital_status":{"changeType":"deleted","description":"Relative's last known state of living or deceased.","name":"relative_vital_status","restrictions":{"codeList":["Alive","Deceased","Unknown"]},"valueType":"string","meta":{"displayName":"Vital Status of Relative"}},"cause_of_death_of_relative":{"changeType":"deleted","description":"Indicate the cause of the death of the relative.","name":"cause_of_death_of_relative","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]},"valueType":"string","meta":{"dependsOn":"family_history.relative_vital_status","displayName":"Cause of Death of Relative"}},"relative_survival_time":{"changeType":"deleted","description":"Indicate how long, in days, the relative survived from the time they were diagnosed with cancer.","name":"relative_survival_time","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","units":"days","displayName":"Survival Time Of Relative"}}}},"biomarker":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"deleted","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"deleted","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"deleted","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"deleted","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"deleted","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"deleted","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"deleted","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"deleted","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"deleted","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"deleted","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"deleted","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"deleted","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"deleted","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"deleted","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"deleted","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"deleted","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}}},"comorbidity":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"deleted","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"deleted","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"deleted","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"deleted","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"deleted","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"deleted","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}}}}} diff --git a/website/static/data/schemas/diffs/1.24/1.24-diff-1.5.json b/website/static/data/schemas/diffs/1.24/1.24-diff-1.5.json new file mode 100644 index 00000000..9487a234 --- /dev/null +++ b/website/static/data/schemas/diffs/1.24/1.24-diff-1.5.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":[],"deleted":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n const row = $row;\n let result = {valid: true, message: \"Ok\"};\n \n const designation = row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\"){\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when tumour_normal_designation is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when tumour_normal_designation is set to Tumour.\"};\n }\n }\n return result;\n })"]}}},"submitter_sample_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased"],"right":["Alive","Deceased","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"cause_of_death":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })"]}}},"survival_time":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })"]},"range":{"left":{"exclusiveMin":0},"right":null}}},"primary_site":{"meta":{"notes":{"left":"To include multiple values, separate values with a pipe delimiter '|' within your file.","right":null},"examples":{"left":"Breast|Ovary","right":null}},"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Not Reported","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva","Unknown"],"data":{"added":["Not Reported","Unknown"],"deleted":["Unknown primary site"]}}}},"height":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"weight":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"bmi":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"menopause_status":{"description":{"left":"Indicate the donor's menopause status at the time of primary diagnosis. (Reference: caDSR CDE ID 2434914)","right":"Indicate the donor's menopause status at the time of primary diagnosis. (Codelist reference: NCI CDE ID: 2434914)"},"restrictions":{"codeList":{"left":["Not applicable","Perimenopausal","Postmenopausal","Premenopausal","Unknown"],"right":["Indeterminate or unknown","Not applicable","Perimenopausal","Postmenopausal","Premenopausal"],"data":{"added":["Indeterminate or unknown"],"deleted":["Unknown"]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)","right":"Indicate the donor's age of menarche, the first occurrence of menstruation."},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"number_of_pregnancies":{"description":{"left":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)","right":"Indicate the number of pregnancies a donor has had."},"restrictions":{"range":{"left":{"min":0},"right":null}}},"number_of_children":{"description":{"left":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)","right":"Indicate the number of children the donor has birthed."},"restrictions":{"range":{"left":{"min":0},"right":null}}}},"created":{"prior_malignancy":{"changeType":"created","description":"Prior malignancy affecting donor.","name":"prior_malignancy","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy","examples":"C41.1, C16.9, C00.5, D46.9"}},"cancer_type_prior_malignancy":{"changeType":"created","description":"The code to represent the cancer type of a prior malignancy using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","name":"cancer_type_prior_malignancy","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"valueType":"string","meta":{"displayName":"Cancer Type Prior Malignancy"}},"age_at_prior_malignancy":{"changeType":"created","description":"If donor has history of prior malignancy, indicate age at previous diagnosis, in years.","name":"age_at_prior_malignancy","valueType":"integer","meta":{"displayName":"Age at Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"created","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Codelist reference: NCI CDE: 4122391)","name":"laterality_of_prior_malignancy","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality at Prior Malignancy"}}},"deleted":{"genetic_disorders":{"changeType":"deleted","description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},"hrt_type":{"changeType":"deleted","description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},"hrt_duration":{"changeType":"deleted","description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},"contraception_type":{"changeType":"deleted","description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},"contraception_duration":{"changeType":"deleted","description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},"lost_to_followup_after_clinical_event_id":{"changeType":"deleted","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}}},"specimen":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"pathological_tumour_staging_system":{"meta":{"validationDependency":{"left":true,"right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"pathological_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"pathological_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"pathological_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.pathological_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.pathological_tumour_staging_system && $row.pathological_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'pathological_tumour_staging_system' is set to '${\n $row.pathological_tumour_staging_system\n }', 'pathological_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"data":{"added":[],"deleted":["Unknown"]}}}},"specimen_storage":{"description":{"left":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured.","right":"Indicate the method of specimen storage for specimens that were not extracted freshly or immediately cultured."},"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"data":{"added":[],"deleted":["Unknown"]}}}},"reference_pathology_confirmed":{"description":{"left":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)","right":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist."}},"tumour_grading_system":{"meta":{"validationDependency":{"left":true,"right":null}}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = \"'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.\";\n result.message = msg;\n }\n }\n return result;\n })"]}}},"percent_tumour_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)","right":"Indicate a value, in decimals, that represents the percentage of infiltration by tumour cells in a specimen."},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null},"script":{"left":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"],"right":null}}},"percent_proliferating_cells":{"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_inflammatory_tissue":{"description":{"left":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)","right":"Indicate a value, in decimals, that represents local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_stromal_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)","right":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a malignant tumour specimen but are not malignant such as fibroblasts, vascular structures, etc."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_necrosis":{"description":{"left":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)","right":"Indicate a value, in decimals, that represents the percentage of cell death in a malignant tumour specimen."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}}},"created":{},"deleted":{"specimen_laterality":{"changeType":"deleted","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"percent_tumour_cells_measurement_method":{"changeType":"deleted","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"age_at_diagnosis":{"restrictions":{"range":{"left":{"exclusiveMin":0,"max":90},"right":null}}},"number_lymph_nodes_examined":{"description":{"left":"The total number of lymph nodes tested for the presence of cancer. (Reference: caDSR CDE ID 3)","right":"The total number of lymph nodes tested for the presence of cancer. (Reference: NCI CDE ID: 3)"},"meta":{"dependsOn":{"left":"primary_diagnosis.lymph_nodes_examined_status","right":null},"notes":{"left":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":null},"range":{"left":{"min":0},"right":null}}},"number_lymph_nodes_positive":{"description":{"left":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: caDSR CDE ID 6113694)","right":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: NCI CDE ID: 6113694)"},"meta":{"dependsOn":{"left":"primary_diagnosis.lymph_nodes_examined_status","right":null},"notes":{"left":"This field is only required if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":null},"range":{"left":{"min":0},"right":null},"required":{"left":null,"right":true}}},"clinical_tumour_staging_system":{"meta":{"validationDependency":{"left":true,"right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}},"required":{"left":null,"right":true}}},"clinical_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"clinical_n_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null}}},"clinical_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"clinical_stage_group":{"description":{"left":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage.","right":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.)."},"meta":{"examples":{"left":"Stage I, Stage IIB","right":null}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.clinical_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'clinical_tumour_staging_system' is set to '${\n $row.clinical_tumour_staging_system\n }', 'clinical_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })"]},"required":{"left":null,"right":true}}},"performance_status":{"description":{"left":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status).","right":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference source: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status)."},"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"data":{"added":[],"deleted":["Unknown"]}}}}},"created":{},"deleted":{"laterality":{"changeType":"deleted","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_status":{"changeType":"deleted","name":"lymph_nodes_examined_status","description":"Indicate if lymph nodes were examined for metastases.","valueType":"string","restrictions":{"required":true,"codeList":["Cannot be determined","No","No lymph nodes found in resected specimen","Not applicable","Yes"]},"meta":{"core":true,"displayName":"Lymph Nodes Examined Status"}},"lymph_nodes_examined_method":{"changeType":"deleted","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}}},"treatment":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":[],"deleted":["End of life care"]}}}},"is_primary_treatment":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"codeList":{"left":["Yes","No"],"right":["Yes","No","Unknown"],"data":{"added":["Unknown"],"deleted":[]}},"required":{"left":null,"right":true}}},"line_of_treatment":{"meta":{"dependsOn":{"left":"treatment.is_primary_treatment","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"],"right":null}}},"treatment_start_interval":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"treatment_duration":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null},"required":{"left":null,"right":true}}},"days_per_cycle":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null}}},"number_of_cycles":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null}}},"treatment_intent":{"description":{"left":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","right":"Indicate the intended disease outcome for which the treatment is given. (Reference: CDISC [NCIt code: C124307])"},"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"codeList":{"left":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"],"right":["Curative","Palliative","Unknown"],"data":{"added":["Unknown"],"deleted":["Diagnostic","Forensic","Guidance","Preventative","Screening","Supportive"]}},"required":{"left":null,"right":true}}},"treatment_setting":{"description":{"left":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: NCIt C124308)","right":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: CDISC [NCIt code: C124308])"},"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"codeList":{"left":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"],"right":["Adjuvant","Advanced/Metastatic","Neoadjuvant","Not applicable"],"data":{"added":["Not applicable"],"deleted":["Conditioning","Induction","Maintenance","Mobilization","Preventative","Radiosensitization","Salvage"]}},"required":{"left":null,"right":true}}},"response_to_treatment":{"description":{"left":"The donor's response to the applied treatment regimen.","right":"The donor's response to the applied treatment regimen. (Source: RECIST)"},"meta":{"dependsOn":{"left":"treatment.response_to_treatment_criteria_method","right":null},"notes":{"left":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"right":null},"codeList":{"left":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"],"right":["Complete response","Disease progression","NED","Partial response","Stable disease"],"data":{"added":["Disease progression","NED"],"deleted":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease"]}},"required":{"left":null,"right":true}}},"outcome_of_treatment":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null}}},"toxicity_type":{"description":{"left":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity.","right":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hemotological toxicity or non-hemotological toxicity."},"meta":{"dependsOn":{"left":"treatment.outcome_of_treatment","right":null}},"restrictions":{"codeList":{"left":["Hematological","Non-hematological","Not applicable","Unknown"],"right":["Hemotological","Non-hemotological"],"data":{"added":["Hemotological","Non-hemotological"],"deleted":["Hematological","Non-hematological","Not applicable","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"],"right":null}}},"adverse_events":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"codeList":{"left":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"right":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"data":{"added":[],"deleted":["None","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null}}},"clinical_trials_database":{"meta":{"notes":{"left":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added.","right":null}},"restrictions":{"codeList":{"left":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"],"right":["NCI Clinical Trials","EU Clinical Trials Register"],"data":{"added":[],"deleted":["Not applicable","Unknown"]}}}},"clinical_trial_number":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: 'The submitted NCI clinical trial number is in incorrect format.'};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: \"The submitted EudraCT clinical trial number is in incorrect format.\"};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: \"The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database.\"};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: \"'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.\"};\n } \n }\n return result;\n })"]}}}},"created":{"age_at_consent_for_treatment":{"changeType":"created","name":"age_at_consent_for_treatment","description":"Indicate the age of donor when consent was given for treatment.","valueType":"integer","meta":{"displayName":"Age At Consent For Treatment"}},"hemotological_toxicity":{"changeType":"created","name":"hemotological_toxicity","description":"Indicate the hemotological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5"]},"meta":{"displayName":"Hemotological Toxicity","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"response_to_treatment_criteria_method":{"changeType":"deleted","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},"hematological_toxicity":{"changeType":"deleted","name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"non-hematological_toxicity":{"changeType":"deleted","name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"chemotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"dependsOn":{"left":"chemotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"description":{"left":"Name of agent or drug administered to donor as part of the treatment regimen.","right":"Name of agent or drug administered to patient as part of the treatment regimen."},"meta":{"dependsOn":{"left":"chemotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"chemotherapy_dosage_units":{"changeType":"created","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate the total actual drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"deleted","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"deleted","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"deleted","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"deleted","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"description":{"left":"Name of agent or drug administered to donor as part of the treatment regimen.","right":"Name of agent or drug administered to patient as part of the treatment regimen."},"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"hormone_drug_dosage_units":{"changeType":"created","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"deleted","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"radiation":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"radiation_therapy_fractions":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"radiation_therapy_dosage":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"anatomical_site_irradiated":{"description":{"left":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)","right":"Indicate localization site where radiation therapy was administered."},"restrictions":{"codeList":{"left":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"right":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"data":{"added":["Bone","Extremities","Head-Neck","Peritoneum"],"deleted":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"]}}}}},"created":{},"deleted":{"radiation_boost":{"changeType":"deleted","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"deleted","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}}},"immunotherapy":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"immunotherapy_type":{"changeType":"deleted","name":"immunotherapy_type","valueType":"string","description":"Indicate the type of immunotherapy administered to donor.","meta":{"displayName":"Immunotherapy Type","core":true},"restrictions":{"required":true,"codeList":["Cell-based","Immune checkpoint inhibitors","Monoclonal antibodies other than immune checkpoint inhibitors","Other immunomodulatory substances"]}},"drug_rxnormcui":{"changeType":"deleted","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"deleted","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"deleted","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"surgery":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"deleted","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"deleted","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"deleted","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"deleted","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"deleted","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"deleted","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"deleted","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"deleted","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"deleted","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"deleted","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"deleted","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"deleted","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"deleted","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"deleted","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}}},"follow_up":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_follow_up_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"treatment.submitter_treatment_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"weight_at_followup":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"relapse_type":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })"]}}},"relapse_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `'${$name}' cannot be greater than the 'interval_of_followup'.` }\n }\n }\n return result;\n })"]}}},"method_of_progression_status":{"description":{"left":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Reference: caDSR CDE ID 6161031)","right":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Codelist reference: NCI CDE ID: 6161031)"},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })"]}}},"recurrence_t_category":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"recurrence_n_category":{"meta":{"core":{"left":null,"right":true}}},"recurrence_m_category":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"recurrence_stage_group":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.recurrence_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.recurrence_tumour_staging_system && $row.recurrence_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'recurrence_tumour_staging_system' is set to '${\n $row.recurrence_tumour_staging_system\n }', 'recurrence_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"posttherapy_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"posttherapy_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"posttherapy_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"posttherapy_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.posttherapy_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.posttherapy_tumour_staging_system && $row.posttherapy_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'posttherapy_tumour_staging_system' is set to '${\n $row.posttherapy_tumour_staging_system\n }', 'posttherapy_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })"]}}}},"created":{"anatomic_site_progression_or_recurrences":{"changeType":"created","description":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1,C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}}},"deleted":{"anatomic_site_progression_or_recurrence":{"changeType":"deleted","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"exposure":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"deleted","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"deleted","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"deleted","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"deleted","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"deleted","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"deleted","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"deleted","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"deleted","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"deleted","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"deleted","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"deleted","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}}},"family_history":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"family_relative_id":{"changeType":"deleted","description":"Unique identifier of the relative, assigned by the data provider.","name":"family_relative_id","valueType":"string","meta":{"displayName":"Family Relative ID","primaryId":true,"notes":"This field is required to ensure that family members are identified in unique records. Ids can be as simple as an incremented numeral to ensure uniqueness."},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"relative_with_cancer_history":{"changeType":"deleted","description":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","name":"relative_with_cancer_history","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Relative with Cancer History"}},"relationship_type":{"changeType":"deleted","description":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","name":"relationship_type","restrictions":{"codeList":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"]},"valueType":"string","meta":{"displayName":"Relationship Type"}},"gender_of_relative":{"changeType":"deleted","description":"The self-reported gender of related individual.","name":"gender_of_relative","restrictions":{"codeList":["Female","Male","Other","Unknown"]},"valueType":"string","meta":{"displayName":"Gender of Relative"}},"age_of_relative_at_diagnosis":{"changeType":"deleted","description":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","name":"age_of_relative_at_diagnosis","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","displayName":"Age Of Relative At Diagnosis"}},"cancer_type_code_of_relative":{"changeType":"deleted","name":"cancer_type_code_of_relative","valueType":"string","description":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"examples":"C41.1,C16.9,C00.5,D46.9","dependsOn":"family_history.relative_with_cancer_history","displayName":"Cancer Type Code (ICD-10) of Relative"}},"relative_vital_status":{"changeType":"deleted","description":"Relative's last known state of living or deceased.","name":"relative_vital_status","restrictions":{"codeList":["Alive","Deceased","Unknown"]},"valueType":"string","meta":{"displayName":"Vital Status of Relative"}},"cause_of_death_of_relative":{"changeType":"deleted","description":"Indicate the cause of the death of the relative.","name":"cause_of_death_of_relative","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]},"valueType":"string","meta":{"dependsOn":"family_history.relative_vital_status","displayName":"Cause of Death of Relative"}},"relative_survival_time":{"changeType":"deleted","description":"Indicate how long, in days, the relative survived from the time they were diagnosed with cancer.","name":"relative_survival_time","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","units":"days","displayName":"Survival Time Of Relative"}}}},"biomarker":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"deleted","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"deleted","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"deleted","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"deleted","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"deleted","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"deleted","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"deleted","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"deleted","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"deleted","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"deleted","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"deleted","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"deleted","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"deleted","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"deleted","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"deleted","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"deleted","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}}},"comorbidity":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"deleted","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"deleted","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"deleted","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"deleted","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"deleted","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"deleted","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}}}}} diff --git a/website/static/data/schemas/diffs/1.24/1.24-diff-1.7.json b/website/static/data/schemas/diffs/1.24/1.24-diff-1.7.json new file mode 100644 index 00000000..9aac1793 --- /dev/null +++ b/website/static/data/schemas/diffs/1.24/1.24-diff-1.7.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":[],"deleted":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n const row = $row;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n const designation = row.tumour_normal_designation.trim().toLowerCase();\r\n const specimen_type = $field.trim().toLowerCase();\r\n \r\n if (designation === \"normal\"){\r\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\r\n if (!validTypes.includes(specimen_type)){\r\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when tumour_normal_designation is set to Normal.\"};\r\n }\r\n }\r\n else if (designation === \"tumour\") {\r\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\r\n if (invalidTypes.includes(specimen_type)){\r\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when tumour_normal_designation is set to Tumour.\"};\r\n }\r\n }\r\n return result;\r\n })"]}}},"submitter_sample_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased"],"right":["Alive","Deceased","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"cause_of_death":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n const vitalStatus = $row.vital_status.trim().toLowerCase();\r\n \r\n if (!currField && vitalStatus === \"deceased\"){\r\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\r\n }\r\n else if (currField && vitalStatus != \"deceased\"){\r\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\r\n }\r\n return result;\r\n })"]}}},"survival_time":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n const vitalStatus = $row.vital_status.trim().toLowerCase();\r\n \r\n if (!currField && vitalStatus === \"deceased\"){\r\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\r\n }\r\n else if (currField && vitalStatus != \"deceased\"){\r\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\r\n }\r\n return result;\r\n })"]},"range":{"left":{"exclusiveMin":0},"right":null}}},"primary_site":{"meta":{"notes":{"left":"To include multiple values, separate values with a pipe delimiter '|' within your file.","right":null},"examples":{"left":"Breast|Ovary","right":null}},"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Not Reported","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva","Unknown"],"data":{"added":["Not Reported","Unknown"],"deleted":["Unknown primary site"]}}}},"height":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"weight":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"bmi":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)","right":"Indicate the donor's age of menarche, the first occurrence of menstruation."},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"number_of_pregnancies":{"description":{"left":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)","right":"Indicate the number of pregnancies a donor has had."},"restrictions":{"range":{"left":{"min":0},"right":null}}},"number_of_children":{"description":{"left":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)","right":"Indicate the number of children the donor has birthed."},"restrictions":{"range":{"left":{"min":0},"right":null}}}},"created":{},"deleted":{"genetic_disorders":{"changeType":"deleted","description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},"hrt_type":{"changeType":"deleted","description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},"hrt_duration":{"changeType":"deleted","description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},"contraception_type":{"changeType":"deleted","description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},"contraception_duration":{"changeType":"deleted","description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},"lost_to_followup_after_clinical_event_id":{"changeType":"deleted","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}}},"specimen":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"pathological_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\r\n\r\n \r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\r\n if (!($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n /* This is not a required field, so first ensure that it exists */\r\n else if ($field) {\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"pathological_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"pathological_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"pathological_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_stage_group')[0];\r\n\r\n const stagingSystem = stagingName + `_tumour_staging_system`;\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\r\n result.valid = false;\r\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\r\n result.message = msg;\r\n }\r\n else if (!($row[stagingSystem]) && $field) {\r\n result.valid = false;\r\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\r\n result.message = msg;\r\n }\r\n else if ($row[stagingSystem] && $field) {\r\n let codeList = [];\r\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb',\r\n 'stage ive',\r\n 'stage ivs'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\r\n $row[stagingSystem]\r\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n \r\n return result;\r\n })"]}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"data":{"added":[],"deleted":["Unknown"]}}}},"specimen_storage":{"description":{"left":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured.","right":"Indicate the method of specimen storage for specimens that were not extracted freshly or immediately cultured."},"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"data":{"added":[],"deleted":["Unknown"]}}}},"reference_pathology_confirmed":{"description":{"left":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)","right":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist."}},"tumour_grading_system":{"meta":{"validationDependency":{"left":true,"right":null}}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.tumour_grading_system && $field) {\r\n let codeList = [];\r\n const tieredGradingList = ['gx','g1','g2','g3'];\r\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\r\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\r\n case 'two-tier grading system':\r\n codeList = [\r\n 'low grade',\r\n 'high grade',\r\n ];\r\n break;\r\n case 'three-tier grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'four-tier grading system':\r\n codeList = [\r\n 'gx',\r\n 'g1',\r\n 'g2',\r\n 'g3',\r\n 'g4',\r\n ];\r\n break;\r\n case 'grading system for gists':\r\n codeList = [\r\n 'low',\r\n 'high',\r\n ];\r\n break;\r\n case 'grading system for gnets':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'isup grading system':\r\n codeList = [\r\n 'gx',\r\n 'g1',\r\n 'g2',\r\n 'g3',\r\n 'g4',\r\n ];\r\n break;\r\n case 'who grading system for cns tumours':\r\n codeList = [\r\n 'grade i',\r\n 'grade ii',\r\n 'grade iii',\r\n 'grade iv',\r\n ];\r\n break;\r\n case 'fnclcc grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'gleason grade group system':\r\n codeList = [\r\n 'grade group 1',\r\n 'grade group 2',\r\n 'grade group 3',\r\n 'grade group 4',\r\n 'grade group 5',\r\n ];\r\n break;\r\n case 'scarff-bloom-richardson grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'nuclear grading system for dcis':\r\n codeList = tieredGradingList;\r\n break;\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase())) {\r\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\r\n $row.tumour_grading_system\r\n }', 'tumour_grade' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\r\n result.valid = false;\r\n const msg = \"'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.\";\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })"]}}},"percent_tumour_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)","right":"Indicate a value, in decimals, that represents the percentage of infiltration by tumour cells in a specimen."},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null},"script":{"left":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"],"right":null}}},"percent_proliferating_cells":{"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_inflammatory_tissue":{"description":{"left":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)","right":"Indicate a value, in decimals, that represents local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_stromal_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)","right":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a malignant tumour specimen but are not malignant such as fibroblasts, vascular structures, etc."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_necrosis":{"description":{"left":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)","right":"Indicate a value, in decimals, that represents the percentage of cell death in a malignant tumour specimen."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}}},"created":{},"deleted":{"specimen_laterality":{"changeType":"deleted","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"percent_tumour_cells_measurement_method":{"changeType":"deleted","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"age_at_diagnosis":{"restrictions":{"range":{"left":{"exclusiveMin":0,"max":90},"right":null}}},"number_lymph_nodes_examined":{"meta":{"dependsOn":{"left":"primary_diagnosis.lymph_nodes_examined_status","right":null},"notes":{"left":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":null},"range":{"left":{"min":0},"right":null}}},"number_lymph_nodes_positive":{"meta":{"dependsOn":{"left":"primary_diagnosis.lymph_nodes_examined_status","right":null},"notes":{"left":"This field is only required if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"],"right":null},"range":{"left":{"min":0},"right":null},"required":{"left":null,"right":true}}},"clinical_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\r\n\r\n \r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\r\n if (!($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n /* This is not a required field, so first ensure that it exists */\r\n else if ($field) {\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"clinical_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"clinical_n_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null}}},"clinical_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"clinical_stage_group":{"description":{"left":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage.","right":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.)."},"meta":{"examples":{"left":"Stage I, Stage IIB","right":null}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_stage_group')[0];\r\n\r\n const stagingSystem = stagingName + `_tumour_staging_system`;\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\r\n result.valid = false;\r\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\r\n result.message = msg;\r\n }\r\n else if (!($row[stagingSystem]) && $field) {\r\n result.valid = false;\r\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\r\n result.message = msg;\r\n }\r\n else if ($row[stagingSystem] && $field) {\r\n let codeList = [];\r\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb',\r\n 'stage ive',\r\n 'stage ivs'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\r\n $row[stagingSystem]\r\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n \r\n return result;\r\n })"]}}},"performance_status":{"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"data":{"added":[],"deleted":["Unknown"]}}}}},"created":{},"deleted":{"laterality":{"changeType":"deleted","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_status":{"changeType":"deleted","name":"lymph_nodes_examined_status","description":"Indicate if lymph nodes were examined for metastases.","valueType":"string","restrictions":{"required":true,"codeList":["Cannot be determined","No","No lymph nodes found in resected specimen","Not applicable","Yes"]},"meta":{"core":true,"displayName":"Lymph Nodes Examined Status"}},"lymph_nodes_examined_method":{"changeType":"deleted","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}}},"treatment":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":[],"deleted":["End of life care"]}}}},"is_primary_treatment":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"codeList":{"left":["Yes","No"],"right":["Yes","No","Unknown"],"data":{"added":["Unknown"],"deleted":[]}},"required":{"left":null,"right":true}}},"line_of_treatment":{"meta":{"dependsOn":{"left":"treatment.is_primary_treatment","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"],"right":null}}},"treatment_start_interval":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"treatment_duration":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null},"required":{"left":null,"right":true}}},"days_per_cycle":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null}}},"number_of_cycles":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"range":{"left":{"exclusiveMin":0},"right":null}}},"treatment_intent":{"description":{"left":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","right":"Indicate the intended disease outcome for which the treatment is given. (Reference: NCIt C124307)"},"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"codeList":{"left":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"],"right":["Curative","Palliative","Unknown"],"data":{"added":["Unknown"],"deleted":["Diagnostic","Forensic","Guidance","Preventative","Screening","Supportive"]}},"required":{"left":null,"right":true}}},"treatment_setting":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null},"codeList":{"left":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"],"right":["Adjuvant","Advanced/Metastatic","Neoadjuvant","Not applicable"],"data":{"added":["Not applicable"],"deleted":["Conditioning","Induction","Maintenance","Mobilization","Preventative","Radiosensitization","Salvage"]}},"required":{"left":null,"right":true}}},"response_to_treatment":{"description":{"left":"The donor's response to the applied treatment regimen.","right":"The donor's response to the applied treatment regimen. (Source: RECIST)"},"meta":{"dependsOn":{"left":"treatment.response_to_treatment_criteria_method","right":null},"notes":{"left":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"right":null},"codeList":{"left":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"],"right":["Complete response","Disease progression","NED","Partial response","Stable disease"],"data":{"added":["Disease progression","NED"],"deleted":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease"]}},"required":{"left":null,"right":true}}},"outcome_of_treatment":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null}}},"toxicity_type":{"description":{"left":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity.","right":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hemotological toxicity or non-hemotological toxicity."},"meta":{"dependsOn":{"left":"treatment.outcome_of_treatment","right":null}},"restrictions":{"codeList":{"left":["Hematological","Non-hematological","Not applicable","Unknown"],"right":["Hemotological","Non-hemotological"],"data":{"added":["Hemotological","Non-hemotological"],"deleted":["Hematological","Non-hematological","Not applicable","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"],"right":null}}},"adverse_events":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"codeList":{"left":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"right":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"data":{"added":[],"deleted":["None","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null}}},"clinical_trials_database":{"meta":{"notes":{"left":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added.","right":null}},"restrictions":{"codeList":{"left":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"],"right":["NCI Clinical Trials","EU Clinical Trials Register"],"data":{"added":[],"deleted":["Not applicable","Unknown"]}}}},"clinical_trial_number":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n //regex check for clinical trial number\r\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\r\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\r\n\r\n // list of valid clinical trial databases\r\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\r\n \r\n if ($row.clinical_trials_database && $field) {\r\n const trialNumber = $field.trim();\r\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\r\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\r\n result = {valid: false, message: 'The submitted NCI clinical trial number is in incorrect format.'};\r\n }\r\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\r\n result = {valid: false, message: \"The submitted EudraCT clinical trial number is in incorrect format.\"};\r\n }\r\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\r\n result = {valid: false, message: \"The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database.\"};\r\n }\r\n }\r\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\r\n result = {valid: true, message: \"Ok\"};\r\n }\r\n else if ($row.clinical_trials_database && !$field) {\r\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\r\n result = {valid: false, message: \"'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.\"};\r\n } \r\n }\r\n return result;\r\n })"]}}}},"created":{"hemotological_toxicity":{"changeType":"created","name":"hemotological_toxicity","description":"Indicate the hemotological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5"]},"meta":{"displayName":"Hemotological Toxicity","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"response_to_treatment_criteria_method":{"changeType":"deleted","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},"hematological_toxicity":{"changeType":"deleted","name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"non-hematological_toxicity":{"changeType":"deleted","name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"chemotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"dependsOn":{"left":"chemotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"description":{"left":"Name of agent or drug administered to donor as part of the treatment regimen.","right":"Name of agent or drug administered to patient as part of the treatment regimen."},"meta":{"dependsOn":{"left":"chemotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"chemotherapy_dosage_units":{"changeType":"created","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate the total actual drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"deleted","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"deleted","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"deleted","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"deleted","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"description":{"left":"Name of agent or drug administered to donor as part of the treatment regimen.","right":"Name of agent or drug administered to patient as part of the treatment regimen."},"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"hormone_drug_dosage_units":{"changeType":"created","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"deleted","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"radiation":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"radiation_therapy_fractions":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"radiation_therapy_dosage":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"anatomical_site_irradiated":{"description":{"left":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)","right":"Indicate localization site where radiation therapy was administered."},"restrictions":{"codeList":{"left":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"right":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"data":{"added":["Bone","Extremities","Head-Neck","Peritoneum"],"deleted":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"]}}}}},"created":{},"deleted":{"radiation_boost":{"changeType":"deleted","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"deleted","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}}},"immunotherapy":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"immunotherapy_type":{"changeType":"deleted","name":"immunotherapy_type","valueType":"string","description":"Indicate the type of immunotherapy administered to donor.","meta":{"displayName":"Immunotherapy Type","core":true},"restrictions":{"required":true,"codeList":["Cell-based","Immune checkpoint inhibitors","Monoclonal antibodies other than immune checkpoint inhibitors","Other immunomodulatory substances"]}},"drug_rxnormcui":{"changeType":"deleted","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"deleted","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"deleted","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"surgery":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"deleted","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"deleted","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"deleted","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"deleted","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"deleted","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"deleted","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"deleted","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"deleted","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"deleted","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"deleted","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"deleted","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"deleted","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"deleted","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"deleted","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}}},"follow_up":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_follow_up_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"treatment.submitter_treatment_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"weight_at_followup":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"relapse_type":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })"]}}},"relapse_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const intervalOfFollowup = parseInt($row.interval_of_followup);\r\n\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n relapseInterval = parseInt($field);\r\n if (relapseInterval > intervalOfFollowup) {\r\n result = {valid: false, message: `'${$name}' cannot be greater than the 'interval_of_followup'.` }\r\n }\r\n }\r\n return result;\r\n })"]}}},"method_of_progression_status":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\r\n\r\n \r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\r\n if (!($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n /* This is not a required field, so first ensure that it exists */\r\n else if ($field) {\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })","(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })"]}}},"recurrence_t_category":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"recurrence_n_category":{"meta":{"core":{"left":null,"right":true}}},"recurrence_m_category":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"recurrence_stage_group":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_stage_group')[0];\r\n\r\n const stagingSystem = stagingName + `_tumour_staging_system`;\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\r\n result.valid = false;\r\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\r\n result.message = msg;\r\n }\r\n else if (!($row[stagingSystem]) && $field) {\r\n result.valid = false;\r\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\r\n result.message = msg;\r\n }\r\n else if ($row[stagingSystem] && $field) {\r\n let codeList = [];\r\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb',\r\n 'stage ive',\r\n 'stage ivs'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\r\n $row[stagingSystem]\r\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n \r\n return result;\r\n })"]}}},"posttherapy_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\r\n\r\n \r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\r\n if (!($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n /* This is not a required field, so first ensure that it exists */\r\n else if ($field) {\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"posttherapy_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"posttherapy_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"posttherapy_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"data":{"added":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"],"deleted":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_stage_group')[0];\r\n\r\n const stagingSystem = stagingName + `_tumour_staging_system`;\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\r\n result.valid = false;\r\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\r\n result.message = msg;\r\n }\r\n else if (!($row[stagingSystem]) && $field) {\r\n result.valid = false;\r\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\r\n result.message = msg;\r\n }\r\n else if ($row[stagingSystem] && $field) {\r\n let codeList = [];\r\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb',\r\n 'stage ive',\r\n 'stage ivs'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\r\n $row[stagingSystem]\r\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n \r\n return result;\r\n })"]}}}},"created":{"anatomic_site_progression_or_recurrences":{"changeType":"created","description":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1,C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}}},"deleted":{"anatomic_site_progression_or_recurrence":{"changeType":"deleted","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"exposure":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"deleted","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"deleted","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"deleted","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"deleted","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"deleted","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"deleted","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"deleted","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"deleted","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"deleted","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"deleted","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"deleted","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}}},"family_history":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"family_relative_id":{"changeType":"deleted","description":"Unique identifier of the relative, assigned by the data provider.","name":"family_relative_id","valueType":"string","meta":{"displayName":"Family Relative ID","primaryId":true,"notes":"This field is required to ensure that family members are identified in unique records. Ids can be as simple as an incremented numeral to ensure uniqueness."},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"relative_with_cancer_history":{"changeType":"deleted","description":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","name":"relative_with_cancer_history","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Relative with Cancer History"}},"relationship_type":{"changeType":"deleted","description":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","name":"relationship_type","restrictions":{"codeList":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"]},"valueType":"string","meta":{"displayName":"Relationship Type"}},"gender_of_relative":{"changeType":"deleted","description":"The self-reported gender of related individual.","name":"gender_of_relative","restrictions":{"codeList":["Female","Male","Other","Unknown"]},"valueType":"string","meta":{"displayName":"Gender of Relative"}},"age_of_relative_at_diagnosis":{"changeType":"deleted","description":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","name":"age_of_relative_at_diagnosis","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","displayName":"Age Of Relative At Diagnosis"}},"cancer_type_code_of_relative":{"changeType":"deleted","name":"cancer_type_code_of_relative","valueType":"string","description":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"examples":"C41.1,C16.9,C00.5,D46.9","dependsOn":"family_history.relative_with_cancer_history","displayName":"Cancer Type Code (ICD-10) of Relative"}},"relative_vital_status":{"changeType":"deleted","description":"Relative's last known state of living or deceased.","name":"relative_vital_status","restrictions":{"codeList":["Alive","Deceased","Unknown"]},"valueType":"string","meta":{"displayName":"Vital Status of Relative"}},"cause_of_death_of_relative":{"changeType":"deleted","description":"Indicate the cause of the death of the relative.","name":"cause_of_death_of_relative","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]},"valueType":"string","meta":{"dependsOn":"family_history.relative_vital_status","displayName":"Cause of Death of Relative"}},"relative_survival_time":{"changeType":"deleted","description":"Indicate how long, in days, the relative survived from the time they were diagnosed with cancer.","name":"relative_survival_time","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","units":"days","displayName":"Survival Time Of Relative"}}}},"biomarker":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"deleted","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"deleted","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"deleted","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"deleted","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"deleted","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"deleted","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"deleted","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"deleted","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"deleted","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"deleted","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"deleted","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"deleted","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"deleted","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"deleted","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"deleted","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"deleted","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}}},"comorbidity":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"deleted","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"deleted","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"deleted","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"deleted","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"deleted","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"deleted","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}}}}} diff --git a/website/static/data/schemas/diffs/1.24/1.24-diff-1.8.json b/website/static/data/schemas/diffs/1.24/1.24-diff-1.8.json new file mode 100644 index 00000000..1aca340c --- /dev/null +++ b/website/static/data/schemas/diffs/1.24/1.24-diff-1.8.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":[],"deleted":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"]}}}},"submitter_sample_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased"],"right":["Alive","Deceased","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"survival_time":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"primary_site":{"meta":{"notes":{"left":"To include multiple values, separate values with a pipe delimiter '|' within your file.","right":null},"examples":{"left":"Breast|Ovary","right":null}},"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Not Reported","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva","Unknown"],"data":{"added":["Not Reported","Unknown"],"deleted":["Unknown primary site"]}}}},"height":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"weight":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"bmi":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)","right":"Indicate the donor's age of menarche, the first occurrence of menstruation."},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"number_of_pregnancies":{"description":{"left":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)","right":"Indicate the number of pregnancies a donor has had."},"restrictions":{"range":{"left":{"min":0},"right":null}}},"number_of_children":{"description":{"left":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)","right":"Indicate the number of children the donor has birthed."},"restrictions":{"range":{"left":{"min":0},"right":null}}}},"created":{},"deleted":{"genetic_disorders":{"changeType":"deleted","description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},"hrt_type":{"changeType":"deleted","description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},"hrt_duration":{"changeType":"deleted","description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},"contraception_type":{"changeType":"deleted","description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},"contraception_duration":{"changeType":"deleted","description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},"lost_to_followup_after_clinical_event_id":{"changeType":"deleted","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}}},"specimen":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"pathological_tumour_staging_system":{"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"pathological_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"pathological_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"pathological_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS"],"data":{"added":[],"deleted":["Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n \n return result;\n })"]}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"data":{"added":[],"deleted":["Unknown"]}}}},"specimen_storage":{"description":{"left":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured.","right":"Indicate the method of specimen storage for specimens that were not extracted freshly or immediately cultured."},"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"data":{"added":[],"deleted":["Unknown"]}}}},"reference_pathology_confirmed":{"description":{"left":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)","right":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist."}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"percent_tumour_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)","right":"Indicate a value, in decimals, that represents the percentage of infiltration by tumour cells in a specimen."},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null},"script":{"left":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"],"right":null}}},"percent_proliferating_cells":{"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_inflammatory_tissue":{"description":{"left":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)","right":"Indicate a value, in decimals, that represents local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_stromal_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)","right":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a malignant tumour specimen but are not malignant such as fibroblasts, vascular structures, etc."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}},"percent_necrosis":{"description":{"left":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)","right":"Indicate a value, in decimals, that represents the percentage of cell death in a malignant tumour specimen."},"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}},"restrictions":{"range":{"left":{"min":0,"max":1},"right":null}}}},"created":{},"deleted":{"specimen_laterality":{"changeType":"deleted","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"percent_tumour_cells_measurement_method":{"changeType":"deleted","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"age_at_diagnosis":{"restrictions":{"range":{"left":{"exclusiveMin":0,"max":90},"right":null}}},"number_lymph_nodes_examined":{"meta":{"notes":{"left":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'.","right":null}},"restrictions":{"range":{"left":{"min":0},"right":null}}},"number_lymph_nodes_positive":{"restrictions":{"range":{"left":{"min":0},"right":null}}},"clinical_tumour_staging_system":{"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"clinical_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"clinical_n_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null}}},"clinical_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"clinical_stage_group":{"description":{"left":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage.","right":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.)."},"meta":{"examples":{"left":"Stage I, Stage IIB","right":null}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS"],"data":{"added":[],"deleted":["Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n \n return result;\n })"]}}},"performance_status":{"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"data":{"added":[],"deleted":["Unknown"]}}}}},"created":{},"deleted":{"laterality":{"changeType":"deleted","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_method":{"changeType":"deleted","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}}},"treatment":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":[],"deleted":["End of life care"]}}}},"is_primary_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Yes","No"],"right":["Yes","No","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"line_of_treatment":{"meta":{"dependsOn":{"left":"treatment.is_primary_treatment","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"treatment_start_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"treatment_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]}}},"days_per_cycle":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]}}},"number_of_cycles":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_intent":{"description":{"left":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","right":"Indicate the intended disease outcome for which the treatment is given. (Reference: NCIt C124307)"},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"],"right":["Curative","Palliative","Unknown"],"data":{"added":["Unknown"],"deleted":["Diagnostic","Forensic","Guidance","Preventative","Screening","Supportive"]}}}},"treatment_setting":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"],"right":["Adjuvant","Advanced/Metastatic","Neoadjuvant","Not applicable"],"data":{"added":["Not applicable"],"deleted":["Conditioning","Induction","Maintenance","Mobilization","Preventative","Radiosensitization","Salvage"]}}}},"response_to_treatment":{"description":{"left":"The donor's response to the applied treatment regimen.","right":"The donor's response to the applied treatment regimen. (Source: RECIST)"},"meta":{"dependsOn":{"left":"treatment.response_to_treatment_criteria_method","right":"treatment.treatment_type"},"notes":{"left":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"],"right":["Complete response","Disease progression","NED","Partial response","Stable disease"],"data":{"added":["Disease progression","NED"],"deleted":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease"]}}}},"outcome_of_treatment":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":null}}},"toxicity_type":{"description":{"left":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity.","right":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hemotological toxicity or non-hemotological toxicity."},"meta":{"dependsOn":{"left":"treatment.outcome_of_treatment","right":null}},"restrictions":{"codeList":{"left":["Hematological","Non-hematological","Not applicable","Unknown"],"right":["Hemotological","Non-hemotological"],"data":{"added":["Hemotological","Non-hemotological"],"deleted":["Hematological","Non-hematological","Not applicable","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]}}},"adverse_events":{"meta":{"dependsOn":{"left":"treatment.treatment_type","right":null}},"restrictions":{"codeList":{"left":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"right":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"data":{"added":[],"deleted":["None","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]}}},"clinical_trials_database":{"meta":{"notes":{"left":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added.","right":null}},"restrictions":{"codeList":{"left":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"],"right":["NCI Clinical Trials","EU Clinical Trials Register"],"data":{"added":[],"deleted":["Not applicable","Unknown"]}}}},"clinical_trial_number":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"]}}}},"created":{"hemotological_toxicity":{"changeType":"created","name":"hemotological_toxicity","description":"Indicate the hemotological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"response_to_treatment_criteria_method":{"changeType":"deleted","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},"hematological_toxicity":{"changeType":"deleted","name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"non-hematological_toxicity":{"changeType":"deleted","name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"chemotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"dependsOn":{"left":"chemotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"description":{"left":"Name of agent or drug administered to donor as part of the treatment regimen.","right":"Name of agent or drug administered to patient as part of the treatment regimen."},"meta":{"dependsOn":{"left":"chemotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"chemotherapy_dosage_units":{"changeType":"created","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate the total actual drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"deleted","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"deleted","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"deleted","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"deleted","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"description":{"left":"Name of agent or drug administered to donor as part of the treatment regimen.","right":"Name of agent or drug administered to patient as part of the treatment regimen."},"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"hormone_drug_dosage_units":{"changeType":"created","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"deleted","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"radiation":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"radiation_therapy_fractions":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"radiation_therapy_dosage":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"anatomical_site_irradiated":{"description":{"left":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)","right":"Indicate localization site where radiation therapy was administered."},"restrictions":{"codeList":{"left":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"right":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"data":{"added":["Bone","Extremities","Head-Neck","Peritoneum"],"deleted":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"]}}}}},"created":{},"deleted":{"radiation_boost":{"changeType":"deleted","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"deleted","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}}},"immunotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"immunotherapy_type":{"description":{"left":"Indicate the type of immunotherapy administered to donor.","right":"Indicate the type of immunotherapy administered to patient."},"meta":{"core":{"left":true,"right":null}},"restrictions":{"required":{"left":true,"right":null}}},"drug_rxnormcui":{"meta":{"dependsOn":{"left":"immunotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"description":{"left":"Name of agent or drug administered to donor as part of the treatment regimen.","right":"Name of agent or drug administered to patient as part of the treatment regimen."},"meta":{"dependsOn":{"left":"immunotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"},"displayName":{"left":"Chemotherapy Drug Name","right":"Immunotherapy Drug Name"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"deleted","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"surgery":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"deleted","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"deleted","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"deleted","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"deleted","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"deleted","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"deleted","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"deleted","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"deleted","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"deleted","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"deleted","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"deleted","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"deleted","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"deleted","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"deleted","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}}},"follow_up":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_follow_up_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"interval_of_followup":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"treatment.submitter_treatment_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"weight_at_followup":{"valueType":{"left":"number","right":"integer"},"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"relapse_type":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"]}}},"relapse_interval":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"method_of_progression_status":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"]}}},"recurrence_t_category":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"recurrence_n_category":{"meta":{"core":{"left":null,"right":true}}},"recurrence_m_category":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"recurrence_stage_group":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS"],"data":{"added":[],"deleted":["Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n \n return result;\n })"]}}},"posttherapy_tumour_staging_system":{"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"posttherapy_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"posttherapy_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"posttherapy_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS"],"data":{"added":[],"deleted":["Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n \n return result;\n })"]}}}},"created":{"anatomic_site_progression_or_recurrences":{"changeType":"created","description":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1,C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}}},"deleted":{"anatomic_site_progression_or_recurrence":{"changeType":"deleted","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"exposure":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"deleted","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"deleted","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"deleted","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"deleted","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"deleted","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"deleted","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"deleted","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"deleted","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"deleted","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"deleted","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"deleted","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}}},"family_history":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"family_relative_id":{"meta":{"primaryId":{"left":true,"right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"relative_with_cancer_history":{"description":{"left":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","right":"Indicate if patient has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)"}},"relationship_type":{"description":{"left":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","right":"Indicate genetic relationship of the relative to patient. (Reference: caDSR CDE ID 2179937)"},"restrictions":{"codeList":{"left":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"],"right":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Sister","Son","Unknown"],"data":{"added":[],"deleted":["Maternal Uncle","Paternal Uncle","Uncle"]}}}},"age_of_relative_at_diagnosis":{"description":{"left":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","right":"The age (in years) when the patient's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)"},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}},"cancer_type_code_of_relative":{"description":{"left":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","right":"The code to describe the malignant diagnosis of the patient's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification."},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}},"relative_survival_time":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}}},"created":{},"deleted":{}},"biomarker":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"deleted","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"deleted","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"deleted","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"deleted","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"deleted","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"deleted","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"deleted","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"deleted","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"deleted","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"deleted","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"deleted","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"deleted","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"deleted","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"deleted","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"deleted","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"deleted","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}}},"comorbidity":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"deleted","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"deleted","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"deleted","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"deleted","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"deleted","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"deleted","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}}}}} diff --git a/website/static/data/schemas/diffs/1.24/1.24-diff-1.9.json b/website/static/data/schemas/diffs/1.24/1.24-diff-1.9.json new file mode 100644 index 00000000..20142289 --- /dev/null +++ b/website/static/data/schemas/diffs/1.24/1.24-diff-1.9.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":[],"deleted":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"]}}}},"submitter_sample_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased"],"right":["Alive","Deceased","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"primary_site":{"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva"],"data":{"added":[],"deleted":["Unknown primary site"]}}}},"genetic_disorders":{"description":{"left":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","right":"Indicate presence of any hereditary genetic disorders. (Reference: Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)"},"restrictions":{"codeList":{"left":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"],"right":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Serrated Polyposis Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"],"data":{"added":[],"deleted":["None","Not applicable","Unknown"]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)","right":"Indicate the donor's age at which the first menstruation event occurred. (Reference: NCIt C19666)"}},"hrt_type":{"description":{"left":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","right":"Indicate the type of hormone replacement therapy (HRT) the patient has taken or is currently taking."},"restrictions":{"codeList":{"left":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"],"right":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Other","Patch","Pill","Unknown"],"data":{"added":[],"deleted":["Not applicable"]}}}},"hrt_duration":{"description":{"left":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","right":"If patient has taken hormone replacement therapy (HRT), indicate how long patient has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)"},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\") {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If '${$name}' is submitted, then '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n\n }\n return result;\n })"]}}},"contraception_type":{"description":{"left":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","right":"Indicate the type of hormonal contraception the patient has taken or is currently taking. (Reference: caDSR CDE ID 3264234)"},"restrictions":{"codeList":{"left":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"],"right":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Other","Progestin-only pill","Unknown","Vaginal ring"],"data":{"added":[],"deleted":["Not applicable","Oral contraceptive pill"]}}}},"contraception_duration":{"description":{"left":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","right":"If patient has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)"},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\") {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If '${$name}' is submitted, then '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n\n }\n return result;\n })"]}}}},"created":{},"deleted":{"lost_to_followup_after_clinical_event_id":{"changeType":"deleted","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}}},"specimen":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"pathological_tumour_staging_system":{"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"pathological_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"pathological_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"pathological_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS"],"data":{"added":[],"deleted":["Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n \n return result;\n })"]}}},"specimen_acquisition_interval":{"restrictions":{"range":{"left":null,"right":{"min":0}}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"data":{"added":[],"deleted":["Unknown"]}}}},"specimen_storage":{"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"data":{"added":[],"deleted":["Unknown"]}}}},"reference_pathology_confirmed":{"description":{"left":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)","right":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist."}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"percent_tumour_cells":{"restrictions":{"script":{"left":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"],"right":null}}},"percent_proliferating_cells":{"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}}},"percent_inflammatory_tissue":{"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}}},"percent_stromal_cells":{"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}}},"percent_necrosis":{"meta":{"notes":{"left":"This field should only be submitted if the specimen is tumour.","right":""}}}},"created":{},"deleted":{"specimen_laterality":{"changeType":"deleted","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"percent_tumour_cells_measurement_method":{"changeType":"deleted","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"number_lymph_nodes_examined":{"meta":{"notes":{"left":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'.","right":null}}},"clinical_tumour_staging_system":{"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"clinical_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"clinical_n_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null}}},"clinical_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"clinical_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS"],"data":{"added":[],"deleted":["Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n \n return result;\n })"]}}},"performance_status":{"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"data":{"added":[],"deleted":["Unknown"]}}}}},"created":{},"deleted":{"laterality":{"changeType":"deleted","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_method":{"changeType":"deleted","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}}},"treatment":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":[],"deleted":["End of life care"]}}}},"is_primary_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Yes","No"],"right":["Yes","No","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"line_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'unknown') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'unknown'.`};\n }\n }\n return result;\n })"]}}},"treatment_start_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"treatment_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]}}},"days_per_cycle":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]}}},"number_of_cycles":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_intent":{"description":{"left":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)","right":"Indicate the intended disease outcome for which the treatment is given. (Reference: NCIt C124307)"},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"],"right":["Curative","Palliative","Unknown"],"data":{"added":["Unknown"],"deleted":["Diagnostic","Forensic","Guidance","Preventative","Screening","Supportive"]}}}},"treatment_setting":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"],"right":["Adjuvant","Advanced/Metastatic","Neoadjuvant","Not applicable"],"data":{"added":["Not applicable"],"deleted":["Conditioning","Induction","Maintenance","Mobilization","Preventative","Radiosensitization","Salvage"]}}}},"response_to_treatment":{"description":{"left":"The donor's response to the applied treatment regimen.","right":"The donor's response to the applied treatment regimen. (Source: RECIST)"},"meta":{"dependsOn":{"left":"treatment.response_to_treatment_criteria_method","right":"treatment.treatment_type"},"notes":{"left":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria","right":null}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"],"right":["Complete response","Disease progression","NED","Partial response","Stable disease"],"data":{"added":["Disease progression","NED"],"deleted":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease"]}}}},"outcome_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]}}},"toxicity_type":{"restrictions":{"codeList":{"left":["Hematological","Non-hematological","Not applicable","Unknown"],"right":["Hematological","Non-hematological"],"data":{"added":[],"deleted":["Not applicable","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n \n /* toxicityType should only be submitted if treatment was terminated early due to acute toxicity ('outcome_of_treatment' is 'Treatment stopped due to acute toxicity'). */\n if (outcomeOfTreatment != \"treatment stopped due to acute toxicity\") {\n result = { valid: false, message: `The 'outcome_of_treatment' field should be 'Treatment stopped due to acute toxicity' if the '${$name}' field is submitted.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"]}}},"hematological_toxicity":{"restrictions":{"codeList":{"left":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"right":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5"],"data":{"added":[],"deleted":["Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n if (($row.toxicity_type != null && !(checkforEmpty($row.toxicity_type)))) { \n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n \n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}},"non-hematological_toxicity":{"restrictions":{"codeList":{"left":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"right":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"data":{"added":[],"deleted":["Unknown"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n if (($row.toxicity_type != null && !(checkforEmpty($row.toxicity_type)))) { \n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n \n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}},"adverse_events":{"restrictions":{"codeList":{"left":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"right":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"data":{"added":[],"deleted":["None","Unknown"]}},"script":{"left":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]}}},"clinical_trials_database":{"meta":{"notes":{"left":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added.","right":null}},"restrictions":{"codeList":{"left":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"],"right":["NCI Clinical Trials","EU Clinical Trials Register"],"data":{"added":[],"deleted":["Not applicable","Unknown"]}}}},"clinical_trial_number":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"]}}}},"created":{},"deleted":{"response_to_treatment_criteria_method":{"changeType":"deleted","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}}}},"chemotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"dependsOn":{"left":"chemotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"dependsOn":{"left":"chemotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"chemotherapy_dosage_units":{"changeType":"created","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate the total actual drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true,"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"deleted","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"deleted","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"deleted","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"deleted","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"drug_rxnormcui":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"validationDependency":{"left":true,"right":null},"dependsOn":{"left":"hormone_therapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{"hormone_drug_dosage_units":{"changeType":"created","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"created","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true,"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"deleted","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"radiation":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"radiation_therapy_dosage":{"valueType":{"left":"number","right":"integer"}},"anatomical_site_irradiated":{"description":{"left":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)","right":"Indicate localization site where radiation therapy was administered."},"restrictions":{"codeList":{"left":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"right":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"data":{"added":["Bone","Extremities","Head-Neck","Peritoneum"],"deleted":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"]}}}}},"created":{},"deleted":{"radiation_boost":{"changeType":"deleted","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"deleted","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}}},"immunotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"immunotherapy_type":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"required":{"left":true,"right":null}}},"drug_rxnormcui":{"meta":{"dependsOn":{"left":"immunotherapy.drug_database","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}},"drug_name":{"meta":{"dependsOn":{"left":"immunotherapy.drug_rxnormcui","right":null},"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin"},"displayName":{"left":"Chemotherapy Drug Name","right":"Immunotherapy Drug Name"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"right":null},"required":{"left":null,"right":true}}}},"created":{},"deleted":{"drug_database":{"changeType":"deleted","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"deleted","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"deleted","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"deleted","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"deleted","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"deleted","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}}},"surgery":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"deleted","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"deleted","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"deleted","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"deleted","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"deleted","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"deleted","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"deleted","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"deleted","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"deleted","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"deleted","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"deleted","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"deleted","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"deleted","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"deleted","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}}},"follow_up":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_follow_up_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"interval_of_followup":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"primary_diagnosis.submitter_primary_diagnosis_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":true,"right":null},"foreignKey":{"left":"treatment.submitter_treatment_id","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"relapse_type":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"]}}},"relapse_interval":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"method_of_progression_status":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"]}}},"recurrence_t_category":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"recurrence_n_category":{"meta":{"core":{"left":null,"right":true}}},"recurrence_m_category":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"recurrence_stage_group":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS"],"data":{"added":[],"deleted":["Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n \n return result;\n })"]}}},"posttherapy_tumour_staging_system":{"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"data":{"added":["Revised International staging system (RISS)"],"deleted":["AJCC 6th edition","Revised International staging system (R-ISS)"]}}}},"posttherapy_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":[],"deleted":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"]}}}},"posttherapy_m_category":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"],"right":null},"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"data":{"added":[],"deleted":["MX","Not applicable"]}}}},"posttherapy_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS"],"data":{"added":[],"deleted":["Cannot be assessed"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n \n return result;\n })"]}}}},"created":{"anatomic_site_progression_or_recurrences":{"changeType":"created","description":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1,C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}}},"deleted":{"anatomic_site_progression_or_recurrence":{"changeType":"deleted","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"exposure":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"deleted","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"deleted","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"deleted","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"deleted","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"deleted","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"deleted","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"deleted","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"deleted","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"deleted","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"deleted","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"deleted","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"deleted","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}}},"family_history":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"family_relative_id":{"meta":{"primaryId":{"left":true,"right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}$","right":"^[A-Za-z0-9\\-\\._]{1,64}"}}},"relationship_type":{"restrictions":{"codeList":{"left":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"],"right":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Sister","Son","Unknown"],"data":{"added":[],"deleted":["Maternal Uncle","Paternal Uncle","Uncle"]}}}}},"created":{},"deleted":{}},"biomarker":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"deleted","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"deleted","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"deleted","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"deleted","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"deleted","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"deleted","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"deleted","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"deleted","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"deleted","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"deleted","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"deleted","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"deleted","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"deleted","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"deleted","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"deleted","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"deleted","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"deleted","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"deleted","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"deleted","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"deleted","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"deleted","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"deleted","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"deleted","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}}},"comorbidity":{"updated":{},"created":{},"deleted":{"program_id":{"changeType":"deleted","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"deleted","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"deleted","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"deleted","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"deleted","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"deleted","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"deleted","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"deleted","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}}}}} diff --git a/website/static/data/schemas/diffs/1.3/1.3-diff-1.24.json b/website/static/data/schemas/diffs/1.3/1.3-diff-1.24.json new file mode 100644 index 00000000..e2766b25 --- /dev/null +++ b/website/static/data/schemas/diffs/1.3/1.3-diff-1.24.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n const row = $row;\n let result = {valid: true, message: \"Ok\"};\n \n const designation = row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\"){\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when tumour_normal_designation is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when tumour_normal_designation is set to Tumour.\"};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"]}}},"submitter_sample_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased","Unknown"],"right":["Alive","Deceased"],"data":{"added":[],"deleted":["Unknown"]}}}},"cause_of_death":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]}}},"survival_time":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"primary_site":{"meta":{"notes":{"left":null,"right":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"examples":{"left":null,"right":"Breast|Ovary"}},"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Not Reported","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva","Unknown"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"data":{"added":["Unknown primary site"],"deleted":["Not Reported","Unknown"]}}}},"height":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"weight":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"bmi":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"menopause_status":{"description":{"left":"Indicate the donor's menopause status at the time of primary diagnosis. (Codelist reference: NCI CDE ID: 2434914)","right":"Indicate the donor's menopause status at the time of primary diagnosis. (Reference: caDSR CDE ID 2434914)"},"restrictions":{"codeList":{"left":["Indeterminate or unknown","Not applicable","Perimenopausal","Postmenopausal","Premenopausal"],"right":["Not applicable","Perimenopausal","Postmenopausal","Premenopausal","Unknown"],"data":{"added":["Unknown"],"deleted":["Indeterminate or unknown"]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age of menarche, the first occurrence of menstruation.","right":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)"},"restrictions":{}},"number_of_pregnancies":{"description":{"left":"Indicate the number of pregnancies a donor has had.","right":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)"},"restrictions":{}},"number_of_children":{"description":{"left":"Indicate the number of children the donor has birthed.","right":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)"},"restrictions":{}}},"created":{"genetic_disorders":{"changeType":"created","description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},"hrt_type":{"changeType":"created","description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},"hrt_duration":{"changeType":"created","description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},"contraception_type":{"changeType":"created","description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},"contraception_duration":{"changeType":"created","description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},"lost_to_followup_after_clinical_event_id":{"changeType":"created","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}},"deleted":{"prior_malignancy":{"changeType":"deleted","description":"Prior malignancy affecting donor.","name":"prior_malignancy","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy","examples":"C41.1, C16.9, C00.5, D46.9"}},"cancer_type_prior_malignancy":{"changeType":"deleted","description":"The code to represent the cancer type of a prior malignancy using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","name":"cancer_type_prior_malignancy","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"valueType":"string","meta":{"displayName":"Cancer Type Prior Malignancy"}},"age_at_prior_malignancy":{"changeType":"deleted","description":"If donor has history of prior malignancy, indicate age at previous diagnosis, in years.","name":"age_at_prior_malignancy","valueType":"integer","meta":{"displayName":"Age at Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"deleted","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Codelist reference: NCI CDE: 4122391)","name":"laterality_of_prior_malignancy","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality at Prior Malignancy"}}}},"specimen":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null},"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"pathological_tumour_staging_system":{"meta":{"validationDependency":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"pathological_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"pathological_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"pathological_stage_group":{"restrictions":{"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.pathological_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.pathological_tumour_staging_system && $row.pathological_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'pathological_tumour_staging_system' is set to '${\n $row.pathological_tumour_staging_system\n }', 'pathological_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"specimen_storage":{"description":{"left":"Indicate the method of specimen storage for specimens that were not extracted freshly or immediately cultured.","right":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured."},"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"reference_pathology_confirmed":{"description":{"left":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist.","right":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)"}},"tumour_grading_system":{"meta":{"validationDependency":{"left":null,"right":true}}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = \"'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.\";\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"percent_tumour_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of infiltration by tumour cells in a specimen.","right":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)"},"restrictions":{}},"percent_proliferating_cells":{"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_inflammatory_tissue":{"description":{"left":"Indicate a value, in decimals, that represents local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue.","right":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)"},"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_stromal_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a malignant tumour specimen but are not malignant such as fibroblasts, vascular structures, etc.","right":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)"},"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_necrosis":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of cell death in a malignant tumour specimen.","right":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)"},"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}}},"created":{"specimen_laterality":{"changeType":"created","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"percent_tumour_cells_measurement_method":{"changeType":"created","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}},"deleted":{}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"age_at_diagnosis":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0,"max":90}}}},"number_lymph_nodes_positive":{"description":{"left":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: NCI CDE ID: 6113694)","right":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: caDSR CDE ID 6113694)"},"meta":{"dependsOn":{"left":null,"right":"primary_diagnosis.lymph_nodes_examined_status"},"notes":{"left":null,"right":"This field is only required if 'lymph_nodes_examined_status' is 'Yes'."}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"]},"range":{"left":null,"right":{"min":0}}}},"number_lymph_nodes_examined":{"description":{"left":"The total number of lymph nodes tested for the presence of cancer. (Reference: NCI CDE ID: 3)","right":"The total number of lymph nodes tested for the presence of cancer. (Reference: caDSR CDE ID 3)"},"meta":{"dependsOn":{"left":null,"right":"primary_diagnosis.lymph_nodes_examined_status"},"notes":{"left":null,"right":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'."}},"restrictions":{}},"clinical_tumour_staging_system":{"meta":{"validationDependency":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"required":{"left":true,"right":null},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"clinical_stage_group":{"description":{"left":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.).","right":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage."},"meta":{"examples":{"left":null,"right":"Stage I, Stage IIB"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.clinical_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'clinical_tumour_staging_system' is set to '${\n $row.clinical_tumour_staging_system\n }', 'clinical_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"clinical_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"clinical_n_category":{"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"clinical_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"performance_status":{"description":{"left":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference source: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status).","right":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status)."},"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}}},"created":{"laterality":{"changeType":"created","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_status":{"changeType":"created","name":"lymph_nodes_examined_status","description":"Indicate if lymph nodes were examined for metastases.","valueType":"string","restrictions":{"required":true,"codeList":["Cannot be determined","No","No lymph nodes found in resected specimen","Not applicable","Yes"]},"meta":{"core":true,"displayName":"Lymph Nodes Examined Status"}},"lymph_nodes_examined_method":{"changeType":"created","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}},"deleted":{}},"treatment":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null},"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":["End of life care"],"deleted":[]}}}},"is_primary_treatment":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Yes","No","Unknown"],"right":["Yes","No"],"data":{"added":[],"deleted":["Unknown"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"line_of_treatment":{"meta":{"dependsOn":{"left":null,"right":"treatment.is_primary_treatment"}},"restrictions":{}},"treatment_start_interval":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_duration":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"days_per_cycle":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{}},"number_of_cycles":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{}},"treatment_intent":{"description":{"left":"Indicate the intended disease outcome for which the treatment is given. (Reference: CDISC [NCIt code: C124307])","right":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)"},"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Curative","Palliative","Unknown"],"right":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"],"data":{"added":["Diagnostic","Forensic","Guidance","Preventative","Screening","Supportive"],"deleted":["Unknown"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_setting":{"description":{"left":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: CDISC [NCIt code: C124308])","right":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: NCIt C124308)"},"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Adjuvant","Advanced/Metastatic","Neoadjuvant","Not applicable"],"right":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"],"data":{"added":["Conditioning","Induction","Maintenance","Mobilization","Preventative","Radiosensitization","Salvage"],"deleted":["Not applicable"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"response_to_treatment":{"description":{"left":"The donor's response to the applied treatment regimen. (Source: RECIST)","right":"The donor's response to the applied treatment regimen."},"meta":{"dependsOn":{"left":null,"right":"treatment.response_to_treatment_criteria_method"},"notes":{"left":null,"right":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Complete response","Disease progression","NED","Partial response","Stable disease"],"right":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"],"data":{"added":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease"],"deleted":["Disease progression","NED"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"]}}},"outcome_of_treatment":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"toxicity_type":{"description":{"left":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hemotological toxicity or non-hemotological toxicity.","right":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity."},"meta":{"dependsOn":{"left":null,"right":"treatment.outcome_of_treatment"}},"restrictions":{"codeList":{"left":["Hemotological","Non-hemotological"],"right":["Hematological","Non-hematological","Not applicable","Unknown"],"data":{"added":["Hematological","Non-hematological","Not applicable","Unknown"],"deleted":["Hemotological","Non-hemotological"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"]}}},"adverse_events":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"codeList":{"left":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"right":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"data":{"added":["None","Unknown"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"clinical_trials_database":{"meta":{"notes":{"left":null,"right":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added."}},"restrictions":{"codeList":{"left":["NCI Clinical Trials","EU Clinical Trials Register"],"right":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"],"data":{"added":["Not applicable","Unknown"],"deleted":[]}}}},"clinical_trial_number":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: 'The submitted NCI clinical trial number is in incorrect format.'};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: \"The submitted EudraCT clinical trial number is in incorrect format.\"};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: \"The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database.\"};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: \"'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.\"};\n } \n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"]}}}},"created":{"response_to_treatment_criteria_method":{"changeType":"created","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},"hematological_toxicity":{"changeType":"created","name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"non-hematological_toxicity":{"changeType":"created","name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"age_at_consent_for_treatment":{"changeType":"deleted","name":"age_at_consent_for_treatment","description":"Indicate the age of donor when consent was given for treatment.","valueType":"integer","meta":{"displayName":"Age At Consent For Treatment"}},"hemotological_toxicity":{"changeType":"deleted","name":"hemotological_toxicity","description":"Indicate the hemotological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5"]},"meta":{"displayName":"Hemotological Toxicity","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"chemotherapy":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"description":{"left":"Name of agent or drug administered to patient as part of the treatment regimen.","right":"Name of agent or drug administered to donor as part of the treatment regimen."},"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"created","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"created","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"created","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"created","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}},"deleted":{"chemotherapy_dosage_units":{"changeType":"deleted","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate the total actual drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"description":{"left":"Name of agent or drug administered to patient as part of the treatment regimen.","right":"Name of agent or drug administered to donor as part of the treatment regimen."},"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"created","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{"hormone_drug_dosage_units":{"changeType":"deleted","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"radiation":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"radiation_therapy_fractions":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"radiation_therapy_dosage":{"valueType":{"left":"integer","right":"number"},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"anatomical_site_irradiated":{"description":{"left":"Indicate localization site where radiation therapy was administered.","right":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)"},"restrictions":{"codeList":{"left":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"right":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"data":{"added":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"],"deleted":["Bone","Extremities","Head-Neck","Peritoneum"]}}}}},"created":{"radiation_boost":{"changeType":"created","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"created","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}},"deleted":{}},"follow_up":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_follow_up_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null},"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null},"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"treatment.submitter_treatment_id"}},"restrictions":{"regex":{"left":"\\b(?!([Dd][Oo])|([Ss][Pp])|([Ss][Aa])|([Tt][Rr])|([pP][Dd])|([Ff][Uu]))\\b^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"weight_at_followup":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"relapse_type":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"relapse_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `'${$name}' cannot be greater than the 'interval_of_followup'.` }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"]}}},"method_of_progression_status":{"description":{"left":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Codelist reference: NCI CDE ID: 6161031)","right":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Reference: caDSR CDE ID 6161031)"},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_t_category":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"recurrence_n_category":{"meta":{"core":{"left":true,"right":null}}},"recurrence_m_category":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"recurrence_stage_group":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.recurrence_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.recurrence_tumour_staging_system && $row.recurrence_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'recurrence_tumour_staging_system' is set to '${\n $row.recurrence_tumour_staging_system\n }', 'recurrence_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"posttherapy_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"posttherapy_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"posttherapy_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"posttherapy_stage_group":{"restrictions":{"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.posttherapy_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.posttherapy_tumour_staging_system && $row.posttherapy_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'posttherapy_tumour_staging_system' is set to '${\n $row.posttherapy_tumour_staging_system\n }', 'posttherapy_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}}},"created":{"anatomic_site_progression_or_recurrence":{"changeType":"created","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"anatomic_site_progression_or_recurrences":{"changeType":"deleted","description":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1,C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}}}},"immunotherapy":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"immunotherapy_type":{"changeType":"created","name":"immunotherapy_type","valueType":"string","description":"Indicate the type of immunotherapy administered to donor.","meta":{"displayName":"Immunotherapy Type","core":true},"restrictions":{"required":true,"codeList":["Cell-based","Immune checkpoint inhibitors","Monoclonal antibodies other than immune checkpoint inhibitors","Other immunomodulatory substances"]}},"drug_rxnormcui":{"changeType":"created","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"created","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"created","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{}},"surgery":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"created","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"created","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"created","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"created","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"created","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"created","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"created","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"created","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"created","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"created","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"created","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"created","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"created","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"created","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}},"deleted":{}},"exposure":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"created","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"created","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"created","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"created","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"created","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"created","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"created","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"created","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"created","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"created","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"created","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"created","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"created","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}},"deleted":{}},"family_history":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"family_relative_id":{"changeType":"created","description":"Unique identifier of the relative, assigned by the data provider.","name":"family_relative_id","valueType":"string","meta":{"displayName":"Family Relative ID","primaryId":true,"notes":"This field is required to ensure that family members are identified in unique records. Ids can be as simple as an incremented numeral to ensure uniqueness."},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"relative_with_cancer_history":{"changeType":"created","description":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","name":"relative_with_cancer_history","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Relative with Cancer History"}},"relationship_type":{"changeType":"created","description":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","name":"relationship_type","restrictions":{"codeList":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"]},"valueType":"string","meta":{"displayName":"Relationship Type"}},"gender_of_relative":{"changeType":"created","description":"The self-reported gender of related individual.","name":"gender_of_relative","restrictions":{"codeList":["Female","Male","Other","Unknown"]},"valueType":"string","meta":{"displayName":"Gender of Relative"}},"age_of_relative_at_diagnosis":{"changeType":"created","description":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","name":"age_of_relative_at_diagnosis","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","displayName":"Age Of Relative At Diagnosis"}},"cancer_type_code_of_relative":{"changeType":"created","name":"cancer_type_code_of_relative","valueType":"string","description":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"examples":"C41.1,C16.9,C00.5,D46.9","dependsOn":"family_history.relative_with_cancer_history","displayName":"Cancer Type Code (ICD-10) of Relative"}},"relative_vital_status":{"changeType":"created","description":"Relative's last known state of living or deceased.","name":"relative_vital_status","restrictions":{"codeList":["Alive","Deceased","Unknown"]},"valueType":"string","meta":{"displayName":"Vital Status of Relative"}},"cause_of_death_of_relative":{"changeType":"created","description":"Indicate the cause of the death of the relative.","name":"cause_of_death_of_relative","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]},"valueType":"string","meta":{"dependsOn":"family_history.relative_vital_status","displayName":"Cause of Death of Relative"}},"relative_survival_time":{"changeType":"created","description":"Indicate how long, in days, the relative survived from the time they were diagnosed with cancer.","name":"relative_survival_time","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","units":"days","displayName":"Survival Time Of Relative"}}},"deleted":{}},"biomarker":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"created","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"created","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"created","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"created","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"created","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"created","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"created","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"created","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"created","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"created","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"created","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"created","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"created","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"created","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"created","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"created","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"created","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"created","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"created","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}},"deleted":{}},"comorbidity":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"created","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"created","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"created","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"created","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"created","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"created","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}},"deleted":{}}}} diff --git a/website/static/data/schemas/diffs/1.4/1.4-diff-1.24.json b/website/static/data/schemas/diffs/1.4/1.4-diff-1.24.json new file mode 100644 index 00000000..e9b724b4 --- /dev/null +++ b/website/static/data/schemas/diffs/1.4/1.4-diff-1.24.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n const row = $row;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n const designation = row.tumour_normal_designation.trim().toLowerCase();\r\n const specimen_type = $field.trim().toLowerCase();\r\n \r\n if (designation === \"normal\"){\r\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\r\n if (!validTypes.includes(specimen_type)){\r\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when tumour_normal_designation is set to Normal.\"};\r\n }\r\n }\r\n else if (designation === \"tumour\") {\r\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\r\n if (invalidTypes.includes(specimen_type)){\r\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when tumour_normal_designation is set to Tumour.\"};\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"]}}},"submitter_sample_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased","Unknown"],"right":["Alive","Deceased"],"data":{"added":[],"deleted":["Unknown"]}}}},"cause_of_death":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n const vitalStatus = $row.vital_status.trim().toLowerCase();\r\n \r\n if (!currField && vitalStatus === \"deceased\"){\r\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\r\n }\r\n else if (currField && vitalStatus != \"deceased\"){\r\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]}}},"survival_time":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n const vitalStatus = $row.vital_status.trim().toLowerCase();\r\n \r\n if (!currField && vitalStatus === \"deceased\"){\r\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\r\n }\r\n else if (currField && vitalStatus != \"deceased\"){\r\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"primary_site":{"meta":{"notes":{"left":null,"right":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"examples":{"left":null,"right":"Breast|Ovary"}},"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Not Reported","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva","Unknown"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"data":{"added":["Unknown primary site"],"deleted":["Not Reported","Unknown"]}}}},"height":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"weight":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"bmi":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"menopause_status":{"description":{"left":"Indicate the donor's menopause status at the time of primary diagnosis. (Codelist reference: NCI CDE ID: 2434914)","right":"Indicate the donor's menopause status at the time of primary diagnosis. (Reference: caDSR CDE ID 2434914)"},"restrictions":{"codeList":{"left":["Indeterminate or unknown","Not applicable","Perimenopausal","Postmenopausal","Premenopausal"],"right":["Not applicable","Perimenopausal","Postmenopausal","Premenopausal","Unknown"],"data":{"added":["Unknown"],"deleted":["Indeterminate or unknown"]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age of menarche, the first occurrence of menstruation.","right":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)"},"restrictions":{}},"number_of_pregnancies":{"description":{"left":"Indicate the number of pregnancies a donor has had.","right":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)"},"restrictions":{}},"number_of_children":{"description":{"left":"Indicate the number of children the donor has birthed.","right":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)"},"restrictions":{}}},"created":{"genetic_disorders":{"changeType":"created","description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},"hrt_type":{"changeType":"created","description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},"hrt_duration":{"changeType":"created","description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},"contraception_type":{"changeType":"created","description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},"contraception_duration":{"changeType":"created","description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},"lost_to_followup_after_clinical_event_id":{"changeType":"created","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}},"deleted":{"prior_malignancy":{"changeType":"deleted","description":"Prior malignancy affecting donor.","name":"prior_malignancy","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy","examples":"C41.1, C16.9, C00.5, D46.9"}},"cancer_type_prior_malignancy":{"changeType":"deleted","description":"The code to represent the cancer type of a prior malignancy using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","name":"cancer_type_prior_malignancy","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"valueType":"string","meta":{"displayName":"Cancer Type Prior Malignancy"}},"age_at_prior_malignancy":{"changeType":"deleted","description":"If donor has history of prior malignancy, indicate age at previous diagnosis, in years.","name":"age_at_prior_malignancy","valueType":"integer","meta":{"displayName":"Age at Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"deleted","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Codelist reference: NCI CDE: 4122391)","name":"laterality_of_prior_malignancy","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality at Prior Malignancy"}}}},"specimen":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null},"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"pathological_tumour_staging_system":{"meta":{"validationDependency":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n /* This is not a required field, so first ensure that it exists */\r\n if ($field) {\r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"pathological_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"pathological_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"pathological_stage_group":{"restrictions":{"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.pathological_tumour_staging_system && $field) {\r\n let codeList = [];\r\n switch ($row.pathological_tumour_staging_system && $row.pathological_tumour_staging_system.trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb',\r\n 'stage ive',\r\n 'stage ivs'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When 'pathological_tumour_staging_system' is set to '${\r\n $row.pathological_tumour_staging_system\r\n }', 'pathological_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"specimen_storage":{"description":{"left":"Indicate the method of specimen storage for specimens that were not extracted freshly or immediately cultured.","right":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured."},"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"reference_pathology_confirmed":{"description":{"left":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist.","right":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)"}},"tumour_grading_system":{"meta":{"validationDependency":{"left":null,"right":true}}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.tumour_grading_system && $field) {\r\n let codeList = [];\r\n const tieredGradingList = ['gx','g1','g2','g3'];\r\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\r\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\r\n case 'two-tier grading system':\r\n codeList = [\r\n 'low grade',\r\n 'high grade',\r\n ];\r\n break;\r\n case 'three-tier grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'four-tier grading system':\r\n codeList = [\r\n 'gx',\r\n 'g1',\r\n 'g2',\r\n 'g3',\r\n 'g4',\r\n ];\r\n break;\r\n case 'grading system for gists':\r\n codeList = [\r\n 'low',\r\n 'high',\r\n ];\r\n break;\r\n case 'grading system for gnets':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'isup grading system':\r\n codeList = [\r\n 'gx',\r\n 'g1',\r\n 'g2',\r\n 'g3',\r\n 'g4',\r\n ];\r\n break;\r\n case 'who grading system for cns tumours':\r\n codeList = [\r\n 'grade i',\r\n 'grade ii',\r\n 'grade iii',\r\n 'grade iv',\r\n ];\r\n break;\r\n case 'fnclcc grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'gleason grade group system':\r\n codeList = [\r\n 'grade group 1',\r\n 'grade group 2',\r\n 'grade group 3',\r\n 'grade group 4',\r\n 'grade group 5',\r\n ];\r\n break;\r\n case 'scarff-bloom-richardson grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'nuclear grading system for dcis':\r\n codeList = tieredGradingList;\r\n break;\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase())) {\r\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\r\n $row.tumour_grading_system\r\n }', 'tumour_grade' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\r\n result.valid = false;\r\n const msg = \"'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.\";\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"percent_tumour_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of infiltration by tumour cells in a specimen.","right":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)"},"restrictions":{}},"percent_proliferating_cells":{"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_inflammatory_tissue":{"description":{"left":"Indicate a value, in decimals, that represents local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue.","right":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)"},"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_stromal_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a malignant tumour specimen but are not malignant such as fibroblasts, vascular structures, etc.","right":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)"},"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_necrosis":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of cell death in a malignant tumour specimen.","right":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)"},"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}}},"created":{"specimen_laterality":{"changeType":"created","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"percent_tumour_cells_measurement_method":{"changeType":"created","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}},"deleted":{}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"age_at_diagnosis":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0,"max":90}}}},"number_lymph_nodes_positive":{"description":{"left":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: NCI CDE ID: 6113694)","right":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: caDSR CDE ID 6113694)"},"meta":{"dependsOn":{"left":null,"right":"primary_diagnosis.lymph_nodes_examined_status"},"notes":{"left":null,"right":"This field is only required if 'lymph_nodes_examined_status' is 'Yes'."}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"]},"range":{"left":null,"right":{"min":0}}}},"number_lymph_nodes_examined":{"description":{"left":"The total number of lymph nodes tested for the presence of cancer. (Reference: NCI CDE ID: 3)","right":"The total number of lymph nodes tested for the presence of cancer. (Reference: caDSR CDE ID 3)"},"meta":{"dependsOn":{"left":null,"right":"primary_diagnosis.lymph_nodes_examined_status"},"notes":{"left":null,"right":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'."}},"restrictions":{}},"clinical_tumour_staging_system":{"meta":{"validationDependency":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n /* This is not a required field, so first ensure that it exists */\r\n if ($field) {\r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"required":{"left":true,"right":null},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"clinical_stage_group":{"description":{"left":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.).","right":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage."},"meta":{"examples":{"left":null,"right":"Stage I, Stage IIB"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.clinical_tumour_staging_system && $field) {\r\n let codeList = [];\r\n switch ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system.trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb',\r\n 'stage ive',\r\n 'stage ivs'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When 'clinical_tumour_staging_system' is set to '${\r\n $row.clinical_tumour_staging_system\r\n }', 'clinical_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"clinical_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"clinical_n_category":{"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"clinical_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"performance_status":{"description":{"left":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference source: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status).","right":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status)."},"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}}},"created":{"laterality":{"changeType":"created","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_status":{"changeType":"created","name":"lymph_nodes_examined_status","description":"Indicate if lymph nodes were examined for metastases.","valueType":"string","restrictions":{"required":true,"codeList":["Cannot be determined","No","No lymph nodes found in resected specimen","Not applicable","Yes"]},"meta":{"core":true,"displayName":"Lymph Nodes Examined Status"}},"lymph_nodes_examined_method":{"changeType":"created","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}},"deleted":{}},"treatment":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null},"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":["End of life care"],"deleted":[]}}}},"is_primary_treatment":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Yes","No","Unknown"],"right":["Yes","No"],"data":{"added":[],"deleted":["Unknown"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"line_of_treatment":{"meta":{"dependsOn":{"left":null,"right":"treatment.is_primary_treatment"}},"restrictions":{}},"treatment_start_interval":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_duration":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"days_per_cycle":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{}},"number_of_cycles":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{}},"treatment_intent":{"description":{"left":"Indicate the intended disease outcome for which the treatment is given. (Reference: CDISC [NCIt code: C124307])","right":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)"},"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Curative","Palliative","Unknown"],"right":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"],"data":{"added":["Diagnostic","Forensic","Guidance","Preventative","Screening","Supportive"],"deleted":["Unknown"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_setting":{"description":{"left":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: CDISC [NCIt code: C124308])","right":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: NCIt C124308)"},"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Adjuvant","Advanced/Metastatic","Neoadjuvant","Not applicable"],"right":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"],"data":{"added":["Conditioning","Induction","Maintenance","Mobilization","Preventative","Radiosensitization","Salvage"],"deleted":["Not applicable"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"response_to_treatment":{"description":{"left":"The donor's response to the applied treatment regimen. (Source: RECIST)","right":"The donor's response to the applied treatment regimen."},"meta":{"dependsOn":{"left":null,"right":"treatment.response_to_treatment_criteria_method"},"notes":{"left":null,"right":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Complete response","Disease progression","NED","Partial response","Stable disease"],"right":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"],"data":{"added":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease"],"deleted":["Disease progression","NED"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"]}}},"outcome_of_treatment":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"toxicity_type":{"description":{"left":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hemotological toxicity or non-hemotological toxicity.","right":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity."},"meta":{"dependsOn":{"left":null,"right":"treatment.outcome_of_treatment"}},"restrictions":{"codeList":{"left":["Hemotological","Non-hemotological"],"right":["Hematological","Non-hematological","Not applicable","Unknown"],"data":{"added":["Hematological","Non-hematological","Not applicable","Unknown"],"deleted":["Hemotological","Non-hemotological"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"]}}},"adverse_events":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"codeList":{"left":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"right":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"data":{"added":["None","Unknown"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"clinical_trials_database":{"meta":{"notes":{"left":null,"right":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added."}},"restrictions":{"codeList":{"left":["NCI Clinical Trials","EU Clinical Trials Register"],"right":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"],"data":{"added":["Not applicable","Unknown"],"deleted":[]}}}},"clinical_trial_number":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n //regex check for clinical trial number\r\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\r\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\r\n\r\n // list of valid clinical trial databases\r\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\r\n \r\n if ($row.clinical_trials_database && $field) {\r\n const trialNumber = $field.trim();\r\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\r\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\r\n result = {valid: false, message: 'The submitted NCI clinical trial number is in incorrect format.'};\r\n }\r\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\r\n result = {valid: false, message: \"The submitted EudraCT clinical trial number is in incorrect format.\"};\r\n }\r\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\r\n result = {valid: false, message: \"The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database.\"};\r\n }\r\n }\r\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\r\n result = {valid: true, message: \"Ok\"};\r\n }\r\n else if ($row.clinical_trials_database && !$field) {\r\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\r\n result = {valid: false, message: \"'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.\"};\r\n } \r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"]}}}},"created":{"response_to_treatment_criteria_method":{"changeType":"created","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},"hematological_toxicity":{"changeType":"created","name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"non-hematological_toxicity":{"changeType":"created","name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"age_at_consent_for_treatment":{"changeType":"deleted","name":"age_at_consent_for_treatment","description":"Indicate the age of donor when consent was given for treatment.","valueType":"integer","meta":{"displayName":"Age At Consent For Treatment"}},"hemotological_toxicity":{"changeType":"deleted","name":"hemotological_toxicity","description":"Indicate the hemotological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5"]},"meta":{"displayName":"Hemotological Toxicity","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"chemotherapy":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"description":{"left":"Name of agent or drug administered to patient as part of the treatment regimen.","right":"Name of agent or drug administered to donor as part of the treatment regimen."},"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"created","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"created","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"created","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"created","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}},"deleted":{"chemotherapy_dosage_units":{"changeType":"deleted","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate the total actual drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"description":{"left":"Name of agent or drug administered to patient as part of the treatment regimen.","right":"Name of agent or drug administered to donor as part of the treatment regimen."},"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"created","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{"hormone_drug_dosage_units":{"changeType":"deleted","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"radiation":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"radiation_therapy_fractions":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"radiation_therapy_dosage":{"valueType":{"left":"integer","right":"number"},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"anatomical_site_irradiated":{"description":{"left":"Indicate localization site where radiation therapy was administered.","right":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)"},"restrictions":{"codeList":{"left":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"right":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"data":{"added":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"],"deleted":["Bone","Extremities","Head-Neck","Peritoneum"]}}}}},"created":{"radiation_boost":{"changeType":"created","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"created","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}},"deleted":{}},"follow_up":{"updated":{"submitter_donor_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_follow_up_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null},"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"notes":{"left":"To prevent data collisions, submitter_id cannot begin with any of the ARGO ID prefixes. The restricted prefixes include: `DO`, `SP`, `SA`,`TR`,`FU`, `PD`.","right":null},"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"treatment.submitter_treatment_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"weight_at_followup":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"relapse_type":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"relapse_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const intervalOfFollowup = parseInt($row.interval_of_followup);\r\n\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n relapseInterval = parseInt($field);\r\n if (relapseInterval > intervalOfFollowup) {\r\n result = {valid: false, message: `'${$name}' cannot be greater than the 'interval_of_followup'.` }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"]}}},"method_of_progression_status":{"description":{"left":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Codelist reference: NCI CDE ID: 6161031)","right":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Reference: caDSR CDE ID 6161031)"},"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n /* This is not a required field, so first ensure that it exists */\r\n if ($field) {\r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })","(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_t_category":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"recurrence_n_category":{"meta":{"core":{"left":true,"right":null}}},"recurrence_m_category":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"recurrence_stage_group":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.recurrence_tumour_staging_system && $field) {\r\n let codeList = [];\r\n switch ($row.recurrence_tumour_staging_system && $row.recurrence_tumour_staging_system.trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb',\r\n 'stage ive',\r\n 'stage ivs'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When 'recurrence_tumour_staging_system' is set to '${\r\n $row.recurrence_tumour_staging_system\r\n }', 'recurrence_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"posttherapy_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n /* This is not a required field, so first ensure that it exists */\r\n if ($field) {\r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"posttherapy_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"posttherapy_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"posttherapy_stage_group":{"restrictions":{"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.posttherapy_tumour_staging_system && $field) {\r\n let codeList = [];\r\n switch ($row.posttherapy_tumour_staging_system && $row.posttherapy_tumour_staging_system.trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb',\r\n 'stage ive',\r\n 'stage ivs'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When 'posttherapy_tumour_staging_system' is set to '${\r\n $row.posttherapy_tumour_staging_system\r\n }', 'posttherapy_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}}},"created":{"anatomic_site_progression_or_recurrence":{"changeType":"created","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"anatomic_site_progression_or_recurrences":{"changeType":"deleted","description":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1,C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}}}},"immunotherapy":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"immunotherapy_type":{"changeType":"created","name":"immunotherapy_type","valueType":"string","description":"Indicate the type of immunotherapy administered to donor.","meta":{"displayName":"Immunotherapy Type","core":true},"restrictions":{"required":true,"codeList":["Cell-based","Immune checkpoint inhibitors","Monoclonal antibodies other than immune checkpoint inhibitors","Other immunomodulatory substances"]}},"drug_rxnormcui":{"changeType":"created","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"created","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"created","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{}},"surgery":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"created","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"created","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"created","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"created","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"created","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"created","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"created","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"created","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"created","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"created","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"created","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"created","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"created","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"created","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}},"deleted":{}},"exposure":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"created","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"created","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"created","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"created","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"created","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"created","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"created","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"created","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"created","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"created","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"created","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"created","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"created","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}},"deleted":{}},"family_history":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"family_relative_id":{"changeType":"created","description":"Unique identifier of the relative, assigned by the data provider.","name":"family_relative_id","valueType":"string","meta":{"displayName":"Family Relative ID","primaryId":true,"notes":"This field is required to ensure that family members are identified in unique records. Ids can be as simple as an incremented numeral to ensure uniqueness."},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"relative_with_cancer_history":{"changeType":"created","description":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","name":"relative_with_cancer_history","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Relative with Cancer History"}},"relationship_type":{"changeType":"created","description":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","name":"relationship_type","restrictions":{"codeList":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"]},"valueType":"string","meta":{"displayName":"Relationship Type"}},"gender_of_relative":{"changeType":"created","description":"The self-reported gender of related individual.","name":"gender_of_relative","restrictions":{"codeList":["Female","Male","Other","Unknown"]},"valueType":"string","meta":{"displayName":"Gender of Relative"}},"age_of_relative_at_diagnosis":{"changeType":"created","description":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","name":"age_of_relative_at_diagnosis","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","displayName":"Age Of Relative At Diagnosis"}},"cancer_type_code_of_relative":{"changeType":"created","name":"cancer_type_code_of_relative","valueType":"string","description":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"examples":"C41.1,C16.9,C00.5,D46.9","dependsOn":"family_history.relative_with_cancer_history","displayName":"Cancer Type Code (ICD-10) of Relative"}},"relative_vital_status":{"changeType":"created","description":"Relative's last known state of living or deceased.","name":"relative_vital_status","restrictions":{"codeList":["Alive","Deceased","Unknown"]},"valueType":"string","meta":{"displayName":"Vital Status of Relative"}},"cause_of_death_of_relative":{"changeType":"created","description":"Indicate the cause of the death of the relative.","name":"cause_of_death_of_relative","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]},"valueType":"string","meta":{"dependsOn":"family_history.relative_vital_status","displayName":"Cause of Death of Relative"}},"relative_survival_time":{"changeType":"created","description":"Indicate how long, in days, the relative survived from the time they were diagnosed with cancer.","name":"relative_survival_time","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","units":"days","displayName":"Survival Time Of Relative"}}},"deleted":{}},"biomarker":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"created","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"created","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"created","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"created","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"created","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"created","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"created","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"created","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"created","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"created","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"created","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"created","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"created","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"created","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"created","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"created","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"created","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"created","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"created","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}},"deleted":{}},"comorbidity":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"created","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"created","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"created","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"created","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"created","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"created","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}},"deleted":{}}}} diff --git a/website/static/data/schemas/diffs/1.5/1.5-diff-1.24.json b/website/static/data/schemas/diffs/1.5/1.5-diff-1.24.json new file mode 100644 index 00000000..2c48cb9b --- /dev/null +++ b/website/static/data/schemas/diffs/1.5/1.5-diff-1.24.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n const row = $row;\n let result = {valid: true, message: \"Ok\"};\n \n const designation = row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\"){\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when tumour_normal_designation is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)){\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when tumour_normal_designation is set to Tumour.\"};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"]}}},"submitter_sample_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased","Unknown"],"right":["Alive","Deceased"],"data":{"added":[],"deleted":["Unknown"]}}}},"cause_of_death":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]}}},"survival_time":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n \n if (!currField && vitalStatus === \"deceased\"){\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"primary_site":{"meta":{"notes":{"left":null,"right":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"examples":{"left":null,"right":"Breast|Ovary"}},"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Not Reported","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva","Unknown"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"data":{"added":["Unknown primary site"],"deleted":["Not Reported","Unknown"]}}}},"height":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"weight":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"bmi":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"menopause_status":{"description":{"left":"Indicate the donor's menopause status at the time of primary diagnosis. (Codelist reference: NCI CDE ID: 2434914)","right":"Indicate the donor's menopause status at the time of primary diagnosis. (Reference: caDSR CDE ID 2434914)"},"restrictions":{"codeList":{"left":["Indeterminate or unknown","Not applicable","Perimenopausal","Postmenopausal","Premenopausal"],"right":["Not applicable","Perimenopausal","Postmenopausal","Premenopausal","Unknown"],"data":{"added":["Unknown"],"deleted":["Indeterminate or unknown"]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age of menarche, the first occurrence of menstruation.","right":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)"},"restrictions":{}},"number_of_pregnancies":{"description":{"left":"Indicate the number of pregnancies a donor has had.","right":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)"},"restrictions":{}},"number_of_children":{"description":{"left":"Indicate the number of children the donor has birthed.","right":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)"},"restrictions":{}}},"created":{"genetic_disorders":{"changeType":"created","description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},"hrt_type":{"changeType":"created","description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},"hrt_duration":{"changeType":"created","description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},"contraception_type":{"changeType":"created","description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},"contraception_duration":{"changeType":"created","description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},"lost_to_followup_after_clinical_event_id":{"changeType":"created","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}},"deleted":{"prior_malignancy":{"changeType":"deleted","description":"Prior malignancy affecting donor.","name":"prior_malignancy","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy","examples":"C41.1, C16.9, C00.5, D46.9"}},"cancer_type_prior_malignancy":{"changeType":"deleted","description":"The code to represent the cancer type of a prior malignancy using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","name":"cancer_type_prior_malignancy","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"valueType":"string","meta":{"displayName":"Cancer Type Prior Malignancy"}},"age_at_prior_malignancy":{"changeType":"deleted","description":"If donor has history of prior malignancy, indicate age at previous diagnosis, in years.","name":"age_at_prior_malignancy","valueType":"integer","meta":{"displayName":"Age at Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"deleted","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Codelist reference: NCI CDE: 4122391)","name":"laterality_of_prior_malignancy","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality at Prior Malignancy"}}}},"specimen":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"pathological_tumour_staging_system":{"meta":{"validationDependency":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"pathological_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"pathological_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"pathological_stage_group":{"restrictions":{"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.pathological_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.pathological_tumour_staging_system && $row.pathological_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'pathological_tumour_staging_system' is set to '${\n $row.pathological_tumour_staging_system\n }', 'pathological_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"specimen_storage":{"description":{"left":"Indicate the method of specimen storage for specimens that were not extracted freshly or immediately cultured.","right":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured."},"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"reference_pathology_confirmed":{"description":{"left":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist.","right":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)"}},"tumour_grading_system":{"meta":{"validationDependency":{"left":null,"right":true}}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = \"'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.\";\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"percent_tumour_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of infiltration by tumour cells in a specimen.","right":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)"},"restrictions":{}},"percent_proliferating_cells":{"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_inflammatory_tissue":{"description":{"left":"Indicate a value, in decimals, that represents local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue.","right":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)"},"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_stromal_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a malignant tumour specimen but are not malignant such as fibroblasts, vascular structures, etc.","right":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)"},"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_necrosis":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of cell death in a malignant tumour specimen.","right":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)"},"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}}},"created":{"specimen_laterality":{"changeType":"created","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"percent_tumour_cells_measurement_method":{"changeType":"created","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}},"deleted":{}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"age_at_diagnosis":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0,"max":90}}}},"number_lymph_nodes_positive":{"description":{"left":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: NCI CDE ID: 6113694)","right":"The number of regional lymph nodes reported as being positive for tumour metastases. (Reference: caDSR CDE ID 6113694)"},"meta":{"dependsOn":{"left":null,"right":"primary_diagnosis.lymph_nodes_examined_status"},"notes":{"left":null,"right":"This field is only required if 'lymph_nodes_examined_status' is 'Yes'."}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"]},"range":{"left":null,"right":{"min":0}}}},"number_lymph_nodes_examined":{"description":{"left":"The total number of lymph nodes tested for the presence of cancer. (Reference: NCI CDE ID: 3)","right":"The total number of lymph nodes tested for the presence of cancer. (Reference: caDSR CDE ID 3)"},"meta":{"dependsOn":{"left":null,"right":"primary_diagnosis.lymph_nodes_examined_status"},"notes":{"left":null,"right":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'."}},"restrictions":{}},"clinical_tumour_staging_system":{"meta":{"validationDependency":{"left":null,"right":true}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"required":{"left":true,"right":null},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"clinical_stage_group":{"description":{"left":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.).","right":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage."},"meta":{"examples":{"left":null,"right":"Stage I, Stage IIB"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.clinical_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'clinical_tumour_staging_system' is set to '${\n $row.clinical_tumour_staging_system\n }', 'clinical_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"clinical_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"clinical_n_category":{"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"clinical_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"performance_status":{"description":{"left":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference source: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status).","right":"Indicate the donor's performance status grade at the time of primary diagnosis. (Reference: ECOG performance score grades from https://ecog-acrin.org/resources/ecog-performance-status)."},"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}}},"created":{"laterality":{"changeType":"created","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_status":{"changeType":"created","name":"lymph_nodes_examined_status","description":"Indicate if lymph nodes were examined for metastases.","valueType":"string","restrictions":{"required":true,"codeList":["Cannot be determined","No","No lymph nodes found in resected specimen","Not applicable","Yes"]},"meta":{"core":true,"displayName":"Lymph Nodes Examined Status"}},"lymph_nodes_examined_method":{"changeType":"created","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}},"deleted":{}},"treatment":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":["End of life care"],"deleted":[]}}}},"is_primary_treatment":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Yes","No","Unknown"],"right":["Yes","No"],"data":{"added":[],"deleted":["Unknown"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"line_of_treatment":{"meta":{"dependsOn":{"left":null,"right":"treatment.is_primary_treatment"}},"restrictions":{}},"treatment_start_interval":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_duration":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"days_per_cycle":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{}},"number_of_cycles":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{}},"treatment_intent":{"description":{"left":"Indicate the intended disease outcome for which the treatment is given. (Reference: CDISC [NCIt code: C124307])","right":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)"},"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Curative","Palliative","Unknown"],"right":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"],"data":{"added":["Diagnostic","Forensic","Guidance","Preventative","Screening","Supportive"],"deleted":["Unknown"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_setting":{"description":{"left":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: CDISC [NCIt code: C124308])","right":"Indicate the treatment setting, which describes the treatment's purpose in relation to the primary treatment. (Reference: NCIt C124308)"},"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Adjuvant","Advanced/Metastatic","Neoadjuvant","Not applicable"],"right":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"],"data":{"added":["Conditioning","Induction","Maintenance","Mobilization","Preventative","Radiosensitization","Salvage"],"deleted":["Not applicable"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"response_to_treatment":{"description":{"left":"The donor's response to the applied treatment regimen. (Source: RECIST)","right":"The donor's response to the applied treatment regimen."},"meta":{"dependsOn":{"left":null,"right":"treatment.response_to_treatment_criteria_method"},"notes":{"left":null,"right":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Complete response","Disease progression","NED","Partial response","Stable disease"],"right":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"],"data":{"added":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease"],"deleted":["Disease progression","NED"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"]}}},"outcome_of_treatment":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"toxicity_type":{"description":{"left":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hemotological toxicity or non-hemotological toxicity.","right":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity."},"meta":{"dependsOn":{"left":null,"right":"treatment.outcome_of_treatment"}},"restrictions":{"codeList":{"left":["Hemotological","Non-hemotological"],"right":["Hematological","Non-hematological","Not applicable","Unknown"],"data":{"added":["Hematological","Non-hematological","Not applicable","Unknown"],"deleted":["Hemotological","Non-hemotological"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"]}}},"adverse_events":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"codeList":{"left":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"right":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"data":{"added":["None","Unknown"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"clinical_trials_database":{"meta":{"notes":{"left":null,"right":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added."}},"restrictions":{"codeList":{"left":["NCI Clinical Trials","EU Clinical Trials Register"],"right":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"],"data":{"added":["Not applicable","Unknown"],"deleted":[]}}}},"clinical_trial_number":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: 'The submitted NCI clinical trial number is in incorrect format.'};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: \"The submitted EudraCT clinical trial number is in incorrect format.\"};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: \"The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database.\"};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: \"'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.\"};\n } \n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"]}}}},"created":{"response_to_treatment_criteria_method":{"changeType":"created","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},"hematological_toxicity":{"changeType":"created","name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"non-hematological_toxicity":{"changeType":"created","name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"age_at_consent_for_treatment":{"changeType":"deleted","name":"age_at_consent_for_treatment","description":"Indicate the age of donor when consent was given for treatment.","valueType":"integer","meta":{"displayName":"Age At Consent For Treatment"}},"hemotological_toxicity":{"changeType":"deleted","name":"hemotological_toxicity","description":"Indicate the hemotological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5"]},"meta":{"displayName":"Hemotological Toxicity","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"chemotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"description":{"left":"Name of agent or drug administered to patient as part of the treatment regimen.","right":"Name of agent or drug administered to donor as part of the treatment regimen."},"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"created","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"created","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"created","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"created","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}},"deleted":{"chemotherapy_dosage_units":{"changeType":"deleted","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate the total actual drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"description":{"left":"Name of agent or drug administered to patient as part of the treatment regimen.","right":"Name of agent or drug administered to donor as part of the treatment regimen."},"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"created","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{"hormone_drug_dosage_units":{"changeType":"deleted","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"radiation":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"radiation_therapy_fractions":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"radiation_therapy_dosage":{"valueType":{"left":"integer","right":"number"},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"anatomical_site_irradiated":{"description":{"left":"Indicate localization site where radiation therapy was administered.","right":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)"},"restrictions":{"codeList":{"left":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"right":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"data":{"added":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"],"deleted":["Bone","Extremities","Head-Neck","Peritoneum"]}}}}},"created":{"radiation_boost":{"changeType":"created","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"created","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}},"deleted":{}},"follow_up":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_follow_up_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"treatment.submitter_treatment_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"weight_at_followup":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"relapse_type":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"relapse_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `'${$name}' cannot be greater than the 'interval_of_followup'.` }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"]}}},"method_of_progression_status":{"description":{"left":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Codelist reference: NCI CDE ID: 6161031)","right":"Indicate the method(s) used to confirm the donor's progression or relapse or recurrence disease status. (Reference: caDSR CDE ID 6161031)"},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_t_category":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"recurrence_n_category":{"meta":{"core":{"left":true,"right":null}}},"recurrence_m_category":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"recurrence_stage_group":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.recurrence_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.recurrence_tumour_staging_system && $row.recurrence_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'recurrence_tumour_staging_system' is set to '${\n $row.recurrence_tumour_staging_system\n }', 'recurrence_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"posttherapy_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n /* This is not a required field, so first ensure that it exists */\n if ($field) {\n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"posttherapy_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"posttherapy_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"posttherapy_stage_group":{"restrictions":{"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.posttherapy_tumour_staging_system && $field) {\n let codeList = [];\n switch ($row.posttherapy_tumour_staging_system && $row.posttherapy_tumour_staging_system.trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage is',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iis',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iiie',\n 'stage iiis',\n 'stage iv',\n 'stage iva',\n 'stage ivb',\n 'stage ive',\n 'stage ivs'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'posttherapy_tumour_staging_system' is set to '${\n $row.posttherapy_tumour_staging_system\n }', 'posttherapy_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}}},"created":{"anatomic_site_progression_or_recurrence":{"changeType":"created","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"anatomic_site_progression_or_recurrences":{"changeType":"deleted","description":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n \n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1,C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}}}},"immunotherapy":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"immunotherapy_type":{"changeType":"created","name":"immunotherapy_type","valueType":"string","description":"Indicate the type of immunotherapy administered to donor.","meta":{"displayName":"Immunotherapy Type","core":true},"restrictions":{"required":true,"codeList":["Cell-based","Immune checkpoint inhibitors","Monoclonal antibodies other than immune checkpoint inhibitors","Other immunomodulatory substances"]}},"drug_rxnormcui":{"changeType":"created","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"created","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"created","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{}},"surgery":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"created","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"created","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"created","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"created","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"created","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"created","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"created","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"created","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"created","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"created","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"created","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"created","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"created","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"created","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}},"deleted":{}},"exposure":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"created","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"created","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"created","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"created","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"created","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"created","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"created","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"created","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"created","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"created","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"created","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"created","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"created","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}},"deleted":{}},"family_history":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"family_relative_id":{"changeType":"created","description":"Unique identifier of the relative, assigned by the data provider.","name":"family_relative_id","valueType":"string","meta":{"displayName":"Family Relative ID","primaryId":true,"notes":"This field is required to ensure that family members are identified in unique records. Ids can be as simple as an incremented numeral to ensure uniqueness."},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"relative_with_cancer_history":{"changeType":"created","description":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","name":"relative_with_cancer_history","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Relative with Cancer History"}},"relationship_type":{"changeType":"created","description":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","name":"relationship_type","restrictions":{"codeList":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"]},"valueType":"string","meta":{"displayName":"Relationship Type"}},"gender_of_relative":{"changeType":"created","description":"The self-reported gender of related individual.","name":"gender_of_relative","restrictions":{"codeList":["Female","Male","Other","Unknown"]},"valueType":"string","meta":{"displayName":"Gender of Relative"}},"age_of_relative_at_diagnosis":{"changeType":"created","description":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","name":"age_of_relative_at_diagnosis","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","displayName":"Age Of Relative At Diagnosis"}},"cancer_type_code_of_relative":{"changeType":"created","name":"cancer_type_code_of_relative","valueType":"string","description":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"examples":"C41.1,C16.9,C00.5,D46.9","dependsOn":"family_history.relative_with_cancer_history","displayName":"Cancer Type Code (ICD-10) of Relative"}},"relative_vital_status":{"changeType":"created","description":"Relative's last known state of living or deceased.","name":"relative_vital_status","restrictions":{"codeList":["Alive","Deceased","Unknown"]},"valueType":"string","meta":{"displayName":"Vital Status of Relative"}},"cause_of_death_of_relative":{"changeType":"created","description":"Indicate the cause of the death of the relative.","name":"cause_of_death_of_relative","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]},"valueType":"string","meta":{"dependsOn":"family_history.relative_vital_status","displayName":"Cause of Death of Relative"}},"relative_survival_time":{"changeType":"created","description":"Indicate how long, in days, the relative survived from the time they were diagnosed with cancer.","name":"relative_survival_time","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","units":"days","displayName":"Survival Time Of Relative"}}},"deleted":{}},"biomarker":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"created","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"created","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"created","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"created","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"created","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"created","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"created","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"created","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"created","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"created","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"created","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"created","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"created","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"created","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"created","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"created","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"created","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"created","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"created","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}},"deleted":{}},"comorbidity":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"created","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"created","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"created","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"created","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"created","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"created","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}},"deleted":{}}}} diff --git a/website/static/data/schemas/diffs/1.7/1.7-diff-1.24.json b/website/static/data/schemas/diffs/1.7/1.7-diff-1.24.json new file mode 100644 index 00000000..c16a794b --- /dev/null +++ b/website/static/data/schemas/diffs/1.7/1.7-diff-1.24.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n const row = $row;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n const designation = row.tumour_normal_designation.trim().toLowerCase();\r\n const specimen_type = $field.trim().toLowerCase();\r\n \r\n if (designation === \"normal\"){\r\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\r\n if (!validTypes.includes(specimen_type)){\r\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when tumour_normal_designation is set to Normal.\"};\r\n }\r\n }\r\n else if (designation === \"tumour\") {\r\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\r\n if (invalidTypes.includes(specimen_type)){\r\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when tumour_normal_designation is set to Tumour.\"};\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.tumour_normal_designation != null && $row.specimen_type != null) { \n const designation = $row.tumour_normal_designation.trim().toLowerCase();\n const specimen_type = $field.trim().toLowerCase();\n \n if (designation === \"normal\") {\n const validTypes = [\"normal\", \"normal - tissue adjacent to primary tumour\", \"cell line - derived from normal\"];\n if (!validTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type can only be set to a normal type value (Normal, Normal - tissue adjacent to primary tumour, or Cell line - derived from normal) when the 'tumour_normal_designation' field is set to Normal.\"};\n }\n }\n else if (designation === \"tumour\") {\n const invalidTypes = [\"normal\", \"cell line - derived from normal\"];\n if (invalidTypes.includes(specimen_type)) {\n result = {valid: false, message: \"Invalid specimen_type. Specimen_type cannot be set to normal type value (Normal or Cell line - derived from normal) when 'tumour_normal_designation' field is set to Tumour.\"};\n }\n }\n }\n return result;\n })"]}}},"submitter_sample_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased","Unknown"],"right":["Alive","Deceased"],"data":{"added":[],"deleted":["Unknown"]}}}},"cause_of_death":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n const vitalStatus = $row.vital_status.trim().toLowerCase();\r\n \r\n if (!currField && vitalStatus === \"deceased\"){\r\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\r\n }\r\n else if (currField && vitalStatus != \"deceased\"){\r\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]}}},"survival_time":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\r\n const vitalStatus = $row.vital_status.trim().toLowerCase();\r\n \r\n if (!currField && vitalStatus === \"deceased\"){\r\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\r\n }\r\n else if (currField && vitalStatus != \"deceased\"){\r\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.vital_status != null) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (!currField && vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} must be provided when the donor's vital_status is deceased.`}\n }\n else if (currField && vitalStatus != \"deceased\"){\n result = {valid: false, message: `${$name} cannot be provided if the donor's vital_status is not deceased.`}\n }\n }\n else if (($row.vital_status === null) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'vital_status' field.` }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"primary_site":{"meta":{"notes":{"left":null,"right":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"examples":{"left":null,"right":"Breast|Ovary"}},"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Not Reported","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva","Unknown"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"data":{"added":["Unknown primary site"],"deleted":["Not Reported","Unknown"]}}}},"height":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"weight":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"bmi":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"age_at_menarche":{"description":{"left":"Indicate the donor's age of menarche, the first occurrence of menstruation.","right":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)"},"restrictions":{}},"number_of_pregnancies":{"description":{"left":"Indicate the number of pregnancies a donor has had.","right":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)"},"restrictions":{}},"number_of_children":{"description":{"left":"Indicate the number of children the donor has birthed.","right":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)"},"restrictions":{}}},"created":{"genetic_disorders":{"changeType":"created","description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},"hrt_type":{"changeType":"created","description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},"hrt_duration":{"changeType":"created","description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},"contraception_type":{"changeType":"created","description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},"contraception_duration":{"changeType":"created","description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},"lost_to_followup_after_clinical_event_id":{"changeType":"created","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}},"deleted":{}},"specimen":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"pathological_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\r\n\r\n \r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\r\n if (!($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n /* This is not a required field, so first ensure that it exists */\r\n else if ($field) {\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"pathological_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"pathological_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"pathological_stage_group":{"restrictions":{"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_stage_group')[0];\r\n\r\n const stagingSystem = stagingName + `_tumour_staging_system`;\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\r\n result.valid = false;\r\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\r\n result.message = msg;\r\n }\r\n else if (!($row[stagingSystem]) && $field) {\r\n result.valid = false;\r\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\r\n result.message = msg;\r\n }\r\n else if ($row[stagingSystem] && $field) {\r\n let codeList = [];\r\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb',\r\n 'stage ive',\r\n 'stage ivs'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\r\n $row[stagingSystem]\r\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n \r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"specimen_storage":{"description":{"left":"Indicate the method of specimen storage for specimens that were not extracted freshly or immediately cultured.","right":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured."},"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"reference_pathology_confirmed":{"description":{"left":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist.","right":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)"}},"tumour_grading_system":{"meta":{"validationDependency":{"left":null,"right":true}}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n if ($row.tumour_grading_system && $field) {\r\n let codeList = [];\r\n const tieredGradingList = ['gx','g1','g2','g3'];\r\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\r\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\r\n case 'two-tier grading system':\r\n codeList = [\r\n 'low grade',\r\n 'high grade',\r\n ];\r\n break;\r\n case 'three-tier grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'four-tier grading system':\r\n codeList = [\r\n 'gx',\r\n 'g1',\r\n 'g2',\r\n 'g3',\r\n 'g4',\r\n ];\r\n break;\r\n case 'grading system for gists':\r\n codeList = [\r\n 'low',\r\n 'high',\r\n ];\r\n break;\r\n case 'grading system for gnets':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'isup grading system':\r\n codeList = [\r\n 'gx',\r\n 'g1',\r\n 'g2',\r\n 'g3',\r\n 'g4',\r\n ];\r\n break;\r\n case 'who grading system for cns tumours':\r\n codeList = [\r\n 'grade i',\r\n 'grade ii',\r\n 'grade iii',\r\n 'grade iv',\r\n ];\r\n break;\r\n case 'fnclcc grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'gleason grade group system':\r\n codeList = [\r\n 'grade group 1',\r\n 'grade group 2',\r\n 'grade group 3',\r\n 'grade group 4',\r\n 'grade group 5',\r\n ];\r\n break;\r\n case 'scarff-bloom-richardson grading system':\r\n codeList = tieredGradingList;\r\n break;\r\n case 'nuclear grading system for dcis':\r\n codeList = tieredGradingList;\r\n break;\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase())) {\r\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\r\n $row.tumour_grading_system\r\n }', 'tumour_grade' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\r\n result.valid = false;\r\n const msg = \"'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.\";\r\n result.message = msg;\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"percent_tumour_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of infiltration by tumour cells in a specimen.","right":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)"},"restrictions":{}},"percent_proliferating_cells":{"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_inflammatory_tissue":{"description":{"left":"Indicate a value, in decimals, that represents local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue.","right":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)"},"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_stromal_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a malignant tumour specimen but are not malignant such as fibroblasts, vascular structures, etc.","right":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)"},"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_necrosis":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of cell death in a malignant tumour specimen.","right":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)"},"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}}},"created":{"specimen_laterality":{"changeType":"created","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"percent_tumour_cells_measurement_method":{"changeType":"created","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}},"deleted":{}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"age_at_diagnosis":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0,"max":90}}}},"number_lymph_nodes_positive":{"meta":{"dependsOn":{"left":null,"right":"primary_diagnosis.lymph_nodes_examined_status"},"notes":{"left":null,"right":"This field is only required if 'lymph_nodes_examined_status' is 'Yes'."}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespacei */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const numberLymphNodesExamined = $row.number_lymph_nodes_examined;\n const numberLymphNodesPositive = $row.number_lymph_nodes_positive;\n \n if ($row.lymph_nodes_examined_status != null) {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n /* if lymph nodes were examined and number_lymph_nodes_examined is submitted, it must be a value greater than 0. Otherwise, this field should be 0 or left blank. */\n if (($name === \"number_lymph_nodes_examined\") && (!(checkforEmpty($field)))) {\n if (lymphNodesExaminedStatus === \"yes\") { \n if (parseInt($field) <= 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if (parseInt($field) > 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted as 0 or left blank if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n \n /* If lymph nodes were examined, number_lymph_nodes_positive must be submitted and it must be a value less than or equal to number_lymph_nodes_examined (if it is submitted). Otherwise, this field should not be submitted.*/\n else if ($name === \"number_lymph_nodes_positive\") {\n if (lymphNodesExaminedStatus === \"yes\") {\n if (checkforEmpty($field) || $field == null) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if (parseInt($field) < 0) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value greater than or equal to 0 if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n else if ((!(checkforEmpty(numberLymphNodesExamined)) && ((parseInt($field) > parseInt(numberLymphNodesExamined))))) {\n result = {\n valid: false,\n message: `The '${$name}' field must be a value less than or equal to 'number_lymph_nodes_examined' if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n else if ($field || $field != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'lymph_nodes_examined_status' is '${lymphNodesExaminedStatus}'`\n };\n }\n }\n }\n return result;\n})"]},"range":{"left":null,"right":{"min":0}}}},"number_lymph_nodes_examined":{"meta":{"dependsOn":{"left":null,"right":"primary_diagnosis.lymph_nodes_examined_status"},"notes":{"left":null,"right":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'."}},"restrictions":{}},"clinical_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\r\n\r\n \r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\r\n if (!($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n /* This is not a required field, so first ensure that it exists */\r\n else if ($field) {\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"clinical_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"clinical_n_category":{"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"clinical_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"clinical_stage_group":{"description":{"left":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.).","right":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage."},"meta":{"examples":{"left":null,"right":"Stage I, Stage IIB"}},"restrictions":{"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_stage_group')[0];\r\n\r\n const stagingSystem = stagingName + `_tumour_staging_system`;\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\r\n result.valid = false;\r\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\r\n result.message = msg;\r\n }\r\n else if (!($row[stagingSystem]) && $field) {\r\n result.valid = false;\r\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\r\n result.message = msg;\r\n }\r\n else if ($row[stagingSystem] && $field) {\r\n let codeList = [];\r\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb',\r\n 'stage ive',\r\n 'stage ivs'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\r\n $row[stagingSystem]\r\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n \r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"performance_status":{"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}}},"created":{"laterality":{"changeType":"created","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_status":{"changeType":"created","name":"lymph_nodes_examined_status","description":"Indicate if lymph nodes were examined for metastases.","valueType":"string","restrictions":{"required":true,"codeList":["Cannot be determined","No","No lymph nodes found in resected specimen","Not applicable","Yes"]},"meta":{"core":true,"displayName":"Lymph Nodes Examined Status"}},"lymph_nodes_examined_method":{"changeType":"created","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}},"deleted":{}},"treatment":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":["End of life care"],"deleted":[]}}}},"is_primary_treatment":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Yes","No","Unknown"],"right":["Yes","No"],"data":{"added":[],"deleted":["Unknown"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"line_of_treatment":{"meta":{"dependsOn":{"left":null,"right":"treatment.is_primary_treatment"}},"restrictions":{}},"treatment_start_interval":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_duration":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":null,"right":{"exclusiveMin":0}}}},"days_per_cycle":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{}},"number_of_cycles":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{}},"treatment_intent":{"description":{"left":"Indicate the intended disease outcome for which the treatment is given. (Reference: NCIt C124307)","right":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)"},"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Curative","Palliative","Unknown"],"right":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"],"data":{"added":["Diagnostic","Forensic","Guidance","Preventative","Screening","Supportive"],"deleted":["Unknown"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_setting":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Adjuvant","Advanced/Metastatic","Neoadjuvant","Not applicable"],"right":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"],"data":{"added":["Conditioning","Induction","Maintenance","Mobilization","Preventative","Radiosensitization","Salvage"],"deleted":["Not applicable"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"response_to_treatment":{"description":{"left":"The donor's response to the applied treatment regimen. (Source: RECIST)","right":"The donor's response to the applied treatment regimen."},"meta":{"dependsOn":{"left":null,"right":"treatment.response_to_treatment_criteria_method"},"notes":{"left":null,"right":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"restrictions":{"required":{"left":true,"right":null},"codeList":{"left":["Complete response","Disease progression","NED","Partial response","Stable disease"],"right":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"],"data":{"added":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease"],"deleted":["Disease progression","NED"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"]}}},"outcome_of_treatment":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"toxicity_type":{"description":{"left":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hemotological toxicity or non-hemotological toxicity.","right":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity."},"meta":{"dependsOn":{"left":null,"right":"treatment.outcome_of_treatment"}},"restrictions":{"codeList":{"left":["Hemotological","Non-hemotological"],"right":["Hematological","Non-hematological","Not applicable","Unknown"],"data":{"added":["Hematological","Non-hematological","Not applicable","Unknown"],"deleted":["Hemotological","Non-hemotological"]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"]}}},"adverse_events":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"codeList":{"left":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"right":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"data":{"added":["None","Unknown"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"clinical_trials_database":{"meta":{"notes":{"left":null,"right":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added."}},"restrictions":{"codeList":{"left":["NCI Clinical Trials","EU Clinical Trials Register"],"right":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"],"data":{"added":["Not applicable","Unknown"],"deleted":[]}}}},"clinical_trial_number":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n //regex check for clinical trial number\r\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\r\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\r\n\r\n // list of valid clinical trial databases\r\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\r\n \r\n if ($row.clinical_trials_database && $field) {\r\n const trialNumber = $field.trim();\r\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\r\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\r\n result = {valid: false, message: 'The submitted NCI clinical trial number is in incorrect format.'};\r\n }\r\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\r\n result = {valid: false, message: \"The submitted EudraCT clinical trial number is in incorrect format.\"};\r\n }\r\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\r\n result = {valid: false, message: \"The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database.\"};\r\n }\r\n }\r\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\r\n result = {valid: true, message: \"Ok\"};\r\n }\r\n else if ($row.clinical_trials_database && !$field) {\r\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\r\n result = {valid: false, message: \"'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.\"};\r\n } \r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"]}}}},"created":{"response_to_treatment_criteria_method":{"changeType":"created","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},"hematological_toxicity":{"changeType":"created","name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"non-hematological_toxicity":{"changeType":"created","name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"hemotological_toxicity":{"changeType":"deleted","name":"hemotological_toxicity","description":"Indicate the hemotological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5"]},"meta":{"displayName":"Hemotological Toxicity","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"chemotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"description":{"left":"Name of agent or drug administered to patient as part of the treatment regimen.","right":"Name of agent or drug administered to donor as part of the treatment regimen."},"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"created","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"created","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"created","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"created","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}},"deleted":{"chemotherapy_dosage_units":{"changeType":"deleted","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate the total actual drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"description":{"left":"Name of agent or drug administered to patient as part of the treatment regimen.","right":"Name of agent or drug administered to donor as part of the treatment regimen."},"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"created","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{"hormone_drug_dosage_units":{"changeType":"deleted","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"radiation":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"radiation_therapy_fractions":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"radiation_therapy_dosage":{"valueType":{"left":"integer","right":"number"},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"anatomical_site_irradiated":{"description":{"left":"Indicate localization site where radiation therapy was administered.","right":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)"},"restrictions":{"codeList":{"left":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"right":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"data":{"added":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"],"deleted":["Bone","Extremities","Head-Neck","Peritoneum"]}}}}},"created":{"radiation_boost":{"changeType":"created","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"created","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}},"deleted":{}},"follow_up":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_follow_up_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"treatment.submitter_treatment_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"weight_at_followup":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"relapse_type":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"relapse_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n const intervalOfFollowup = parseInt($row.interval_of_followup);\r\n\r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n relapseInterval = parseInt($field);\r\n if (relapseInterval > intervalOfFollowup) {\r\n result = {valid: false, message: `'${$name}' cannot be greater than the 'interval_of_followup'.` }\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const intervalOfFollowup = parseInt($row.interval_of_followup);\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `The '${$name}' field cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n else if (!(checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n relapseInterval = parseInt($field);\n if (relapseInterval > intervalOfFollowup) {\n result = {valid: false, message: `The '${$name}' field cannot be greater than the 'interval_of_followup'.` }\n }\n }\n }\n return result;\n })"]}}},"method_of_progression_status":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\r\n\r\n \r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\r\n if (!($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n /* This is not a required field, so first ensure that it exists */\r\n else if ($field) {\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })","(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_t_category":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"recurrence_n_category":{"meta":{"core":{"left":true,"right":null}}},"recurrence_m_category":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"recurrence_stage_group":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_stage_group')[0];\r\n\r\n const stagingSystem = stagingName + `_tumour_staging_system`;\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\r\n result.valid = false;\r\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\r\n result.message = msg;\r\n }\r\n else if (!($row[stagingSystem]) && $field) {\r\n result.valid = false;\r\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\r\n result.message = msg;\r\n }\r\n else if ($row[stagingSystem] && $field) {\r\n let codeList = [];\r\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb',\r\n 'stage ive',\r\n 'stage ivs'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\r\n $row[stagingSystem]\r\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n \r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"posttherapy_tumour_staging_system":{"restrictions":{"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\r\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\r\n\r\n \r\n /* Contingent on the naming system for tumour staging systems to remain consistent */\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_tumour_staging_system')[0];\r\n const requiredFields = [\r\n `${stagingName}_m_category`,\r\n `${stagingName}_n_category`,\r\n `${stagingName}_t_category`,\r\n ];\r\n const convertedRow = Object.fromEntries(\r\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\r\n );\r\n /* Check for contigous spaces wrapped with quotes (empty strings) */\r\n const checkforEmpty = entry => {\r\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\r\n };\r\n\r\n /* search for fields with falsy values*/\r\n const emptyFields = requiredFields.filter(\r\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\r\n );\r\n\r\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\r\n if (!($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n /* This is not a required field, so first ensure that it exists */\r\n else if ($field) {\r\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\r\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\r\n result = {\r\n valid: false,\r\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\r\n emptyFields,\r\n )}`,\r\n };\r\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\r\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\r\n result = {\r\n valid: false,\r\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\r\n errorFields,\r\n )}`,\r\n };\r\n }\r\n }\r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"posttherapy_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"posttherapy_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"posttherapy_stage_group":{"restrictions":{"codeList":{"left":["Stage 0","Stage 0a","Stage 0is","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IB","Stage IB1","Stage IB2","Stage IC","Stage IS","Stage IE","Stage II","Stage IIA","Stage IIA1","Stage IIA2","Stage IIE","Stage IIB","Stage IIC","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIB","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVB","Stage IVC","Occult carcinoma","Stage 1","Stage 1A","Stage 1B","Stage ISA","Stage ISB","Stage IEA","Stage IEB","Stage IIEA","Stage IIEB","Stage IIES","Stage IIESA","Stage IIESB","Stage IIS","Stage IISA","Stage IISB","Stage IIIE","Stage IIIEA","Stage IIIEB","Stage IIIES","Stage IIIESA","Stage IIIESB","Stage IIIS","Stage IIISA","Stage IIISB","Stage IAB","Stage A","Stage B","Stage C"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Occult Carcinoma","Stage IAE","Stage IAES","Stage IAS","Stage IBE","Stage IBES","Stage IBS","Stage IES","Stage II bulky","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"deleted":["Occult carcinoma","Stage ISA","Stage ISB","Stage IIESA","Stage IIESB","Stage IISA","Stage IISB","Stage IIIEA","Stage IIIEB","Stage IIIESA","Stage IIIESB","Stage IIISA","Stage IIISB"]}},"script":{"left":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = { valid: true, message: 'Ok' };\r\n const stagingName = $name\r\n .trim()\r\n .toLowerCase()\r\n .split('_stage_group')[0];\r\n\r\n const stagingSystem = stagingName + `_tumour_staging_system`;\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n \r\n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\r\n result.valid = false;\r\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\r\n result.message = msg;\r\n }\r\n else if (!($row[stagingSystem]) && $field) {\r\n result.valid = false;\r\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\r\n result.message = msg;\r\n }\r\n else if ($row[stagingSystem] && $field) {\r\n let codeList = [];\r\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\r\n case 'revised international staging system (riss)':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii'\r\n ];\r\n break;\r\n case 'lugano staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage iea',\r\n 'stage ieb',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iiea',\r\n 'stage iieb',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'st jude staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'ann arbor staging system':\r\n codeList = [\r\n 'stage i',\r\n 'stage ia',\r\n 'stage ib',\r\n 'stage ie',\r\n 'stage is',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iie',\r\n 'stage iis',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iiie',\r\n 'stage iiis',\r\n 'stage iv',\r\n 'stage iva',\r\n 'stage ivb',\r\n 'stage ive',\r\n 'stage ivs'\r\n ];\r\n break;\r\n case 'rai staging system':\r\n codeList = [\r\n 'stage 0',\r\n 'stage i',\r\n 'stage ii',\r\n 'stage iii',\r\n 'stage iv'\r\n ];\r\n break;\r\n case 'durie-salmon staging system':\r\n codeList = [\r\n 'stage 1',\r\n 'stage 1a',\r\n 'stage 1b',\r\n 'stage ii',\r\n 'stage iia',\r\n 'stage iib',\r\n 'stage iii',\r\n 'stage iiia',\r\n 'stage iiib'\r\n ];\r\n break;\r\n case 'figo staging system':\r\n codeList = [\r\n 'stage ia',\r\n 'stage ia1',\r\n 'stage ia2',\r\n 'stage ib',\r\n 'stage ib1',\r\n 'stage ib2',\r\n 'stage iia',\r\n 'stage iab',\r\n 'stage iiia',\r\n 'stage iiib',\r\n 'stage iva',\r\n 'stage ivb'\r\n ];\r\n break;\r\n case 'binet staging system':\r\n codeList = [\r\n 'stage a',\r\n 'stage b',\r\n 'stage c'\r\n ];\r\n break;\r\n case 'ajcc 8th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\r\n break;\r\n case 'ajcc 7th edition':\r\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\r\n];\r\n break;\r\n default:\r\n codelist = [];\r\n }\r\n\r\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\r\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\r\n $row[stagingSystem]\r\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\r\n .map(code => `- \"${code}\"`)\r\n .join('\\n')}`;\r\n\r\n result.valid = false;\r\n result.message = msg;\r\n }\r\n }\r\n \r\n return result;\r\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}}},"created":{"anatomic_site_progression_or_recurrence":{"changeType":"created","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"anatomic_site_progression_or_recurrences":{"changeType":"deleted","description":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate(inputs) {\r\n const {$row, $name, $field} = inputs;\r\n let result = {valid: true, message: \"Ok\"};\r\n \r\n /* required field, cannot be null */\r\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\r\n \r\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \r\n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\r\n \r\n // checks for a string just consisting of whitespace\r\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\r\n\r\n\r\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\r\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\r\n }\r\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\r\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\r\n }\r\n return result;\r\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1,C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}}}},"immunotherapy":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"Unique identifier of the treatment, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"immunotherapy_type":{"changeType":"created","name":"immunotherapy_type","valueType":"string","description":"Indicate the type of immunotherapy administered to donor.","meta":{"displayName":"Immunotherapy Type","core":true},"restrictions":{"required":true,"codeList":["Cell-based","Immune checkpoint inhibitors","Monoclonal antibodies other than immune checkpoint inhibitors","Other immunomodulatory substances"]}},"drug_rxnormcui":{"changeType":"created","name":"drug_rxnormcui","description":"The unique RxNormID assigned to the treatment regimen drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_database","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"RxNormCUI"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_name":{"changeType":"created","name":"drug_name","description":"Name of agent or drug administered to donor as part of the treatment regimen.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Chemotherapy Drug Name"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"created","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{}},"surgery":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"created","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"created","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"created","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"created","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"created","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"created","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"created","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"created","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"created","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"created","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"created","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"created","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"created","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"created","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}},"deleted":{}},"exposure":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"created","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"created","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"created","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"created","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"created","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"created","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"created","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"created","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"created","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"created","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"created","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"created","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"created","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}},"deleted":{}},"family_history":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"family_relative_id":{"changeType":"created","description":"Unique identifier of the relative, assigned by the data provider.","name":"family_relative_id","valueType":"string","meta":{"displayName":"Family Relative ID","primaryId":true,"notes":"This field is required to ensure that family members are identified in unique records. Ids can be as simple as an incremented numeral to ensure uniqueness."},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"relative_with_cancer_history":{"changeType":"created","description":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","name":"relative_with_cancer_history","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Relative with Cancer History"}},"relationship_type":{"changeType":"created","description":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)","name":"relationship_type","restrictions":{"codeList":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"]},"valueType":"string","meta":{"displayName":"Relationship Type"}},"gender_of_relative":{"changeType":"created","description":"The self-reported gender of related individual.","name":"gender_of_relative","restrictions":{"codeList":["Female","Male","Other","Unknown"]},"valueType":"string","meta":{"displayName":"Gender of Relative"}},"age_of_relative_at_diagnosis":{"changeType":"created","description":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","name":"age_of_relative_at_diagnosis","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","displayName":"Age Of Relative At Diagnosis"}},"cancer_type_code_of_relative":{"changeType":"created","name":"cancer_type_code_of_relative","valueType":"string","description":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","restrictions":{"regex":"^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"examples":"C41.1,C16.9,C00.5,D46.9","dependsOn":"family_history.relative_with_cancer_history","displayName":"Cancer Type Code (ICD-10) of Relative"}},"relative_vital_status":{"changeType":"created","description":"Relative's last known state of living or deceased.","name":"relative_vital_status","restrictions":{"codeList":["Alive","Deceased","Unknown"]},"valueType":"string","meta":{"displayName":"Vital Status of Relative"}},"cause_of_death_of_relative":{"changeType":"created","description":"Indicate the cause of the death of the relative.","name":"cause_of_death_of_relative","restrictions":{"codeList":["Died of cancer","Died of other reasons","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n if ($row.relative_vital_status && $row.relative_vital_status != null) {\n const vitalStatus = $row.relative_vital_status.trim().toLowerCase();\n if (($field || $field != null) && (vitalStatus === \"alive\" || vitalStatus === \"unknown\")) {\n result = {valid: false, message: `The '${$name}' field cannot be submitted if the relative's vital_status is '${vitalStatus}'.`}\n }\n }\n else {\n if ($field || $field != null) {\n result = {valid: false, message: `The 'relative_vital_status' field must be submitted as 'deceased' if the '${$name}' field is submitted.` }\n }\n }\n return result;\n })"]},"valueType":"string","meta":{"dependsOn":"family_history.relative_vital_status","displayName":"Cause of Death of Relative"}},"relative_survival_time":{"changeType":"created","description":"Indicate how long, in days, the relative survived from the time they were diagnosed with cancer.","name":"relative_survival_time","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"valueType":"integer","meta":{"dependsOn":"family_history.relative_with_cancer_history","units":"days","displayName":"Survival Time Of Relative"}}},"deleted":{}},"biomarker":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"created","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"created","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"created","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"created","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"created","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"created","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"created","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"created","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"created","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"created","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"created","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"created","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"created","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"created","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"created","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"created","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"created","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"created","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"created","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}},"deleted":{}},"comorbidity":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"created","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"created","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"created","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"created","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"created","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"created","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}},"deleted":{}}}} diff --git a/website/static/data/schemas/diffs/1.8/1.8-diff-1.24.json b/website/static/data/schemas/diffs/1.8/1.8-diff-1.24.json new file mode 100644 index 00000000..8d479ce9 --- /dev/null +++ b/website/static/data/schemas/diffs/1.8/1.8-diff-1.24.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"],"deleted":[]}}}},"submitter_sample_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased","Unknown"],"right":["Alive","Deceased"],"data":{"added":[],"deleted":["Unknown"]}}}},"survival_time":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"primary_site":{"meta":{"notes":{"left":null,"right":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"examples":{"left":null,"right":"Breast|Ovary"}},"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Not Reported","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva","Unknown"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"data":{"added":["Unknown primary site"],"deleted":["Not Reported","Unknown"]}}}},"height":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"weight":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"bmi":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"age_at_menarche":{"description":{"left":"Indicate the donor's age of menarche, the first occurrence of menstruation.","right":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)"},"restrictions":{}},"number_of_pregnancies":{"description":{"left":"Indicate the number of pregnancies a donor has had.","right":"Indicate the total number of pregnancy events experienced by the donor. (Reference: NCIt C106551)"},"restrictions":{}},"number_of_children":{"description":{"left":"Indicate the number of children the donor has birthed.","right":"Indicate the number of children the donor has birthed. (Reference: caDSR CDE ID 2486644)"},"restrictions":{}}},"created":{"genetic_disorders":{"changeType":"created","description":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","name":"genetic_disorders","valueType":"string","isArray":true,"restrictions":{"codeList":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"]},"meta":{"displayName":"Genetic Disorders","notes":"If the genetic disorder term you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added. To include multiple values, separate values with a pipe delimiter '|' within your file.","examples":"Familial Adenomatous Polyposis Syndrome (FAP)|Lynch Syndrome"}},"hrt_type":{"changeType":"created","description":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking.","name":"hrt_type","restrictions":{"codeList":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"]},"valueType":"string","meta":{"displayName":"Hormone Replacement Therapy Type"}},"hrt_duration":{"changeType":"created","description":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","name":"hrt_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormone Replacement Therapy Duration","units":"months","dependsOn":"donor.hrt_type"}},"contraception_type":{"changeType":"created","description":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","name":"contraception_type","restrictions":{"codeList":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"]},"valueType":"string","meta":{"displayName":"Contraception Type"}},"contraception_duration":{"changeType":"created","description":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","name":"contraception_duration","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"displayName":"Hormonal Contraception Duration","units":"months","dependsOn":"donor.contraception_type"}},"lost_to_followup_after_clinical_event_id":{"changeType":"created","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}},"deleted":{}},"specimen":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"pathological_tumour_staging_system":{"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"pathological_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"pathological_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"pathological_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Cannot be assessed"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n \n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"specimen_storage":{"description":{"left":"Indicate the method of specimen storage for specimens that were not extracted freshly or immediately cultured.","right":"Indicate the method of specimen storage for specimen that were not extracted freshly or immediately cultured."},"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"reference_pathology_confirmed":{"description":{"left":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist.","right":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)"}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"percent_tumour_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of infiltration by tumour cells in a specimen.","right":"Indicate a value, in decimals, that represents the percent of tumour cells compared to the number of total cells in a specimen. (Reference: NCIt: C159484)"},"restrictions":{}},"percent_proliferating_cells":{"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_inflammatory_tissue":{"description":{"left":"Indicate a value, in decimals, that represents local response to cellular injury, marked by capillary dilatation, edema and leukocyte infiltration; clinically, inflammation is manifest by redness, heat, pain, swelling and loss of function, with the need to heal damaged tissue.","right":"Indicate a value, in decimals, that represents the percent of a specimen that is positive for inflammatory markers, including the presence of capillary dilatation, edema and increased leukocytes. (Reference NCIt C159479)"},"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_stromal_cells":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a malignant tumour specimen but are not malignant such as fibroblasts, vascular structures, etc.","right":"Indicate a value, in decimals, that represents the percentage of reactive cells that are present in a tumour specimen but are not malignant such as fibroblasts, vascular structures, etc. (Reference caDSR CDE ID 2841241)"},"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}},"percent_necrosis":{"description":{"left":"Indicate a value, in decimals, that represents the percentage of cell death in a malignant tumour specimen.","right":"Indicate a value, in decimals, that represents the percent of cells undergoing necrosis compared to the number of total cells present in a tumour specimen. (Reference NCIt C159481)"},"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}},"restrictions":{}}},"created":{"specimen_laterality":{"changeType":"created","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"percent_tumour_cells_measurement_method":{"changeType":"created","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}},"deleted":{}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"age_at_diagnosis":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0,"max":90}}}},"number_lymph_nodes_examined":{"meta":{"notes":{"left":null,"right":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'."}},"restrictions":{"range":{"left":null,"right":{"min":0}}}},"number_lymph_nodes_positive":{"restrictions":{"range":{"left":null,"right":{"min":0}}}},"clinical_tumour_staging_system":{"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"clinical_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"clinical_n_category":{"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"clinical_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"clinical_stage_group":{"description":{"left":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage (ie. Stage I, Stage II, Stage III etc.).","right":"Stage group of the tumour, as assigned by the reporting clinical_tumour_staging_system, that indicates the overall prognostic tumour stage."},"meta":{"examples":{"left":null,"right":"Stage I, Stage IIB"}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Cannot be assessed"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n \n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"performance_status":{"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}}},"created":{"laterality":{"changeType":"created","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_method":{"changeType":"created","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}},"deleted":{}},"treatment":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":["End of life care"],"deleted":[]}}}},"is_primary_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Yes","No","Unknown"],"right":["Yes","No"],"data":{"added":[],"deleted":["Unknown"]}}}},"line_of_treatment":{"meta":{"dependsOn":{"left":null,"right":"treatment.is_primary_treatment"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"]},"range":{"left":{"exclusiveMin":0},"right":null}}},"treatment_start_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":{"exclusiveMin":0},"right":null}}},"treatment_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"days_per_cycle":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"number_of_cycles":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_intent":{"description":{"left":"Indicate the intended disease outcome for which the treatment is given. (Reference: NCIt C124307)","right":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)"},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Curative","Palliative","Unknown"],"right":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"],"data":{"added":["Diagnostic","Forensic","Guidance","Preventative","Screening","Supportive"],"deleted":["Unknown"]}}}},"treatment_setting":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Adjuvant","Advanced/Metastatic","Neoadjuvant","Not applicable"],"right":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"],"data":{"added":["Conditioning","Induction","Maintenance","Mobilization","Preventative","Radiosensitization","Salvage"],"deleted":["Not applicable"]}}}},"response_to_treatment":{"description":{"left":"The donor's response to the applied treatment regimen. (Source: RECIST)","right":"The donor's response to the applied treatment regimen."},"meta":{"dependsOn":{"left":"treatment.treatment_type","right":"treatment.response_to_treatment_criteria_method"},"notes":{"left":null,"right":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"]},"codeList":{"left":["Complete response","Disease progression","NED","Partial response","Stable disease"],"right":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"],"data":{"added":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease"],"deleted":["Disease progression","NED"]}}}},"outcome_of_treatment":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"toxicity_type":{"description":{"left":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hemotological toxicity or non-hemotological toxicity.","right":"If the treatment was terminated early due to acute toxicity, indicate whether it was due to hematological toxicity or non-hematological toxicity."},"meta":{"dependsOn":{"left":null,"right":"treatment.outcome_of_treatment"}},"restrictions":{"codeList":{"left":["Hemotological","Non-hemotological"],"right":["Hematological","Non-hematological","Not applicable","Unknown"],"data":{"added":["Hematological","Non-hematological","Not applicable","Unknown"],"deleted":["Hemotological","Non-hemotological"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"]}}},"adverse_events":{"meta":{"dependsOn":{"left":null,"right":"treatment.treatment_type"}},"restrictions":{"codeList":{"left":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"right":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"data":{"added":["None","Unknown"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"clinical_trials_database":{"meta":{"notes":{"left":null,"right":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added."}},"restrictions":{"codeList":{"left":["NCI Clinical Trials","EU Clinical Trials Register"],"right":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"],"data":{"added":["Not applicable","Unknown"],"deleted":[]}}}},"clinical_trial_number":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"]}}}},"created":{"response_to_treatment_criteria_method":{"changeType":"created","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}},"hematological_toxicity":{"changeType":"created","name":"hematological_toxicity","description":"Indicate the hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}},"non-hematological_toxicity":{"changeType":"created","name":"non-hematological_toxicity","description":"Indicate the non-hematological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"displayName":"Non-hematological Toxicity","dependsOn":"treatment.toxicity_type","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"hemotological_toxicity":{"changeType":"deleted","name":"hemotological_toxicity","description":"Indicate the hemotological toxicities which caused early termination of the treatment. (Codelist reference: NCI-CTCAE (v5.0))","valueType":"string","isArray":true,"restrictions":{"codeList":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Hemotological Toxicity","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."}}}},"chemotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"description":{"left":"Name of agent or drug administered to patient as part of the treatment regimen.","right":"Name of agent or drug administered to donor as part of the treatment regimen."},"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"created","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"created","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"created","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"created","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}},"deleted":{"chemotherapy_dosage_units":{"changeType":"deleted","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate the total actual drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"description":{"left":"Name of agent or drug administered to patient as part of the treatment regimen.","right":"Name of agent or drug administered to donor as part of the treatment regimen."},"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"created","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{"hormone_drug_dosage_units":{"changeType":"deleted","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"radiation":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"radiation_therapy_fractions":{"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"radiation_therapy_dosage":{"valueType":{"left":"integer","right":"number"},"restrictions":{"range":{"left":null,"right":{"exclusiveMin":0}}}},"anatomical_site_irradiated":{"description":{"left":"Indicate localization site where radiation therapy was administered.","right":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)"},"restrictions":{"codeList":{"left":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"right":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"data":{"added":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"],"deleted":["Bone","Extremities","Head-Neck","Peritoneum"]}}}}},"created":{"radiation_boost":{"changeType":"created","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"created","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}},"deleted":{}},"immunotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"immunotherapy_type":{"description":{"left":"Indicate the type of immunotherapy administered to patient.","right":"Indicate the type of immunotherapy administered to donor."},"meta":{"core":{"left":null,"right":true}},"restrictions":{"required":{"left":null,"right":true}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"immunotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"description":{"left":"Name of agent or drug administered to patient as part of the treatment regimen.","right":"Name of agent or drug administered to donor as part of the treatment regimen."},"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"displayName":{"left":"Immunotherapy Drug Name","right":"Chemotherapy Drug Name"},"dependsOn":{"left":null,"right":"immunotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"created","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{}},"follow_up":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_follow_up_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"interval_of_followup":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"treatment.submitter_treatment_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"weight_at_followup":{"valueType":{"left":"integer","right":"number"},"restrictions":{}},"relapse_type":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"relapse_interval":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"method_of_progression_status":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_t_category":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"recurrence_n_category":{"meta":{"core":{"left":true,"right":null}}},"recurrence_m_category":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"recurrence_stage_group":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Cannot be assessed"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n \n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"posttherapy_tumour_staging_system":{"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"posttherapy_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"posttherapy_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"posttherapy_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Cannot be assessed"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n \n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}}},"created":{"anatomic_site_progression_or_recurrence":{"changeType":"created","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"anatomic_site_progression_or_recurrences":{"changeType":"deleted","description":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1,C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}}}},"family_history":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"family_relative_id":{"meta":{"primaryId":{"left":null,"right":true}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"relative_with_cancer_history":{"description":{"left":"Indicate if patient has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)","right":"Indicate if donor has any genetic relatives with a history of cancer. (Reference: NCIt C159104, caDSR CDE ID 6161023)"}},"relationship_type":{"description":{"left":"Indicate genetic relationship of the relative to patient. (Reference: caDSR CDE ID 2179937)","right":"Indicate genetic relationship of the relative to the donor. (Reference: caDSR CDE ID 2179937)"},"restrictions":{"codeList":{"left":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Sister","Son","Unknown"],"right":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"],"data":{"added":["Maternal Uncle","Paternal Uncle","Uncle"],"deleted":[]}}}},"age_of_relative_at_diagnosis":{"description":{"left":"The age (in years) when the patient's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)","right":"The age (in years) when the donor's relative was first diagnosed. (Reference: caDSR CDE ID 5300571)"},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}},"cancer_type_code_of_relative":{"description":{"left":"The code to describe the malignant diagnosis of the patient's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification.","right":"The code to describe the malignant diagnosis of the donor's relative with a history of cancer using the WHO ICD-10 code (https://icd.who.int/browse10/2019/en) classification."},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}},"relative_survival_time":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n if ($row.relative_with_cancer_history != null) {\n const relativeWithCancerHistory = $row.relative_with_cancer_history.trim().toLowerCase();\n if (((relativeWithCancerHistory === \"no\") || (relativeWithCancerHistory === \"unknown\")) && currField != null) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if the 'relative_with_cancer_history' field is '${relativeWithCancerHistory}'`,\n };\n }\n }\n else {\n if (currField || currField != null) {\n result = { valid: false, message: `The 'relative_with_cancer_history' field must be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}}},"created":{},"deleted":{}},"surgery":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"created","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"created","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"created","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"created","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"created","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"created","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"created","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"created","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"created","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"created","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"created","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"created","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"created","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"created","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}},"deleted":{}},"exposure":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"created","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"created","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"created","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"created","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"created","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"created","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"created","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"created","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"created","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"created","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"created","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"created","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"created","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}},"deleted":{}},"biomarker":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"created","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"created","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"created","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"created","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"created","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"created","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"created","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"created","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"created","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"created","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"created","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"created","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"created","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"created","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"created","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"created","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"created","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"created","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"created","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}},"deleted":{}},"comorbidity":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"created","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"created","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"created","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"created","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"created","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"created","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}},"deleted":{}}}} diff --git a/website/static/data/schemas/diffs/1.9/1.9-diff-1.24.json b/website/static/data/schemas/diffs/1.9/1.9-diff-1.24.json new file mode 100644 index 00000000..806b77c1 --- /dev/null +++ b/website/static/data/schemas/diffs/1.9/1.9-diff-1.24.json @@ -0,0 +1 @@ +{"schemas":{"sample_registration":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"specimen_type":{"restrictions":{"codeList":{"left":["Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"right":["Cell line - derived from metastatic tumour","Cell line - derived from normal","Cell line - derived from tumour","Cell line - derived from xenograft tumour","Metastatic tumour - additional metastatic","Metastatic tumour - metastasis local to lymph node","Metastatic tumour - metastasis to distant location","Metastatic tumour","Normal - tissue adjacent to primary tumour","Normal","Primary tumour - additional new primary","Primary tumour - adjacent to normal","Primary tumour","Recurrent tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour","Xenograft - derived from primary tumour","Xenograft - derived from tumour cell line"],"data":{"added":["Cell line - derived from metastatic tumour","Tumour - unknown if derived from primary or metastatic","Xenograft - derived from metastatic tumour"],"deleted":[]}}}},"submitter_sample_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}}},"created":{},"deleted":{}},"donor":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"vital_status":{"restrictions":{"codeList":{"left":["Alive","Deceased","Unknown"],"right":["Alive","Deceased"],"data":{"added":[],"deleted":["Unknown"]}}}},"primary_site":{"restrictions":{"codeList":{"left":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Ureter","Uterus, NOS","Vagina","Vulva"],"right":["Accessory sinuses","Adrenal gland","Anus and anal canal","Base of tongue","Bladder","Bones, joints and articular cartilage of limbs","Bones, joints and articular cartilage of other and unspecified sites","Brain","Breast","Bronchus and lung","Cervix uteri","Colon","Connective, subcutaneous and other soft tissues","Corpus uteri","Esophagus","Eye and adnexa","Floor of mouth","Gallbladder","Gum","Heart, mediastinum, and pleura","Hematopoietic and reticuloendothelial systems","Hypopharynx","Kidney","Larynx","Lip","Liver and intrahepatic bile ducts","Lymph nodes","Meninges","Nasal cavity and middle ear","Nasopharynx","Oropharynx","Other and ill-defined digestive organs","Other and ill-defined sites","Other and ill-defined sites in lip, oral cavity and pharynx","Other and ill-defined sites within respiratory system and intrathoracic organs","Other and unspecified female genital organs","Other and unspecified major salivary glands","Other and unspecified male genital organs","Other and unspecified parts of biliary tract","Other and unspecified parts of mouth","Other and unspecified parts of tongue","Other and unspecified urinary organs","Other endocrine glands and related structures","Ovary","Palate","Pancreas","Parotid gland","Penis","Peripheral nerves and autonomic nervous system","Placenta","Prostate gland","Pyriform sinus","Rectosigmoid junction","Rectum","Renal pelvis","Retroperitoneum and peritoneum","Skin","Small intestine","Spinal cord, cranial nerves, and other parts of central nervous system","Stomach","Testis","Thymus","Thyroid gland","Tonsil","Trachea","Unknown primary site","Ureter","Uterus, NOS","Vagina","Vulva"],"data":{"added":["Unknown primary site"],"deleted":[]}}}},"genetic_disorders":{"description":{"left":"Indicate presence of any hereditary genetic disorders. (Reference: Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)","right":"Indicate presence of any hereditary genetic disorders. Genetic diseases are diseases in which inherited genes predispose to increased risk. The genetic disorders associated with cancer often result from an alteration or mutation in a single gene. The diseases range from rare dominant cancer family syndrome to familial tendencies in which low-penetrance genes may interact with other genes or environmental factors to induce cancer. (References: NCIt C3101. Genetic disorder names were standardized using Orphanet (https://www.orpha.net/) and NCI Thesaurus)"},"restrictions":{"codeList":{"left":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Serrated Polyposis Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"],"right":["Alpha-1-antitrypsin Deficiency","Ataxia Telangiectasia Syndrome","BAP1-related Tumor Predisposition Syndrome","Beckwith-Wiedemann Syndrome","Birt-Hogg-Dub Syndrome","Bloom Syndrome","Carney Complex","Cowden Syndrome","Familial Adenomatous Polyposis Syndrome (FAP)","Familial Atypical Multiple Mole Melanoma Syndrome (FAMMM)","Familial Gastrointestinal Stromal Tumor","Fanconi Anemia","Gardner Syndrome","Glycogen Storage Disease","Gorlin Syndrome","Hereditary Breast and Ovarian Cancer Syndrome (HBOC)","Hereditary Diffuse Gastric Cancer","Hereditary Leiomyomatosis and Renal Cell Cancer (HLRCC)","Hereditary Pancreatitis","Hereditary Papillary Renal Cell Carcinoma","Hereditary Retinoblastoma","Juvenile Polyposis Syndrome","Li-Fraumeni Syndrome","Lynch Syndrome","Muir-Torre Syndrome","Multiple Endocrine Neoplasia Type 1 (MEN1)","Multiple Endocrine Neoplasia type 2 (MEN2)","MUTYH Polyposis Syndrome","Neurofibromatosis Type 1","Neurofibromatosis Type 2","None","Not applicable","Peutz-Jeghers Syndrome","PTEN hamartoma Tumor Syndrome","Rubinstein-Taybi Syndrome","Serrated Polyposis Syndrome","Sjogren Syndrome","Tuberous Sclerosis Complex","Turcot Syndrome","Tyrosinemia Type 1","Unknown","von Hippel-Lindau Syndrome","Werner Syndrome","Wiskott-Aldrich Syndrome","Xeroderma Pigmentosum"],"data":{"added":["None","Not applicable","Unknown"],"deleted":[]}}}},"age_at_menarche":{"description":{"left":"Indicate the donor's age at which the first menstruation event occurred. (Reference: NCIt C19666)","right":"Indicate the donor's age, in years, at which the first menstruation event occurred. (Reference: NCIt C19666)"}},"hrt_type":{"description":{"left":"Indicate the type of hormone replacement therapy (HRT) the patient has taken or is currently taking.","right":"Indicate the type of hormone replacement therapy (HRT) the donor has taken or is currently taking."},"restrictions":{"codeList":{"left":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Other","Patch","Pill","Unknown"],"right":["Combination HRT","Estrogen-only HRT","Injectable","Never taken HRT","Not applicable","Other","Patch","Pill","Unknown"],"data":{"added":["Not applicable"],"deleted":[]}}}},"hrt_duration":{"description":{"left":"If patient has taken hormone replacement therapy (HRT), indicate how long patient has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)","right":"If donor has taken hormone replacement therapy (HRT), indicate how long donor has been taking HRT, in months. (Reference: caDSR CDE ID 5365433)"},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\") {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If '${$name}' is submitted, then '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"]}}},"contraception_type":{"description":{"left":"Indicate the type of hormonal contraception the patient has taken or is currently taking. (Reference: caDSR CDE ID 3264234)","right":"Indicate the type of hormonal contraception the donor has taken or is currently taking. (Reference: caDSR CDE ID 3264234)"},"restrictions":{"codeList":{"left":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Other","Progestin-only pill","Unknown","Vaginal ring"],"right":["Combination pill","Contraceptive implant","Contraceptive patch","Injectable","Intrauterine device","Never used hormonal contraception","Not applicable","Oral contraceptive pill","Other","Progestin-only pill","Unknown","Vaginal ring"],"data":{"added":["Not applicable","Oral contraceptive pill"],"deleted":[]}}}},"contraception_duration":{"description":{"left":"If patient has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)","right":"If donor has taken hormonal contraception, indicate duration of use, in months. (Reference: caDSR CDE ID 5206887)"},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\") {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If '${$name}' is submitted, then '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const type = $name.trim().toLowerCase().split('_duration')[0];\n const hormoneType = type + `_type`;\n \n if ($field != null && !(checkforEmpty($field))) {\n if (!$row[hormoneType] || $row[hormoneType] === null || checkforEmpty($row[hormoneType])) {\n result = { valid: false, message: `Indicate type of ${type} taken in the '${hormoneType}' field if '${$name}' field is submitted.`};\n }\n else if ($row[hormoneType].toLowerCase() === \"never taken hrt\" || $row[hormoneType].toLowerCase() === \"never used hormonal contraception\" || $row[hormoneType].toLowerCase() === 'not applicable' || $row[hormoneType].toLowerCase() === 'unknown') {\n const submittedValue = $row[hormoneType].toLowerCase()\n result = {valid: false, message: `If the '${$name}' field is submitted, then the '${hormoneType}' field cannot be '${submittedValue}'.`};\n }\n }\n return result;\n })"]}}}},"created":{"lost_to_followup_after_clinical_event_id":{"changeType":"created","description":"If the donor became lost to follow up, indicate the identifier of the clinical event (eg. submitter_primary_diagnosis_id, submitter_treatment_id or submitter_follow_up_id) after which the donor became lost to follow up.","name":"lost_to_followup_after_clinical_event_id","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (currField != null && !(checkforEmpty(currField))) {\n const vitalStatus = $row.vital_status.trim().toLowerCase();\n\n if (vitalStatus === \"deceased\") {\n result = {valid: false, message: `${$name} cannot be submitted if the donor's vital_status is deceased.`}\n }\n }\n return result;\n })"]},"meta":{"displayName":"Lost To Follow Up After Clinical Event","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","validationDependency":true}}},"deleted":{}},"specimen":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_specimen_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"pathological_tumour_staging_system":{"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"pathological_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"pathological_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"pathological_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Cannot be assessed"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n \n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"specimen_acquisition_interval":{"restrictions":{"range":{"left":{"min":0},"right":null}}},"specimen_processing":{"restrictions":{"codeList":{"left":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other"],"right":["Cryopreservation in liquid nitrogen (dead tissue)","Cryopreservation in dry ice (dead tissue)","Cryopreservation of live cells in liquid nitrogen","Cryopreservation - other","Formalin fixed & paraffin embedded","Formalin fixed - buffered","Formalin fixed - unbuffered","Fresh","Other","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"specimen_storage":{"restrictions":{"codeList":{"left":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen"],"right":["Cut slide","Frozen in -70 freezer","Frozen in liquid nitrogen","Frozen in vapour phase","Not Applicable","Other","Paraffin block","RNA later frozen","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}},"reference_pathology_confirmed":{"description":{"left":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist.","right":"Indicate whether the pathological diagnosis was confirmed by a (central) reference pathologist. (Reference caDSR CDE ID 2007007)"}},"tumour_grade":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n if ($row.tumour_grading_system && $field) {\n let codeList = [];\n const tieredGradingList = ['gx','g1','g2','g3'];\n const gradingSystems = ['two-tier grading system', 'three-tier grading system', 'four-tier grading system', 'grading system for gists', 'grading system for gnets', 'isup grading system', 'who grading system for cns tumours', 'fnclcc grading system', 'gleason grade group system', 'scarff-bloom-richardson grading system', 'nuclear grading system for dcis'];\n switch ($row.tumour_grading_system && $row.tumour_grading_system.trim().toLowerCase()) {\n case 'two-tier grading system':\n codeList = [\n 'low grade',\n 'high grade',\n ];\n break;\n case 'three-tier grading system':\n codeList = tieredGradingList;\n break;\n case 'four-tier grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'grading system for gists':\n codeList = [\n 'low',\n 'high',\n ];\n break;\n case 'grading system for gnets':\n codeList = tieredGradingList;\n break;\n case 'isup grading system':\n codeList = [\n 'gx',\n 'g1',\n 'g2',\n 'g3',\n 'g4',\n ];\n break;\n case 'who grading system for cns tumours':\n codeList = [\n 'grade i',\n 'grade ii',\n 'grade iii',\n 'grade iv',\n ];\n break;\n case 'fnclcc grading system':\n codeList = tieredGradingList;\n break;\n case 'gleason grade group system':\n codeList = [\n 'grade group 1',\n 'grade group 2',\n 'grade group 3',\n 'grade group 4',\n 'grade group 5',\n ];\n break;\n case 'scarff-bloom-richardson grading system':\n codeList = tieredGradingList;\n break;\n case 'nuclear grading system for dcis':\n codeList = tieredGradingList;\n break;\n case 'unknown':\n codeList = ['unknown'];\n break;\n case 'not applicable':\n codeList = ['not applicable'];\n break;\n }\n\n if (!codeList.includes($field.trim().toLowerCase())) {\n const msg = `'${$field}' is not a permissible value. When 'tumour_grading_system' is set to '${\n $row.tumour_grading_system\n }', 'tumour_grade' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n result.valid = false;\n result.message = msg;\n }\n else if (!gradingSystems.includes($row.tumour_grading_system.trim().toLowerCase())) {\n result.valid = false;\n const msg = `'${$row.tumour_grading_system}' is not a permissible value for 'tumour_grading_system'. If the tumour grading system you use is missing, please contact the DCC.`;\n result.message = msg;\n }\n }\n return result;\n })"]}}},"percent_tumour_cells":{"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n // When $name is percent_tumour_cells, and $field is a number between 0 and 1\n const {$row, $name, $field} = inputs;\n\n const result = { valid: true, message: 'Ok' };\n const measurementMethodExceptionTypes = ['not applicable'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n const fieldHasValue = $field && $field != null && !(checkforEmpty($field));\n const measurementMethod = $row?.percent_tumour_cells_measurement_method?.trim?.().toLowerCase();\n\n if (fieldHasValue) {\n if (measurementMethodExceptionTypes.includes(measurementMethod)) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'percent_tumour_cells_measurement_method' = 'Not applicable'`\n };\n }\n }\n\n return result;\n })"]}}},"percent_proliferating_cells":{"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}}},"percent_inflammatory_tissue":{"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}}},"percent_stromal_cells":{"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}}},"percent_necrosis":{"meta":{"notes":{"left":"","right":"This field should only be submitted if the specimen is tumour."}}}},"created":{"specimen_laterality":{"changeType":"created","name":"specimen_laterality","description":"For cancer in a paired organ, indicate the side on which the specimen was obtained. (Reference caDSR CDE ID 2007875)","valueType":"string","restrictions":{"codeList":["Left","Not applicable","Right","Unknown"]},"meta":{"displayName":"Specimen Laterality"}},"percent_tumour_cells_measurement_method":{"changeType":"created","name":"percent_tumour_cells_measurement_method","description":"Indicate method used to measure percent_tumour_cells.","valueType":"string","meta":{"core":true,"dependsOn":"sample_registration.tumour_normal_designation","notes":"This field is only required if the specimen is a tumour.","displayName":"Percent Tumour Cells Measurement Method"},"restrictions":{"codeList":["Genomics","Image analysis","Pathology estimate by percent nuclei"]}}},"deleted":{}},"primary_diagnosis":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"number_lymph_nodes_examined":{"meta":{"notes":{"left":null,"right":"This field should only be submitted if 'lymph_nodes_examined_status' is 'Yes'."}}},"clinical_tumour_staging_system":{"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"clinical_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"clinical_n_category":{"restrictions":{"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n \n const nCategoriesExclude = ['n0(i-)','n0(i+)','n0(mol-)','n0(mol+)','n4'];\n \n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n if ($row.clinical_tumour_staging_system && $row.clinical_tumour_staging_system != null && !(checkforEmpty($row.clinical_tumour_staging_system))) {\n if ($row.clinical_tumour_staging_system.trim().toLowerCase() === 'ajcc 6th edition') {\n if ($field && $field != null && !(checkforEmpty($field)) && nCategoriesExclude.includes($field.trim().toLowerCase())) {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid N category in the clinical_tumour_staging_system '${$row.clinical_tumour_staging_system}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"clinical_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"clinical_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Cannot be assessed"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n \n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"performance_status":{"restrictions":{"codeList":{"left":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4"],"right":["Grade 0","Grade 1","Grade 2","Grade 3","Grade 4","Unknown"],"data":{"added":["Unknown"],"deleted":[]}}}}},"created":{"laterality":{"changeType":"created","name":"laterality","description":"For cancer in a paired organ, indicate the side of the body on which the primary tumour or cancer first developed at the time of primary diagnosis. (Reference caDSR CDE ID 827)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not a paired site","Right","Unilateral, side not specified","Unknown"]},"meta":{"displayName":"Laterality"}},"lymph_nodes_examined_method":{"changeType":"created","name":"lymph_nodes_examined_method","description":"Indicate the method used to examine lymph nodes.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n const notExamined = ['cannot be determined', 'no', 'no lymph nodes found in resected specimen', 'not applicable', 'unknown'];\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (!$row.lymph_nodes_examined_status || $row.lymph_nodes_examined_status === null || checkforEmpty($row.lymph_nodes_examined_status)) {\n result = {valid: false, message: `The 'lymph_nodes_examined_status' field must be submitted.`};\n }\n else {\n const lymphNodesExaminedStatus = $row.lymph_nodes_examined_status.trim().toLowerCase();\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if (lymphNodesExaminedStatus === 'yes') {\n result = { valid: false, message: `The '${$name}' field must be submitted if the 'lymph_nodes_examined_status' field is 'Yes'`};\n }\n }\n else {\n if (notExamined.includes(lymphNodesExaminedStatus)) {\n result = { valid: false, message: `The '${$name}' field should not be submitted if the 'lymph_nodes_examined_status' field is '${lymphNodesExaminedStatus}'`};\n }\n }\n }\n return result;\n})"],"codeList":["Imaging","Lymph node dissection/pathological exam","Physical palpation of patient"]},"meta":{"core":true,"dependsOn":"primary_diagnosis.lymph_nodes_examined_status","displayName":"Method Used to Examine Lymph Nodes"}}},"deleted":{}},"treatment":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"treatment_type":{"restrictions":{"codeList":{"left":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"right":["Ablation","Bone marrow transplant","Chemotherapy","Endoscopic therapy","End of life care","Hormonal therapy","Immunotherapy","No treatment","Other targeting molecular therapy","Photodynamic therapy","Radiation therapy","Stem cell transplant","Surgery"],"data":{"added":["End of life care"],"deleted":[]}}}},"is_primary_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Yes","No","Unknown"],"right":["Yes","No"],"data":{"added":[],"deleted":["Unknown"]}}}},"line_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'unknown') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'unknown'.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if (($field != null && (!(checkforEmpty($field)))) && ($row.is_primary_treatment != null && !(checkforEmpty($row.is_primary_treatment)))) {\n const isPrimaryTreatment = $row.is_primary_treatment.trim().toLowerCase();\n /* if treatment is the primary treatment, then line_of_treatment should not be submitted. */\n if (isPrimaryTreatment === 'yes') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if this treatment is the primary treatment.`};\n }\n /* if treatment is not primary treatment, then line_of_treatment must be greater than 1 */\n else if (isPrimaryTreatment === 'no' && parseInt($field) <= 1) {\n result = { valid: false, message: `The '${$name}' field must be a value greater than 1`};\n }\n /* if it is unknown whether treatment was primary treatment, then line_of_treatment should not be submitted. If it is, then primary_treatment should be 'no' */\n else if (isPrimaryTreatment === 'not applicable') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'is_primary_treatment' is 'Not applicable'.`};\n }\n }\n return result;\n })"]}}},"treatment_start_interval":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"range":{"left":{"exclusiveMin":0},"right":null}}},"treatment_duration":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"days_per_cycle":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"number_of_cycles":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"treatment_intent":{"description":{"left":"Indicate the intended disease outcome for which the treatment is given. (Reference: NCIt C124307)","right":"Indicate the purpose of the treatment, or the desired effect or outcome resulting from the treatment. (Reference: mCODE/FHIR)"},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Curative","Palliative","Unknown"],"right":["Curative","Diagnostic","Forensic","Guidance","Palliative","Preventative","Screening","Supportive"],"data":{"added":["Diagnostic","Forensic","Guidance","Preventative","Screening","Supportive"],"deleted":["Unknown"]}}}},"treatment_setting":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]},"codeList":{"left":["Adjuvant","Advanced/Metastatic","Neoadjuvant","Not applicable"],"right":["Adjuvant","Advanced/Metastatic","Conditioning","Induction","Maintenance","Mobilization","Neoadjuvant","Preventative","Radiosensitization","Salvage"],"data":{"added":["Conditioning","Induction","Maintenance","Mobilization","Preventative","Radiosensitization","Salvage"],"deleted":["Not applicable"]}}}},"response_to_treatment":{"description":{"left":"The donor's response to the applied treatment regimen. (Source: RECIST)","right":"The donor's response to the applied treatment regimen."},"meta":{"dependsOn":{"left":"treatment.treatment_type","right":"treatment.response_to_treatment_criteria_method"},"notes":{"left":null,"right":"This field depends on the selected response_to_treatment_criteria_method. Please refer to the documentation for Response to Treatment Criteria: http://docs.icgc-argo.org/docs/submission/dictionary-overview#response-to-treatment-criteria"}},"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n\n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n let codeList = [];\n \n switch ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method.trim().toLowerCase()) {\n case 'eln dohner aml 2017 oncology response criteria':\n codeList = [\n 'complete remission',\n 'complete remission with incomplete hematologic recovery (cri)',\n 'complete remission without minimal residual disease (crmrd-)',\n 'hematologic relapse (after crmrd-, cr, cri)',\n 'molecular relapse (after crmrd-)',\n 'partial remission',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'iwg cheson aml 2003 oncology response criteria':\n codeList = [\n 'cytogenetic complete remission (crc)',\n 'molecular complete remission (crm)',\n 'morphologic complete remission',\n 'morphologic complete remission with incomplete blood count recovery (cri)',\n 'morphologic leukemia-free state',\n 'partial remission'\n ];\n break;\n case 'irecist':\n codeList = [\n 'immune complete response (icr)',\n 'immune confirmed progressive disease (icpd)',\n 'immune partial response (ipr)',\n 'immune stable disease (isd)',\n 'immune unconfirmed progressive disease (iupd)'\n ];\n break;\n case 'recist':\n codeList = [\n 'complete response',\n 'no evidence of disease (ned)',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'response assessment in neuro-oncology (rano)':\n codeList = [\n 'complete response',\n 'minor response',\n 'partial response',\n 'progressive disease',\n 'stable disease'\n ];\n break;\n case 'physician assessed response criteria':\n codeList = [\n 'physician assessed complete response',\n 'physician assessed partial response',\n 'physician assessed progressive disease',\n 'physician assessed stable disease'\n ];\n break;\n default:\n codelist = [];\n }\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When 'response_to_treatment_criteria_method' is set to '${\n $row.response_to_treatment_criteria_method}', the '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n else {\n if ($row.response_to_treatment_criteria_method && $row.response_to_treatment_criteria_method != null && !(checkforEmpty($row.response_to_treatment_criteria_method))) {\n result = { valid: false, message: `The '${$name}' field must be submitted when 'response_to_treatment_criteria_method' is set to '${$row.response_to_treatment_criteria_method}'. The '${$name}' field must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`};\n }\n }\n return result;\n })"]},"codeList":{"left":["Complete response","Disease progression","NED","Partial response","Stable disease"],"right":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Complete response","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Partial response","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease","Stable disease"],"data":{"added":["Complete remission","Complete remission with incomplete hematologic recovery (CRi)","Complete remission without minimal residual disease (CRMRD-)","Cytogenetic complete remission (CRc)","Hematologic relapse (after CRMRD-, CR, CRi)","Immune complete response (iCR)","Immune confirmed progressive disease (iCPD)","Immune partial response (iPR)","Immune stable disease (iSD)","Immune unconfirmed progressive disease (iUPD)","Minor response","Molecular complete remission (CRm)","Molecular relapse (after CRMRD-)","Morphologic complete remission","Morphologic complete remission with incomplete blood count recovery (CRi)","Morphologic leukemia-free state","No evidence of disease (NED)","Partial remission","Physician assessed complete response","Physician assessed partial response","Physician assessed progressive disease","Physician assessed stable disease","Progressive disease"],"deleted":["Disease progression","NED"]}}}},"outcome_of_treatment":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"toxicity_type":{"restrictions":{"codeList":{"left":["Hematological","Non-hematological"],"right":["Hematological","Non-hematological","Not applicable","Unknown"],"data":{"added":["Not applicable","Unknown"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n \n /* toxicityType should only be submitted if treatment was terminated early due to acute toxicity ('outcome_of_treatment' is 'Treatment stopped due to acute toxicity'). */\n if (outcomeOfTreatment != \"treatment stopped due to acute toxicity\") {\n result = { valid: false, message: `The 'outcome_of_treatment' field should be 'Treatment stopped due to acute toxicity' if the '${$name}' field is submitted.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const NAapplicable = ['treatment completed as prescribed', 'treatment incomplete due to technical or organizational problem', ' treatment incomplete because patient died', 'patient choice (stopped or interrupted treatment)', 'physician decision (stopped or interrupted treatment)', 'treatment stopped due to lack of efficacy (disease progression)', 'other', 'not applicable'];\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n const toxicityType = $field.trim().toLowerCase();\n if (($row.outcome_of_treatment != null && !(checkforEmpty($row.outcome_of_treatment)))) { \n const outcomeOfTreatment = $row.outcome_of_treatment.trim().toLowerCase();\n if (outcomeOfTreatment === 'not applicable' && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Not applicable' if the 'outcome_of_treatment' field is 'Not applicable', or if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'unknown' && toxicityType != 'unknown') {\n result = {valid: false, message: `The '${$name}' field can only be submitted as 'Unknown' if the 'outcome_of_treatment' field is 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (NAapplicable.includes(outcomeOfTreatment) && toxicityType != 'not applicable') {\n result = {valid: false, message: `The '${$name}' field must be submitted as 'Not applicable' if treatment was terminated for any other reason other than 'Treatment stopped due to acute toxicity'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n else if (outcomeOfTreatment === 'treatment stopped due to acute toxicity' && toxicityType === 'not applicable') {\n result = {valid: false, message: `If the 'outcome_of_treatment' field is 'Treatment stopped due to acute toxicity', then the '${$name}' field cannot be 'Not applicable'. Indicate toxicity type(s) or if toxicity_type is not known, then submit 'Unknown'. Confirm and correct the 'outcome_of_treatment' and 'toxicity_type' fields.`};\n }\n }\n else {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted, then the 'outcome_of_treatment' field must be submitted as well.`}\n }\n }\n return result;\n })"]}}},"hematological_toxicity":{"restrictions":{"codeList":{"left":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5"],"right":["Anemia - Grade 3","Anemia - Grade 4","Anemia - Grade 5","Neutropenia - Grade 3","Neutropenia - Grade 4","Neutropenia - Grade 5","Thrombocytopenia - Grade 3","Thrombocytopenia - Grade 4","Thrombocytopenia - Grade 5","Unknown"],"data":{"added":["Unknown"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n if (($row.toxicity_type != null && !(checkforEmpty($row.toxicity_type)))) { \n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n \n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}},"non-hematological_toxicity":{"restrictions":{"codeList":{"left":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"right":["Cardiac disorders - Grade 1","Cardiac disorders - Grade 2","Cardiac disorders - Grade 3","Cardiac disorders - Grade 4","Cardiac disorders - Grade 5","Dehydration - Grade 1","Dehydration - Grade 2","Dehydration - Grade 3","Dehydration - Grade 4","Dehydration - Grade 5","Diarrhea - Grade 1","Diarrhea - Grade 2","Diarrhea - Grade 3","Diarrhea - Grade 4","Diarrhea - Grade 5","Fatigue - Grade 1","Fatigue - Grade 2","Fatigue - Grade 3","Nausea - Grade 1","Nausea - Grade 2","Nausea - Grade 3","Unknown","Vomiting - Grade 1","Vomiting - Grade 2","Vomiting - Grade 3","Vomiting - Grade 4","Vomiting - Grade 5","Weight loss - Grade 1","Weight loss - Grade 2","Weight loss - Grade 3"],"data":{"added":["Unknown"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field != null && !(checkforEmpty($field))) {\n if (($row.toxicity_type != null && !(checkforEmpty($row.toxicity_type)))) { \n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n \n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n if ($row.toxicity_type && $row.toxicity_type != null && !(checkforEmpty($row.toxicity_type))) {\n const toxicityType = $row.toxicity_type.trim().toLowerCase();\n /* if toxicity_type is non-hematological, then hematological_toxicity should not be submitted. If toxicity_type is hematological, then 'non-hematological_toxicity' should not be submitted */\n if (toxicityType === 'non-hematological' && $name === 'hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if (toxicityType === 'hematological' && $name === 'non-hematological_toxicity') {\n result = { valid: false, message: `The '${$name}' field should not be submitted if 'toxicity_type' is '${toxicityType}'. Confirm and correct the 'toxicity_type' field and submit appropriate toxicity type(s).`};\n }\n else if ((toxicityType === 'unknown' || toxicityType === 'not applicable') && (!$field || $field != 'unknown')) {\n result = {valid: false, message: `If the 'toxicity_type' field is submitted as '${toxicityType}', then the '${$name}' field cannot be submitted as '${$field}'. Confirm and correct the 'toxicity_type' and '${$name}' fields.`};\n }\n }\n else {\n result = {valid: false, message: `The 'toxicity_type' field should be submitted if '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}}},"adverse_events":{"restrictions":{"codeList":{"left":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"right":["Abdominal distension","Abdominal infection","Abdominal pain","Abdominal soft tissue necrosis","Abducens nerve disorder","Accessory nerve disorder","Acidosis","Acoustic nerve disorder NOS","Activated partial thromboplastin time prolonged","Acute kidney injury","Adrenal insufficiency","Adult respiratory distress syndrome","Agitation","Akathisia","Alanine aminotransferase increased","Alcohol intolerance","Alkaline phosphatase increased","Alkalosis","Allergic reaction","Allergic rhinitis","Alopecia","Amenorrhea","Amnesia","Anal fissure","Anal fistula","Anal hemorrhage","Anal mucositis","Anal necrosis","Anal pain","Anal stenosis","Anal ulcer","Anaphylaxis","Anemia","Ankle fracture","Anorectal infection","Anorexia","Anorgasmia","Anosmia","Anxiety","Aortic injury","Aortic valve disease","Aphonia","Apnea","Appendicitis","Appendicitis perforated","Arachnoiditis","Arterial injury","Arterial thromboembolism","Arteritis infective","Arthralgia","Arthritis","Ascites","Aspartate aminotransferase increased","Aspiration","Asystole","Ataxia","Atelectasis","Atrial fibrillation","Atrial flutter","Atrioventricular block complete","Atrioventricular block first degree","Autoimmune disorder","Avascular necrosis","Azoospermia","Back pain","Bacteremia","Belching","Bile duct stenosis","Biliary anastomotic leak","Biliary fistula","Biliary tract infection","Bladder anastomotic leak","Bladder infection","Bladder perforation","Bladder spasm","Bloating","Blood and lymphatic system disorders - Other, specify","Blood antidiuretic hormone abnormal","Blood bicarbonate decreased","Blood bilirubin increased","Blood corticotrophin decreased","Blood gonadotrophin abnormal","Blood lactate dehydrogenase increased","Blood prolactin abnormal","Blurred vision","Body odor","Bone infection","Bone marrow hypocellular","Bone pain","Brachial plexopathy","Breast atrophy","Breast infection","Breast pain","Bronchial fistula","Bronchial infection","Bronchial obstruction","Bronchial stricture","Bronchopleural fistula","Bronchopulmonary hemorrhage","Bronchospasm","Bruising","Budd-Chiari syndrome","Bullous dermatitis","Burn","Buttock pain","Capillary leak syndrome","Carbon monoxide diffusing capacity decreased","Cardiac arrest","Cardiac disorders - Other, specify","Cardiac troponin I increased","Cardiac troponin T increased","Cataract","Catheter related infection","CD4 lymphocytes decreased","Cecal hemorrhage","Cecal infection","Central nervous system necrosis","Cerebrospinal fluid leakage","Cervicitis infection","Cheilitis","Chest pain - cardiac","Chest wall necrosis","Chest wall pain","Chills","Cholecystitis","Cholesterol high","Chronic kidney disease","Chylothorax","Chylous ascites","Cognitive disturbance","Colitis","Colonic fistula","Colonic hemorrhage","Colonic obstruction","Colonic perforation","Colonic stenosis","Colonic ulcer","Concentration impairment","Conduction disorder","Confusion","Congenital, familial and genetic disorders - Other, specify","Conjunctivitis","Conjunctivitis infective","Constipation","Corneal infection","Corneal ulcer","Cough","CPK increased","Cranial nerve infection","Creatinine increased","Cushingoid","Cyanosis","Cystitis noninfective","Cytokine release syndrome","Cytomegalovirus infection reactivation","Death neonatal","Death NOS","Dehydration","Delayed orgasm","Delayed puberty","Delirium","Delusions","Dental caries","Depressed level of consciousness","Depression","Dermatitis radiation","Device related infection","Diarrhea","Disease progression","Disseminated intravascular coagulation","Dizziness","Dry eye","Dry mouth","Dry skin","Duodenal fistula","Duodenal hemorrhage","Duodenal infection","Duodenal obstruction","Duodenal perforation","Duodenal stenosis","Duodenal ulcer","Dysarthria","Dysesthesia","Dysgeusia","Dysmenorrhea","Dyspareunia","Dyspepsia","Dysphagia","Dysphasia","Dyspnea","Dysuria","Ear and labyrinth disorders - Other, specify","Ear pain","Eczema","Edema cerebral","Edema face","Edema limbs","Edema trunk","Ejaculation disorder","Ejection fraction decreased","Electrocardiogram QT corrected interval prolonged","Electrocardiogram T wave abnormal","Encephalitis infection","Encephalomyelitis infection","Encephalopathy","Endocarditis infective","Endocrine disorders - Other, specify","Endophthalmitis","Enterocolitis","Enterocolitis infectious","Enterovesical fistula","Eosinophilia","Epistaxis","Epstein-Barr virus infection reactivation","Erectile dysfunction","Erythema multiforme","Erythroderma","Esophageal anastomotic leak","Esophageal fistula","Esophageal hemorrhage","Esophageal infection","Esophageal necrosis","Esophageal obstruction","Esophageal pain","Esophageal perforation","Esophageal stenosis","Esophageal ulcer","Esophageal varices hemorrhage","Esophagitis","Euphoria","Exostosis","External ear pain","Extraocular muscle paresis","Extrapyramidal disorder","Eye disorders - Other, specify","Eye infection","Eye pain","Eyelid function disorder","Facial muscle weakness","Facial nerve disorder","Facial pain","Fall","Fallopian tube anastomotic leak","Fallopian tube obstruction","Fallopian tube perforation","Fat atrophy","Fatigue","Febrile neutropenia","Fecal incontinence","Feminization acquired","Fetal growth retardation","Fever","Fibrinogen decreased","Fibrosis deep connective tissue","Flank pain","Flashing lights","Flatulence","Floaters","Flu like symptoms","Flushing","Folliculitis","Forced expiratory volume decreased","Fracture","Fungemia","Gait disturbance","Gallbladder fistula","Gallbladder infection","Gallbladder necrosis","Gallbladder obstruction","Gallbladder pain","Gallbladder perforation","Gastric anastomotic leak","Gastric fistula","Gastric hemorrhage","Gastric necrosis","Gastric perforation","Gastric stenosis","Gastric ulcer","Gastritis","Gastroesophageal reflux disease","Gastrointestinal anastomotic leak","Gastrointestinal disorders - Other, specify","Gastrointestinal fistula","Gastrointestinal pain","Gastrointestinal stoma necrosis","Gastroparesis","General disorders and administration site conditions - Other, specify","Generalized edema","Generalized muscle weakness","Genital edema","GGT increased","Gingival pain","Glaucoma","Glossopharyngeal nerve disorder","Glucose intolerance","Glucosuria","Growth accelerated","Growth hormone abnormal","Growth suppression","Guillain-Barre syndrome","Gum infection","Gynecomastia","Hair color changes","Hair texture abnormal","Hallucinations","Haptoglobin decreased","Head soft tissue necrosis","Headache","Hearing impaired","Heart failure","Hematoma","Hematosalpinx","Hematuria","Hemoglobin increased","Hemoglobinuria","Hemolysis","Hemolytic uremic syndrome","Hemorrhoidal hemorrhage","Hemorrhoids","Hepatic failure","Hepatic hemorrhage","Hepatic infection","Hepatic necrosis","Hepatic pain","Hepatitis B reactivation","Hepatitis viral","Hepatobiliary disorders - Other, specify","Herpes simplex reactivation","Hiccups","Hip fracture","Hirsutism","Hoarseness","Hot flashes","Hydrocephalus","Hypercalcemia","Hyperglycemia","Hyperhidrosis","Hyperkalemia","Hyperkeratosis","Hyperlipidemia","Hypermagnesemia","Hypernatremia","Hyperparathyroidism","Hyperphosphatemia","Hypersomnia","Hypertension","Hyperthyroidism","Hypertrichosis","Hypertriglyceridemia","Hyperuricemia","Hypoalbuminemia","Hypocalcemia","Hypoglossal nerve disorder","Hypoglycemia","Hypohidrosis","Hypokalemia","Hypomagnesemia","Hyponatremia","Hypoparathyroidism","Hypophosphatemia","Hypophysitis","Hypopituitarism","Hypotension","Hypothermia","Hypothyroidism","Hypoxia","Ileal fistula","Ileal hemorrhage","Ileal obstruction","Ileal perforation","Ileal stenosis","Ileal ulcer","Ileus","Immune system disorders - Other, specify","Infections and infestations - Other, specify","Infective myositis","Infusion related reaction","Infusion site extravasation","Injection site reaction","Injury to carotid artery","Injury to inferior vena cava","Injury to jugular vein","Injury to superior vena cava","Injury, poisoning and procedural complications - Other, specify","INR increased","Insomnia","Intestinal stoma leak","Intestinal stoma obstruction","Intestinal stoma site bleeding","Intra-abdominal hemorrhage","Intracranial hemorrhage","Intraoperative arterial injury","Intraoperative breast injury","Intraoperative cardiac injury","Intraoperative ear injury","Intraoperative endocrine injury","Intraoperative gastrointestinal injury","Intraoperative head and neck injury","Intraoperative hemorrhage","Intraoperative hepatobiliary injury","Intraoperative musculoskeletal injury","Intraoperative neurological injury","Intraoperative ocular injury","Intraoperative renal injury","Intraoperative reproductive tract injury","Intraoperative respiratory injury","Intraoperative splenic injury","Intraoperative urinary injury","Intraoperative venous injury","Investigations - Other, specify","Iron overload","Irregular menstruation","Irritability","Ischemia cerebrovascular","Jejunal fistula","Jejunal hemorrhage","Jejunal obstruction","Jejunal perforation","Jejunal stenosis","Jejunal ulcer","Joint effusion","Joint infection","Joint range of motion decreased","Joint range of motion decreased cervical spine","Joint range of motion decreased lumbar spine","Keratitis","Kidney anastomotic leak","Kidney infection","Kyphosis","Lactation disorder","Large intestinal anastomotic leak","Laryngeal edema","Laryngeal fistula","Laryngeal hemorrhage","Laryngeal inflammation","Laryngeal mucositis","Laryngeal obstruction","Laryngeal stenosis","Laryngitis","Laryngopharyngeal dysesthesia","Laryngospasm","Left ventricular systolic dysfunction","Lethargy","Leukemia secondary to oncology chemotherapy","Leukocytosis","Leukoencephalopathy","Libido decreased","Libido increased","Lip infection","Lip pain","Lipase increased","Lipohypertrophy","Localized edema","Lordosis","Lower gastrointestinal hemorrhage","Lung infection","Lymph gland infection","Lymph leakage","Lymph node pain","Lymphedema","Lymphocele","Lymphocyte count decreased","Lymphocyte count increased","Malabsorption","Malaise","Mania","Mediastinal hemorrhage","Mediastinal infection","Memory impairment","Meningismus","Meningitis","Menorrhagia","Metabolism and nutrition disorders - Other, specify","Methemoglobinemia","Middle ear inflammation","Mitral valve disease","Mobitz (type) II atrioventricular block","Mobitz type I","Movements involuntary","Mucosal infection","Mucositis oral","Multi-organ failure","Muscle cramp","Muscle weakness left-sided","Muscle weakness lower limb","Muscle weakness right-sided","Muscle weakness trunk","Muscle weakness upper limb","Musculoskeletal and connective tissue disorder - Other, specify","Musculoskeletal deformity","Myalgia","Myasthenia gravis","Myelitis","Myelodysplastic syndrome","Myocardial infarction","Myocarditis","Myositis","Nail changes","Nail discoloration","Nail infection","Nail loss","Nail ridging","Nasal congestion","Nausea","Neck edema","Neck pain","Neck soft tissue necrosis","Neoplasms benign, malignant and unspecified (incl cysts and polyps) - Other, specify","Nephrotic syndrome","Nervous system disorders - Other, specify","Neuralgia","Neutrophil count decreased","Night blindness","Nipple deformity","Non-cardiac chest pain","None","Nystagmus","Obesity","Obstruction gastric","Oculomotor nerve disorder","Olfactory nerve disorder","Oligospermia","Optic nerve disorder","Oral cavity fistula","Oral dysesthesia","Oral hemorrhage","Oral pain","Oropharyngeal pain","Osteonecrosis","Osteonecrosis of jaw","Osteoporosis","Otitis externa","Otitis media","Ovarian hemorrhage","Ovarian infection","Ovarian rupture","Ovulation pain","Pain","Pain in extremity","Pain of skin","Palmar-plantar erythrodysesthesia syndrome","Palpitations","Pancreas infection","Pancreatic anastomotic leak","Pancreatic duct stenosis","Pancreatic enzymes decreased","Pancreatic fistula","Pancreatic hemorrhage","Pancreatic necrosis","Pancreatitis","Papilledema","Papulopustular rash","Paresthesia","Paronychia","Paroxysmal atrial tachycardia","Pelvic floor muscle weakness","Pelvic infection","Pelvic pain","Pelvic soft tissue necrosis","Penile infection","Penile pain","Perforation bile duct","Pericardial effusion","Pericardial tamponade","Pericarditis","Perineal pain","Periodontal disease","Periorbital edema","Periorbital infection","Peripheral ischemia","Peripheral motor neuropathy","Peripheral nerve infection","Peripheral sensory neuropathy","Peritoneal infection","Peritoneal necrosis","Personality change","Phantom pain","Pharyngeal anastomotic leak","Pharyngeal fistula","Pharyngeal hemorrhage","Pharyngeal mucositis","Pharyngeal necrosis","Pharyngeal stenosis","Pharyngitis","Pharyngolaryngeal pain","Phlebitis","Phlebitis infective","Photophobia","Photosensitivity","Platelet count decreased","Pleural effusion","Pleural hemorrhage","Pleural infection","Pleuritic pain","Pneumonitis","Pneumothorax","Portal hypertension","Portal vein thrombosis","Postnasal drip","Postoperative hemorrhage","Postoperative thoracic procedure complication","Precocious puberty","Pregnancy loss","Pregnancy, puerperium and perinatal conditions - Other, specify","Premature delivery","Premature menopause","Presyncope","Proctitis","Productive cough","Prolapse of intestinal stoma","Prolapse of urostomy","Prostate infection","Prostatic hemorrhage","Prostatic obstruction","Prostatic pain","Proteinuria","Pruritus","Psychiatric disorders - Other, specify","Psychosis","Pulmonary edema","Pulmonary fibrosis","Pulmonary fistula","Pulmonary hypertension","Pulmonary valve disease","Purpura","Pyramidal tract syndrome","Radiation recall reaction (dermatologic)","Radiculitis","Rash acneiform","Rash maculo-papular","Rash pustular","Rectal anastomotic leak","Rectal fissure","Rectal fistula","Rectal hemorrhage","Rectal mucositis","Rectal necrosis","Rectal obstruction","Rectal pain","Rectal perforation","Rectal stenosis","Rectal ulcer","Recurrent laryngeal nerve palsy","Renal and urinary disorders - Other, specify","Renal calculi","Renal colic","Renal hemorrhage","Reproductive system and breast disorders - Other, specify","Respiratory failure","Respiratory, thoracic and mediastinal disorders - Other, specify","Restlessness","Restrictive cardiomyopathy","Retinal detachment","Retinal tear","Retinal vascular disorder","Retinoic acid syndrome","Retinopathy","Retroperitoneal hemorrhage","Reversible posterior leukoencephalopathy syndrome","Rhabdomyolysis","Rhinitis infective","Rhinorrhea","Right ventricular dysfunction","Rotator cuff injury","Salivary duct inflammation","Salivary gland fistula","Salivary gland infection","Scalp pain","Scleral disorder","Scoliosis","Scrotal infection","Scrotal pain","Seizure","Sepsis","Seroma","Serum amylase increased","Serum sickness","Shingles","Sick sinus syndrome","Sinus bradycardia","Sinus disorder","Sinus pain","Sinus tachycardia","Sinusitis","Sinusoidal obstruction syndrome","Skin and subcutaneous tissue disorders - Other, specify","Skin atrophy","Skin hyperpigmentation","Skin hypopigmentation","Skin induration","Skin infection","Skin papilloma","Skin ulceration","Sleep apnea","Small intestinal anastomotic leak","Small intestinal mucositis","Small intestinal obstruction","Small intestinal perforation","Small intestinal stenosis","Small intestine infection","Small intestine ulcer","Sneezing","Social circumstances - Other, specify","Soft tissue infection","Soft tissue necrosis lower limb","Soft tissue necrosis upper limb","Somnolence","Sore throat","Spasticity","Spermatic cord anastomotic leak","Spermatic cord hemorrhage","Spermatic cord obstruction","Spinal cord compression","Spinal fracture","Splenic infection","Stenosis of gastrointestinal stoma","Stevens-Johnson syndrome","Stoma site infection","Stomach pain","Stomal ulcer","Stridor","Stroke","Subcutaneous emphysema","Sudden death NOS","Suicidal ideation","Suicide attempt","Superficial soft tissue fibrosis","Superficial thrombophlebitis","Superior vena cava syndrome","Supraventricular tachycardia","Surgical and medical procedures - Other, specify","Syncope","Telangiectasia","Tendon reflex decreased","Testicular disorder","Testicular hemorrhage","Testicular pain","Testosterone deficiency","Thromboembolic event","Thrombotic thrombocytopenic purpura","Thrush","Thyroid stimulating hormone increased","Tinnitus","Tooth development disorder","Tooth discoloration","Tooth infection","Toothache","Toxic epidermal necrolysis","Tracheal fistula","Tracheal hemorrhage","Tracheal mucositis","Tracheal obstruction","Tracheal stenosis","Tracheitis","Tracheostomy site bleeding","Transient ischemic attacks","Treatment related secondary malignancy","Tremor","Tricuspid valve disease","Trigeminal nerve disorder","Trismus","Trochlear nerve disorder","Tumor hemorrhage","Tumor lysis syndrome","Tumor pain","Typhlitis","Unequal limb length","Unknown","Upper gastrointestinal hemorrhage","Upper respiratory infection","Ureteric anastomotic leak","Urethral anastomotic leak","Urethral infection","Urinary fistula","Urinary frequency","Urinary incontinence","Urinary retention","Urinary tract infection","Urinary tract obstruction","Urinary tract pain","Urinary urgency","Urine discoloration","Urine output decreased","Urostomy leak","Urostomy obstruction","Urostomy site bleeding","Urostomy stenosis","Urticaria","Uterine anastomotic leak","Uterine fistula","Uterine hemorrhage","Uterine infection","Uterine obstruction","Uterine pain","Uterine perforation","Uveitis","Vaccination complication","Vaccination site lymphadenopathy","Vaginal anastomotic leak","Vaginal discharge","Vaginal dryness","Vaginal fistula","Vaginal hemorrhage","Vaginal infection","Vaginal inflammation","Vaginal obstruction","Vaginal pain","Vaginal perforation","Vaginal stricture","Vagus nerve disorder","Vas deferens anastomotic leak","Vascular access complication","Vascular disorders - Other, specify","Vasculitis","Vasovagal reaction","Venous injury","Ventricular arrhythmia","Ventricular fibrillation","Ventricular tachycardia","Vertigo","Vestibular disorder","Viremia","Virilization","Visceral arterial ischemia","Vision decreased","Vital capacity abnormal","Vitreous hemorrhage","Voice alteration","Vomiting","Vulval infection","Watering eyes","Weight gain","Weight loss","Wheezing","White blood cell decreased","Wound complication","Wound dehiscence","Wound infection","Wrist fracture"],"data":{"added":["None","Unknown"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const coreFields = ['is_primary_treatment', 'treatment_start_interval', 'treatment_duration', 'treatment_intent', 'treatment_setting', 'response_to_treatment'];\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.treatment_type != null) {\n const treatmentType = $row.treatment_type;\n if (!(treatmentType.includes(\"No treatment\"))) {\n if (coreFields.includes($name)) {\n if (!$field || checkforEmpty($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field must be submitted when 'treatment_type' is '${treatmentType}'`,\n };\n }\n }\n }\n else if (treatmentType.includes(\"No treatment\") && ($field)) {\n result = {\n valid: false,\n message: `The '${$name}' field should not be submitted if 'treatment_type' is set to '${treatmentType}'`,\n };\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"]}}},"clinical_trials_database":{"meta":{"notes":{"left":null,"right":"If the clinical trials database you use is not included in the controlled terminology, please contact us at https://platform.icgc-argo.org/contact to request it be added."}},"restrictions":{"codeList":{"left":["NCI Clinical Trials","EU Clinical Trials Register"],"right":["NCI Clinical Trials","EU Clinical Trials Register","Not applicable","Unknown"],"data":{"added":["Not applicable","Unknown"],"deleted":[]}}}},"clinical_trial_number":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n //regex check for clinical trial number\n const NCTCheck = (entry) => {return /(^([Nn][Cc][Tt])[0-9]{8})/.test(decodeURI(entry))};\n const EudraCTCheck = (entry) => {return /(^[2][0-9]{3}-[0-9]{6}-[0-9]{2})/.test(decodeURI(entry))};\n\n // list of valid clinical trial databases\n const clinical_dbs = [\"nci clinical trials\", \"eu clinical trials register\"];\n \n if ($row.clinical_trials_database && $field) {\n const trialNumber = $field.trim();\n const clinicalTrialsDB = $row.clinical_trials_database.trim().toLowerCase();\n if ((clinicalTrialsDB === \"nci clinical trials\") && (!NCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted NCI clinical trial number is in incorrect format.`};\n }\n else if ((clinicalTrialsDB === \"eu clinical trials register\") && (!EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `The submitted EudraCT clinical trial number is in incorrect format.`};\n }\n else if (!clinical_dbs.includes(clinicalTrialsDB)) {\n result = {valid: false, message: `The submitted clinical trials database '${$row.clinical_trials_database}' is not included in the list of clinical trial database. To include a new clinical trials database in the controlled terminology for 'clinical_trials_database', please contact us at https://platform.icgc-argo.org/contact.`};\n }\n else if ((clinicalTrialsDB === 'unknown' || clinicalTrialsDB === 'not applicable') && (NCTCheck(trialNumber) || EudraCTCheck(trialNumber))) {\n result = {valid: false, message: `If a trial number is submitted in the '${$name}' field, then you must indicate the clinical trial database in the 'clinical_trials_database' field.`};\n }\n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && (!$field || checkforEmpty($field))) {\n result = {valid: true, message: \"Ok\"};\n }\n else if ($row.clinical_trials_database && !$field) {\n if (clinical_dbs.includes($row.clinical_trials_database.trim().toLowerCase())) {\n result = {valid: false, message: `'${$name}' must be provided if 'clinical_trial_database' is set to '${$row.clinical_trials_database}'.`};\n } \n }\n else if ((!$row.clinical_trials_database || checkforEmpty($row.clnical_trials_database)) && $field) {\n result = { valid: false, message: `The 'clinical_trial_database' field must be submitted if '${$name}' is submitted.`};\n }\n return result;\n })"]}}}},"created":{"response_to_treatment_criteria_method":{"changeType":"created","name":"response_to_treatment_criteria_method","description":"Indicate the criteria used to assess the donor's response to the applied treatment regimen.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const { $row, $name, $field } = inputs;\n const result = { valid: true, message: 'Ok' };\n\n const arrayItemsInSecondArray = (arr1, arr2) => {\n return arr2.some(arr2Item => {\n return arr1.includes(arr2Item);\n });\n };\n\n const coreFields = [\n 'treatment_start_interval',\n 'treatment_duration',\n 'is_primary_treatment',\n 'treatment_intent',\n 'treatment_setting',\n 'response_to_treatment_criteria_method',\n 'response_to_treatment',\n ];\n\n const treatmentExceptionTypes = ['no treatment', 'unknown'];\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n const treatmentTypes = $row.treatment_type.map(value => value.toLowerCase());\n\n const recordHasTreatments = !arrayItemsInSecondArray(\n treatmentExceptionTypes,\n treatmentTypes,\n );\n\n if (recordHasTreatments) {\n if (\n coreFields.includes($name) &&\n (!$field || $field === null || checkforEmpty($field))\n ) {\n return {\n valid: false,\n message: `The '${$name}' field must be submitted when the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n\n } else if ($field && $field != null && !checkforEmpty($field)) {\n if (\n coreFields.includes($name) ||\n (typeof $field === 'string' && $field.trim().toLowerCase() != 'not applicable') ||\n typeof $field === 'number'\n ) {\n return {\n valid: false,\n message: `The '${$name}' field cannot be submitted if the 'treatment_type' field is '${treatmentTypes}'`,\n };\n }\n }\n return result;\n })"],"codeList":["ELN Dohner AML 2017 Oncology Response Criteria","IWG Cheson AML 2003 Oncology Response Criteria","iRECIST","RECIST","Response Assessment in Neuro-Oncology (RANO)","Physician Assessed Response Criteria"]},"meta":{"core":true,"displayName":"Response To Treatment Criteria Method","validationDependency":true,"dependsOn":"treatment.treatment_type"}}},"deleted":{}},"chemotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"chemotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"chemotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"chemotherapy_drug_dose_units":{"changeType":"created","name":"chemotherapy_drug_dose_units","description":"Indicate units used to record chemotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Chemotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in chemotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n // Check for when chemotherapy dose has a clinical exception value of 'not applicable'\n if ($row.chemotherapy_drug_dose_units && $row.chemotherapy_drug_dose_units != null && !(checkforEmpty($row.chemotherapy_drug_dose_units)) && $row.chemotherapy_drug_dose_units.trim().toLowerCase() === 'not applicable') {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted when 'chemotherapy_drug_dose_units' = 'Not applicable'`\n };\n }\n }\n else {\n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","validationDependency":true,"dependsOn":"chemotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"dose_intensity_reduction":{"changeType":"created","name":"dose_intensity_reduction","description":"Indicate if there was a significant reduction in dose intensity.","valueType":"string","restrictions":{"codeList":["Yes","No","Unknown"]},"meta":{"displayName":"Dose Intensity Reduction"}},"dose_intensity_reduction_event":{"changeType":"created","name":"dose_intensity_reduction_event","description":"If there was a signficiant reduction in dose intensity, indicate which event caused it.","valueType":"string","restrictions":{"codeList":["Dose reduction","Dose delay or dose omission","Both"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Dose Intensity Reduction Event","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}},"dose_intensity_reduction_amount":{"changeType":"created","name":"dose_intensity_reduction_amount","description":"If there was a significant reduction in dose intensity, indicate the amount.","valueType":"string","restrictions":{"codeList":["<20%","20-49%",">=50%","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(entry.replace(/^\"(.*)\"$/, '$1'))};\n\n if ($field && $field != null && !(checkforEmpty($field))) {\n if (!$row.dose_intensity_reduction || checkforEmpty($row.dose_intensity_reduction) || $row.dose_intensity_reduction === null) {\n result = {\n valid: false,\n message: `The 'dose_intensity_reduction' field is required if the '${$name}' field is submitted.`,\n };\n }\n else if ($row.dose_intensity_reduction.trim().toLowerCase() === 'no') {\n result = {\n valid: false,\n message: `The '${$name}' field cannot be submitted if 'dose_intensity_reduction' field is 'No'.`,\n };\n } \n }\n else if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.dose_intensity_reduction && !(checkforEmpty($row.dose_intensity_reduction)) && $row.dose_intensity_reduction.trim().toLowerCase() === 'yes') {\n result = {\n valid: false,\n message: `The '${$name}' field is required if 'dose_intensity_reduction' field is 'Yes'.`\n };\n }\n }\n return result;\n })"]},"meta":{"displayName":"Amount of Dose Intensity Reduction","notes":"This field should only be submitted if 'dose_intensity_reduction' is 'Yes'"}}},"deleted":{"chemotherapy_dosage_units":{"changeType":"deleted","name":"chemotherapy_dosage_units","description":"Indicate units used to record chemotherapy drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Chemotherapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate the total actual drug dose in the same units specified in chemotherapy_dosage_units.","valueType":"number","restrictions":{"required":true,"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"hormone_therapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"validationDependency":{"left":null,"right":true},"dependsOn":{"left":null,"right":"hormone_therapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"hormone_therapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"hormone_drug_dose_units":{"changeType":"created","name":"hormone_drug_dose_units","description":"Indicate the units used to record hormone drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Hormone Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"hormone_therapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in hormone_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"hormone_therapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{"hormone_drug_dosage_units":{"changeType":"deleted","name":"hormone_drug_dosage_units","description":"Indicate the units used to record hormone drug dosage.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg"]},"meta":{"core":true,"displayName":"Hormone Therapy Dosage Units"}},"cumulative_drug_dosage":{"changeType":"deleted","name":"cumulative_drug_dosage","description":"Indicate total drug dose in units specified in hormone_drug_dosage_units.","valueType":"number","restrictions":{"required":true,"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Cumulative Drug Dosage"}}}},"radiation":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"radiation_therapy_dosage":{"valueType":{"left":"integer","right":"number"}},"anatomical_site_irradiated":{"description":{"left":"Indicate localization site where radiation therapy was administered.","right":"Indicate body region where radiation therapy was administered. (Reference: Cancer Care Ontario)"},"restrictions":{"codeList":{"left":["Abdomen","Bone","Brain","Extremities","Head","Head-Neck","Liver","Lung","Pelvis","Peritoneum","Spine","Thorax"],"right":["Abdomen","Body","Brain","Chest","Head","Liver","Lower Limb","Lung","Neck","Pelvis","Skin","Spine","Thorax","Upper Limb"],"data":{"added":["Body","Chest","Lower Limb","Neck","Skin","Upper Limb"],"deleted":["Bone","Extremities","Head-Neck","Peritoneum"]}}}}},"created":{"radiation_boost":{"changeType":"created","name":"radiation_boost","description":"A radiation boost is an extra radiation treatment targeted at the tumor bed, given after the regular sessions of radiation is complete (Reference NCIt: C137812). Indicate if this radiation treatment was a radiation boost.","valueType":"string","restrictions":{"codeList":["Yes","No","Not applicable"]},"meta":{"displayName":"Radiation Boost"}},"reference_radiation_treatment_id":{"changeType":"created","name":"reference_radiation_treatment_id","description":"If a radiation boost was given, indicate the 'submitter_treatment_id' of the primary radiation treatment the radiation boost treatment is linked to.","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const currField = typeof($field) === 'string' ? $field.trim().toLowerCase() : $field;\n \n if ($row.radiation_boost != null) {\n const radiationBoost = $row.radiation_boost.trim().toLowerCase();\n\n if (!currField && radiationBoost === \"yes\") {\n result = {valid: false, message: `${$name} must be provided when if a radiation boost was given.`}\n }\n else if (currField && radiationBoost != \"yes\"){\n result = {valid: false, message: `${$name} cannot be provided if the 'radiation_boost' field is '${radiationBoost}'.`}\n }\n }\n else if ((!$row.radiation_boost) && (currField)) {\n result = {valid: false, message: `'${$name}' requires the 'radiation_boost' field.` }\n }\n return result;\n })"]},"meta":{"displayName":"Reference Radiation Treatment for Boost"}}},"deleted":{}},"immunotherapy":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"immunotherapy_type":{"meta":{"core":{"left":null,"right":true}},"restrictions":{"required":{"left":null,"right":true}}},"drug_rxnormcui":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"dependsOn":{"left":null,"right":"immunotherapy.drug_database"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}},"drug_name":{"meta":{"notes":{"left":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin","right":"This field uses standardized vocabulary from the RxNorm database (https://www.nlm.nih.gov/research/umls/rxnorm), provided by the NIH.\n\nYou can search for RX Norm values through the web interface (https://mor.nlm.nih.gov/RxNav/) or API (https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html).\n\nFor example, to find the rxnormcui based on drug name, you can use: https://rxnav.nlm.nih.gov/REST/rxcui.json?name=leucovorin or https://mor.nlm.nih.gov/RxNav/search?searchBy=String&searchTerm=leucovorin. \n\nIf the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found."},"displayName":{"left":"Immunotherapy Drug Name","right":"Chemotherapy Drug Name"},"dependsOn":{"left":null,"right":"immunotherapy.drug_rxnormcui"}},"restrictions":{"required":{"left":true,"right":null},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}}}},"created":{"drug_database":{"changeType":"created","name":"drug_database","description":"Indicate the drug database where drug term is found.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Database"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"],"codeList":["KEGG","PubChem","NCI Thesaurus"]}},"drug_id":{"changeType":"created","name":"drug_id","description":"Indicate the identifier from the drug_database for the drug.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug ID"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"drug_term":{"changeType":"created","name":"drug_term","description":"Indicate the drug term as it exists in the database specified in the drug_database.","valueType":"string","meta":{"core":true,"validationDependency":true,"dependsOn":"immunotherapy.drug_rxnormcui","notes":"If the drugs don't exist in RxNorm, please indicate drug_database, drug_id and drug_term where the drugs information can be found.","displayName":"Drug Term"},"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // Extract related fields from the row\n const drug_rxnormcui = $row.drug_rxnormcui;\n const drug_name = $row.drug_name;\n const drug_database = $row.drug_database;\n const drug_id = $row.drug_id;\n const drug_term = $row.drug_term;\n \n // checks for empty fields\n const checkforEmpty = (entry) => {\n // Check if entry is null or undefined\n if (entry === null || entry === undefined) {\n return true;\n } \n // Logic to check if the entry is an empty string or contains only whitespace\n return /^\\s*$/.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n // Validate based on the field name\n switch ($name) {\n case 'drug_rxnormcui':\n // If drug_rxnormcui is provided\n if (!checkforEmpty($field)) {\n if (checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n if (!checkforEmpty(drug_database) || !checkforEmpty(drug_id) || !checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term should be blank when drug_rxnormcui is provided.`\n };\n }\n } else {\n // If drug_rxnormcui is not provided\n if (!checkforEmpty(drug_name)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n if (checkforEmpty(drug_database) || checkforEmpty(drug_id) || checkforEmpty(drug_term) ) {\n result = {\n valid: false,\n message: `drug_database, drug_id and drug_term must be populated when drug_rxnormcui is not provided.`\n };\n }\n }\n break;\n\n case 'drug_name':\n // If drug_rxnormcui is provided, drug_name must be populated\n if (!checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name is required when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, drug_name should be empty\n if (checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `drug_name should not be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n case 'drug_database':\n case 'drug_id': \n case 'drug_term':\n // If drug_rxnormcui is provided, these fields should be empty\n if (!checkforEmpty(drug_rxnormcui) && !checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' should be blank when drug_rxnormcui is provided.`\n };\n }\n // If drug_rxnormcui is not provided, these fields must be populated\n if (checkforEmpty(drug_rxnormcui) && checkforEmpty($field)) {\n result = {\n valid: false,\n message: `'${$name}' must be populated when drug_rxnormcui is not provided.`\n };\n }\n break;\n\n default:\n break;\n }\n\n return result;\n })"]}},"immunotherapy_drug_dose_units":{"changeType":"created","name":"immunotherapy_drug_dose_units","description":"Indicate units used to record immunotherapy drug dose.","valueType":"string","restrictions":{"required":true,"codeList":["mg/m2","IU/m2","ug/m2","g/m2","mg/kg","mg"]},"meta":{"core":true,"displayName":"Immunotherapy Drug Dose Units"}},"prescribed_cumulative_drug_dose":{"changeType":"created","name":"prescribed_cumulative_drug_dose","description":"Indicate the total prescribed cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Prescribed Cumulative Drug Dose","dependsOn":"immunotherapy.actual_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}},"actual_cumulative_drug_dose":{"changeType":"created","name":"actual_cumulative_drug_dose","description":"Indicate the total actual cumulative drug dose in the same units specified in immunotherapy_drug_dose_units.","valueType":"number","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let checkField = \"\";\n\n if ($name === 'actual_cumulative_drug_dose') { checkField = 'prescribed_cumulative_drug_dose'; }\n else if ($name === 'prescribed_cumulative_drug_dose') { checkField = 'actual_cumulative_drug_dose'; }\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ( (!$field || $field === null || checkforEmpty($field)) && (!($row[checkField]) || $row[checkField] === null || checkforEmpty(!($row[checkField])))) {\n result = {\n valid: false,\n message: `Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' fields must be submitted.`\n };\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"core":true,"displayName":"Actual Cumulative Drug Dose","dependsOn":"immunotherapy.prescribed_cumulative_drug_dose","notes":"Either the 'actual_cumulative_drug_dose' or the 'prescribed_cumulative_drug_dose' field must be submitted."}}},"deleted":{}},"follow_up":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_follow_up_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"interval_of_followup":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"submitter_primary_diagnosis_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"primary_diagnosis.submitter_primary_diagnosis_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"submitter_treatment_id":{"meta":{"validationDependency":{"left":null,"right":true},"foreignKey":{"left":null,"right":"treatment.submitter_treatment_id"}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"relapse_type":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"relapse_interval":{"restrictions":{"range":{"left":{"exclusiveMin":0},"right":null}}},"method_of_progression_status":{"restrictions":{"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_tumour_staging_system":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const arrayFormatter = arr => `\\n${arr.map(entry => `- \"${entry}\"`).join('\\n')}`;\n const listFormatter = arr => `${arr.map(entry => `\"${entry}\"`).join(', ')}`;\n\n \n /* Contingent on the naming system for tumour staging systems to remain consistent */\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_tumour_staging_system')[0];\n const requiredFields = [\n `${stagingName}_m_category`,\n `${stagingName}_n_category`,\n `${stagingName}_t_category`,\n ];\n const convertedRow = Object.fromEntries(\n Object.entries($row).map(([fieldName, fieldVal]) => [fieldName.toLowerCase(), fieldVal]),\n );\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n\n /* search for fields with falsy values*/\n const emptyFields = requiredFields.filter(\n field => !convertedRow[field] || checkforEmpty(convertedRow[field]),\n );\n\n /* The staging system should be set to an AJCC option if the TNM fields are submitted */\n if (!($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message:`The ${stagingName}_tumour_staging_system field must be set to an AJCC option when the following fields are submitted: ${listFormatter(\n errorFields,\n )}`,\n };\n }\n /* This is not a required field, so first ensure that it exists */\n else if ($field) {\n /* The fields should be provided IF and ONLY IF the AJCC regex passes */\n if (/^(AJCC)\\b/i.test($field) && emptyFields.length) {\n result = {\n valid: false,\n message: `The following fields are required when ${$name} is set to an AJCC option: ${arrayFormatter(\n emptyFields,\n )}`,\n };\n } else if (!/^(AJCC)\\b/i.test($field) && emptyFields.length != requiredFields.length) {\n const errorFields = requiredFields.filter(fieldName => !emptyFields.includes(fieldName));\n result = {\n valid: false,\n message: `The following fields cannot be provided when ${$name} is not set to an AJCC option: ${arrayFormatter(\n errorFields,\n )}`,\n };\n }\n }\n return result;\n })","(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"]}}},"recurrence_t_category":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"recurrence_n_category":{"meta":{"core":{"left":true,"right":null}}},"recurrence_m_category":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"recurrence_stage_group":{"meta":{"core":{"left":true,"right":null}},"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Cannot be assessed"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n \n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}},"posttherapy_tumour_staging_system":{"restrictions":{"codeList":{"left":["AJCC 8th edition","AJCC 7th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (RISS)","St Jude staging system"],"right":["AJCC 8th edition","AJCC 7th edition","AJCC 6th edition","Ann Arbor staging system","Binet staging system","Durie-Salmon staging system","FIGO staging system","Lugano staging system","Rai staging system","Revised International staging system (R-ISS)","St Jude staging system"],"data":{"added":["AJCC 6th edition","Revised International staging system (R-ISS)"],"deleted":["Revised International staging system (RISS)"]}}}},"posttherapy_t_category":{"restrictions":{"codeList":{"left":["T0","T1","T1a","T1a1","T1a2","T1b","T1b1","T1b2","T1c","T1d","T1mi","T2","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4b","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"right":["T0","T1","T1a","T1a1","T1a2","T1a(s)","T1a(m)","T1b","T1b1","T1b2","T1b(s)","T1b(m)","T1c","T1d","T1mi","T2","T2(s)","T2(m)","T2a","T2a1","T2a2","T2b","T2c","T2d","T3","T3(s)","T3(m)","T3a","T3b","T3c","T3d","T3e","T4","T4a","T4a(s)","T4a(m)","T4b","T4b(s)","T4b(m)","T4c","T4d","T4e","Ta","Tis","Tis(DCIS)","Tis(LAMN)","Tis(LCIS)","Tis(Paget)","Tis(Paget’s)","Tis pd","Tis pu","TX"],"data":{"added":["T1a(s)","T1a(m)","T1b(s)","T1b(m)","T2(s)","T2(m)","T3(s)","T3(m)","T4a(s)","T4a(m)","T4b(s)","T4b(m)"],"deleted":[]}}}},"posttherapy_m_category":{"restrictions":{"codeList":{"left":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e"],"right":["M0","M0(i+)","M1","M1a","M1a(0)","M1a(1)","M1b","M1b(0)","M1b(1)","M1c","M1c(0)","M1c(1)","M1d","M1d(0)","M1d(1)","M1e","MX","Not applicable"],"data":{"added":["MX","Not applicable"],"deleted":[]}},"script":{"left":null,"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingSystems = ['ajcc 7th edition', 'ajcc 8th edition'];\n const stagingName = $name.trim().toLowerCase().split('_m_category')[0];\n const tumourStagingSystem = `${stagingName}_tumour_staging_system`;\n\n /* Check for contigous spaces wrapped with quotes (empty strings) */\n const checkforEmpty = entry => {\n return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'));\n };\n \n \n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if (stagingSystems.includes($row[tumourStagingSystem].trim().toLowerCase())) {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'mx') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n if ($row[tumourStagingSystem] && $row[tumourStagingSystem] != null && !(checkforEmpty($row[tumourStagingSystem]))) {\n if ($row[tumourStagingSystem].trim().toLowerCase() == \"ajcc 6th edition\") {\n if ($field && $field != null && !(checkforEmpty($field)) && $field.trim().toLowerCase() === 'not applicable') {\n result = {\n valid: false,\n message: `The designation of '${$field}' in the '${$name}' field is not a valid M category in the ${tumourStagingSystem} '${$row[tumourStagingSystem]}'.`\n };\n }\n }\n }\n return result;\n})"]}}},"posttherapy_stage_group":{"restrictions":{"codeList":{"left":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS"],"right":["Occult Carcinoma","Stage 0","Stage 0a","Stage 0is","Stage 1","Stage 1A","Stage 1B","Stage A","Stage B","Stage C","Stage I","Stage IA","Stage IA1","Stage IA2","Stage IA3","Stage IAB","Stage IAE","Stage IAES","Stage IAS","Stage IB","Stage IB1","Stage IB2","Stage IBE","Stage IBES","Stage IBS","Stage IC","Stage IE","Stage IEA","Stage IEB","Stage IES","Stage II","Stage II bulky","Stage IIA","Stage IIA1","Stage IIA2","Stage IIAE","Stage IIAES","Stage IIAS","Stage IIB","Stage IIBE","Stage IIBES","Stage IIBS","Stage IIC","Stage IIE","Stage IIEA","Stage IIEB","Stage IIES","Stage III","Stage IIIA","Stage IIIA1","Stage IIIA2","Stage IIIAE","Stage IIIAES","Stage IIIAS","Stage IIIB","Stage IIIBE","Stage IIIBES","Stage IIIBS","Stage IIIC","Stage IIIC1","Stage IIIC2","Stage IIID","Stage IIIE","Stage IIIES","Stage IIIS","Stage IIS","Stage IS","Stage IV","Stage IVA","Stage IVA1","Stage IVA2","Stage IVAE","Stage IVAES","Stage IVAS","Stage IVB","Stage IVBE","Stage IVBES","Stage IVBS","Stage IVC","Stage IVE","Stage IVES","Stage IVS","Cannot be assessed"],"data":{"added":["Cannot be assessed"],"deleted":[]}},"script":{"left":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1'\n];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n }\n \n return result;\n })"],"right":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = { valid: true, message: 'Ok' };\n const stagingName = $name\n .trim()\n .toLowerCase()\n .split('_stage_group')[0];\n\n const stagingSystem = stagingName + `_tumour_staging_system`;\n const tCategory = `${stagingName}_t_category`;\n const nCategory = `${stagingName}_n_category`;\n const mCategory = `${stagingName}_m_category`;\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($row[stagingSystem] && (!$field || checkforEmpty($field))) {\n result.valid = false;\n const msg = `The ${stagingName}_stage_group must be submitted if the field ${stagingSystem} is submitted.`;\n result.message = msg;\n }\n else if (!($row[stagingSystem]) && $field) {\n result.valid = false;\n const msg = `The field ${stagingSystem} must be submitted if ${stagingName}_stage_group is submitted.`;\n result.message = msg;\n }\n else if ($row[stagingSystem] && $field) {\n let codeList = [];\n switch ($row[stagingSystem] && $row[stagingSystem].trim().toLowerCase()) {\n case 'revised international staging system (riss)':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii'\n ];\n break;\n case 'lugano staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ib',\n 'stage ie',\n 'stage iea',\n 'stage ieb',\n 'stage ii',\n 'stage ii bulky',\n 'stage iia',\n 'stage iib',\n 'stage iie',\n 'stage iiea',\n 'stage iieb',\n 'stage iii',\n 'stage iiia',\n 'stage iiib',\n 'stage iv',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'st jude staging system':\n codeList = [\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'ann arbor staging system':\n codeList = [\n 'stage i',\n 'stage ia',\n 'stage ie',\n 'stage is',\n 'stage ies',\n 'stage iae',\n 'stage ias',\n 'stage iaes',\n 'stage ib',\n 'stage ibe',\n 'stage ibs',\n 'stage ibes',\n 'stage ii',\n 'stage iia',\n 'stage iie',\n 'stage iis',\n 'stage iies',\n 'stage iiae',\n 'stage iias',\n 'stage iiaes',\n 'stage iib',\n 'stage iibe',\n 'stage iibs',\n 'stage iibes',\n 'stage iii',\n 'stage iiia',\n 'stage iiie',\n 'stage iiis',\n 'stage iiies',\n 'stage iiiae',\n 'stage iiias',\n 'stage iiiaes',\n 'stage iiib',\n 'stage iiibe',\n 'stage iiibs',\n 'stage iiibes',\n 'stage iv',\n 'stage iva',\n 'stage ive',\n 'stage ivs',\n 'stage ives',\n 'stage ivae',\n 'stage ivas',\n 'stage ivaes',\n 'stage ivb',\n 'stage ivbe',\n 'stage ivbs',\n 'stage ivbes'\n ];\n break;\n case 'rai staging system':\n codeList = [\n 'stage 0',\n 'stage i',\n 'stage ii',\n 'stage iii',\n 'stage iv'\n ];\n break;\n case 'durie-salmon staging system':\n codeList = [\n 'stage 1',\n 'stage 1a',\n 'stage 1b',\n 'stage ii',\n 'stage iia',\n 'stage iib',\n 'stage iii',\n 'stage iiia',\n 'stage iiib'\n ];\n break;\n case 'figo staging system':\n codeList = [\n 'stage ia',\n 'stage ia1',\n 'stage ia2',\n 'stage ib',\n 'stage ib1',\n 'stage ib2',\n 'stage iia',\n 'stage iab',\n 'stage iiia',\n 'stage iiib',\n 'stage iva',\n 'stage ivb'\n ];\n break;\n case 'binet staging system':\n codeList = [\n 'stage a',\n 'stage b',\n 'stage c'\n ];\n break;\n case 'ajcc 8th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ia3','stage ib','stage ib1','stage ib2','stage ic','stage ie','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iie','stage iii','stage iiia','stage iiia1','stage iiia2','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iiid','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n case 'ajcc 7th edition':\n codeList = ['stage 0','stage 0a','stage 0is','stage i','stage ia','stage ia1','stage ia2','stage ib','stage ib1','stage ib2','stage ic','stage is','stage ii','stage iia','stage iia1','stage iia2','stage iib','stage iic','stage iii','stage iiia','stage iiib','stage iiic','stage iiic1','stage iiic2','stage iv','stage iva','stage iva1','stage iva2','stage ivb','stage ivc','occult carcinoma','stage 1', 'cannot be assessed'];\n break;\n default:\n codelist = [];\n }\n\n if (!codeList.includes($field.trim().toLowerCase()) && codeList.length) {\n const msg = `'${$field}' is not a permissible value. When '${stagingSystem}' is set to '${\n $row[stagingSystem]\n }', '${stagingName}_stage_group' must be one of the following: \\n${codeList\n .map(code => `- \"${code}\"`)\n .join('\\n')}`;\n\n result.valid = false;\n result.message = msg;\n }\n if ($field.trim().toLowerCase() === 'cannot be assessed') {\n if ($row[tCategory].trim().toLowerCase() != 'tx' && $row[nCategory].trim().toLowerCase() != 'nx') {\n result = {\n valid: false,\n message: `The submitted term '${$field}' is not permissible for '${stagingName}_stage_group' when TNM is '${$row[tCategory]}${$row[nCategory]}${$row[mCategory]}'`\n };\n }\n }\n }\n return result;\n })"]}}}},"created":{"anatomic_site_progression_or_recurrence":{"changeType":"created","description":"Indicate the ICD-O-3 topography code for the anatomic site(s) where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrence","valueType":"string","isArray":true,"restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($name === 'recurrence_tumour_staging_system') {\n if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n else {\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' should not be submitted if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1|C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence.\nTo include multiple values, separate values with a pipe delimiter '|' within your file."}}},"deleted":{"anatomic_site_progression_or_recurrences":{"changeType":"deleted","description":"Indicate the ICD-O-3 topography code for the anatomic site where disease progression, relapse or recurrence occurred, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3). Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344.","name":"anatomic_site_progression_or_recurrences","valueType":"string","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* required field, cannot be null */\n if ($row.disease_status_at_followup != null) {\n const diseaseStatus = $row.disease_status_at_followup.trim().toLowerCase();\n const stateOfProgression = (entry) => {return /(progression)$/.test(decodeURI(entry))}; \n const relapseOrRecurrence = diseaseStatus === \"relapse or recurrence\";\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ((!$field || checkforEmpty($field)) && (stateOfProgression(diseaseStatus) || relapseOrRecurrence)) {\n result = {valid: false, message: `'${$name}' is a required field if 'disease_status_at_followup' is set a state of progression, relapse, or recurrence.` }\n }\n else if (!(!$field || checkforEmpty($field)) && !stateOfProgression(diseaseStatus) && !relapseOrRecurrence) {\n result = {valid: false, message: `'${$name}' cannot be provided if 'disease_status_at_followup' is not a state of progression, relapse, or recurrence.` }\n }\n }\n return result;\n })"],"regex":"^[C][0-9]{2}(.[0-9]{1})?$"},"meta":{"core":true,"dependsOn":"follow_up.disease_status_at_followup","displayName":"Anatomic Site Progression or Recurrences","examples":"C50.1,C18","notes":"This field is required to be submitted if disease_status_at_followup indicates a state of progression, relapse, or recurrence."}}}},"family_history":{"updated":{"submitter_donor_id":{"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"family_relative_id":{"meta":{"primaryId":{"left":null,"right":true}},"restrictions":{"regex":{"left":"^[A-Za-z0-9\\-\\._]{1,64}","right":"^[A-Za-z0-9\\-\\._]{1,64}$"}}},"relationship_type":{"restrictions":{"codeList":{"left":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Sister","Son","Unknown"],"right":["Aunt","Brother","Cousin","Daughter","Father","Grandchild","Grandfather","Grandmother","Maternal Aunt","Maternal Cousin","Maternal Grandfather","Maternal Grandmother","Maternal Half-brother","Maternal Half-sister","Maternal Uncle","Mother","Nephew","Niece","Other","Paternal Aunt","Paternal Cousin","Paternal Grandfather","Paternal Grandmother","Paternal Half-brother","Paternal Half-sister","Paternal Uncle","Sister","Son","Uncle","Unknown"],"data":{"added":["Maternal Uncle","Paternal Uncle","Uncle"],"deleted":[]}}}}},"created":{},"deleted":{}},"surgery":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","description":"Unique identifier of the donor, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"If a specimen was resected during surgery, indicate the unique identifier of the specimen here. This submitter_specimen_id should exist in the Specimen file.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"specimen.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Please refer to documentation for instructions on how to submit a specimen that was resected during surgery: https://docs.icgc-argo.org/docs/submission/submitting-clinical-data#submitting-data-in-surgery-file"},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","description":"Unique identifier of the treatment, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"surgery_type":{"changeType":"created","name":"surgery_type","valueType":"string","description":"Indicate the type of surgical procedure that was performed. (References: SNOMED, NCIt, UMLS)","meta":{"core":true,"displayName":"Surgery Type "},"restrictions":{"required":true,"codeList":["Axillary Clearance","Axillary lymph nodes sampling","Biopsy","Bypass Gastrojejunostomy","Cholecystectomy","Cholecystojejunostomy","Completion gastrectomy","Debridement of pancreatic and peripancreatic necrosis","Debulking","Distal subtotal pancreatectomy","Drainage of abscess","Duodenal preserving pancreatic head resection","Endoscopic biopsy","Endoscopic brushings of GIT","Enucleation","Esophageal bypass surgery/jejunostomy only","Exploratory laparotomy","Fine needle aspiration biopsy","Gastric Antrectomy","Hemithyroidectomy","Hepaticojejunostomy","Ivor Lewis subtotal esophagectomy","Laparotomy (Open and Shut)","Left thoracoabdominal incision","Lobectomy","Mammoplasty","Mastectomy","McKeown esophagectomy","Merendino procedure","Minimally invasive esophagectomy","Near-total thyroidectomy","Pancreaticoduodenectomy","Pancreaticojejunostomy, side-to-side anastomosis","Pneumonectomy","Proximal subtotal gastrectomy","Pylorus-sparing Whipple operation","Radical pancreaticoduodenectomy","Reexcision","Segmentectomy","Sentinal Lymph Node Biopsy","Spleen preserving distal pancreatectomy","Splenectomy","Subtotal pancreatectomy","Subtotal thyroidectomy","Thoracotomy (Open & Shut)","Total gastrectomy","Total gastrectomy with extended lymphadenectomy","Total pancreatectomy","Total thyroidectomy","Transhiatal esophagectomy","Triple bypass of pancreas","Wedge/localised gastric resection","Wide Local Excision"]}},"surgery_site":{"changeType":"created","name":"surgery_site","valueType":"string","description":"Indicate the ICD-O-3 topography code for the anatomic site where the surgical procedure was performed, according to the International Classification of Diseases for Oncology, 3rd Edition (WHO ICD-O-3).","meta":{"displayName":"Surgery Site","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"Refer to the ICD-O-3 manual for guidelines at https://apps.who.int/iris/handle/10665/42344. This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since anatomic site is collected in the Specimen table."},"restrictions":{"regex":"^[C][0-9]{2}(.[0-9]{1})?$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"surgery_location":{"changeType":"created","name":"surgery_location","valueType":"string","description":"Indicate whether the surgical procedure was done at the primary, local recurrence or metastatic location.","meta":{"displayName":"Surgery Location","core":true,"dependsOn":"surgery.submitter_specimen_id","notes":"This field is not required if a specimen was resected during surgery (ie. if `submitter_specimen_id` is submitted) since type of specimen is collected in the Specimen table."},"restrictions":{"codeList":["Local recurrence","Metastatic","Primary"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n if ($row.submitter_specimen_id && $row.submitter_specimen_id != null && !(checkforEmpty($row.submitter_specimen_id))) {\n if ($field && $field != null && !(checkforEmpty($field))) {\n result = {\n valid: false,\n message: `The '${$name}' field does not need to be submitted if a specimen was resected during surgery.`\n };\n }\n }\n else {\n if (!$field || checkforEmpty($field) || $field === null) {\n result = {\n valid: false,\n message: `The '${$name}' field is a required field.`\n };\n }\n }\n return result;\n })"]}},"tumour_length":{"changeType":"created","name":"tumour_length","valueType":"number","description":"Indicate the length of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Length"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_width":{"changeType":"created","name":"tumour_width","valueType":"number","description":"Indicate the width of the tumour, in millimetres (mm).","meta":{"displayName":"Tumour Width"},"restrictions":{"range":{"exclusiveMin":0}}},"greatest_dimension_tumour":{"changeType":"created","name":"greatest_dimension_tumour","valueType":"number","description":"Indicate the greatest dimension or diameter of the tumour, in millimetres (mm). (Reference: NCIt C157135)","meta":{"displayName":"Greatest Dimension Tumour"},"restrictions":{"range":{"exclusiveMin":0}}},"tumour_focality":{"changeType":"created","name":"tumour_focality","valueType":"string","description":"Indicate the characterization of the location of the tumour. (Reference: NCIt: C157425)","meta":{"displayName":"Tumour Focality"},"restrictions":{"codeList":["Cannot be assessed","Multifocal","Not applicable","Unifocal","Unknown"]}},"residual_tumour_classification":{"changeType":"created","name":"residual_tumour_classification","valueType":"string","description":"Indicate the absence or presence of residual tumour after treatment. In some cases treated with surgery and/or with neoadjuvant therapy there will be residual tumour at the primary site after treatment because of incomplete resection or local and regional disease that extends beyond the limit of ability of resection. (Reference: AJCC 8th ed.)","meta":{"displayName":"Residual Tumour Classification","notes":"RX (Presence of residual tumour cannot be assessed), R0 (no residual tumour), R1 (microscopic residual tumour), R2 (macroscopic residual tumour)"},"restrictions":{"codeList":["Not applicable","RX","R0","R1","R2","Unknown"]}},"margin_types_involved":{"changeType":"created","name":"margin_types_involved","valueType":"string","description":"Indicate the margin type(s) involved.","isArray":true,"meta":{"displayName":"Margin Types Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_involved":{"changeType":"created","name":"margin_types_not_involved","valueType":"string","description":"Indicate the margin type(s) not involved.","isArray":true,"meta":{"displayName":"Margin Types Not Involved","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks if surgical procedure involves debulking or biopsy */\n const surgeryTypeExceptions = (entry) => {return /(biopsy|debulking)$/.test(decodeURI(entry))}; \n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n if ($field && !(checkforEmpty($field)) && $field != null) {\n if ((!$row.submitter_specimen_id || $row.submitter_specimen_id === null) && !(surgeryTypeExceptions($row.surgery_type.trim().toLowerCase()))) {\n result = {valid: false, message: `The 'submitter_specimen_id' of the resected specimen must be submitted if '${$name}' is submitted.`};\n }\n }\n return result;\n })"]}},"margin_types_not_assessed":{"changeType":"created","name":"margin_types_not_assessed","valueType":"string","description":"Indicate the margin type(s) that cannot be assessed.","isArray":true,"meta":{"displayName":"Margin Types Not Assessed","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"restrictions":{"codeList":["Circumferential resection margin","Common bile duct margin","Distal margin","Not applicable","Proximal margin","Unknown"]}},"lymphovascular_invasion":{"changeType":"created","name":"lymphovascular_invasion","valueType":"string","description":"Indicate the absence or presence of lymphovascular invasion (LVI). LVI includes lymphatic invasion, vascular invasion and lymphovascular invasion. (Reference: AJCC 8th ed.)","meta":{"displayName":"Lymphovascular Invasion (LVI)"},"restrictions":{"codeList":["Absent","Both lymphatic and small vessel and venous (large vessel) invasion","Lymphatic and small vessel invasion only","Not applicable","Present","Venous (large vessel) invasion only","Unknown"]}},"perineural_invasion":{"changeType":"created","name":"perineural_invasion","valueType":"string","description":"A morphologic finding referring to a tumour that has spread along and infiltrated nerve fibers. Indicate the presence or absence of perineural invasion. (Reference: NCIt: C48260, ICCR)","meta":{"displayName":"Perineural Invasion"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}},"extrathyroidal_extension":{"changeType":"created","name":"extrathyroidal_extension","valueType":"string","description":"Indicate the involvement of perithyroidal soft tissues by direct extension from the thyroid primary. (Reference: AJCC 8th Ed.)","meta":{"displayName":"Extrathyroidal Extension"},"restrictions":{"codeList":["Absent","Cannot be assessed","Not applicable","Present","Unknown"]}}},"deleted":{}},"exposure":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"tobacco_smoking_status":{"changeType":"created","description":"Indicate donor's self-reported smoking status and history. (Reference: caDSR CDE ID 2181650)","name":"tobacco_smoking_status","valueType":"string","meta":{"displayName":"Tobacco Smoking Status","notes":"Current smoker: Has smoked 100 cigarettes in their lifetime and who currently smokes. Includes daily smokers and non-daily smokers (also known as occassional smokers). Current reformed smoker for >15 years: A person who currently does not smoke and has been a non-smoker for more than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker for <= 15 years: A person who currently does not smoke and has been a non-smoker for less than 15 years, but has smoked at least 100 cigarettes in their life. Current reformed smoker, duration not specified: A person who currently does not smoke and has been a non-smoker for unspecified time, but has smoked at least 100 cigarettes in their lifetime. Smoking history not documented: Smoking history has not be recorded or is unknown."},"restrictions":{"codeList":["Current reformed smoker for <= 15 years","Current reformed smoker for > 15 years","Current reformed smoker, duration not specified","Current smoker","Lifelong non-smoker (<100 cigarettes smoked in lifetime)","Not applicable","Smoking history not documented"]}},"tobacco_type":{"changeType":"created","description":"Indicate the type(s) of tobacco used by donor. (Reference: NCIt CDE C177629)","name":"tobacco_type","valueType":"string","meta":{"displayName":"Tobacco Type","dependsOn":"exposure.tobacco_smoking_status","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Chewing Tobacco","Cigar","Cigarettes","Electronic cigarettes","Not applicable","Pipe","Roll-ups","Snuff","Unknown","Waterpipe"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"pack_years_smoked":{"changeType":"created","description":"This field applies to cigarettes. Indicate the smoking intensity in Pack Years, where the number of pack years is defined as the number of cigarettes smoked per day times (x) the number of years smoked divided (/) by 20. (Reference: caDSR CDE ID 2955385)","name":"pack_years_smoked","valueType":"number","meta":{"displayName":"Pack Years Smoked","dependsOn":"exposure.tobacco_smoking_status"},"restrictions":{"range":{"min":0},"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n const smokerCategories = ['current reformed smoker for <= 15 years', 'current reformed smoker for > 15 years', 'current reformed smoker, duration not specified', 'current smoker'];\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n // check tobacco related fields\n if ($name === 'tobacco_type') {\n if ($row.tobacco_type != null && !(checkforEmpty($row.tobacco_type))) {\n const tobaccoType = ($row.tobacco_type).map(value => value.toLowerCase());\n if (!$row.tobacco_smoking_status || checkforEmpty($row.tobacco_smoking_status) || $row.tobacco_smoking_status === null) {\n result = { valid: false, message: `If '${$name}' is submitted, then the 'tobacco_smoking_status' field is required.`}\n }\n else {\n const smokingStatus = $row.tobacco_smoking_status.trim().toLowerCase();\n if (smokerCategories.includes(smokingStatus) && tobaccoType.includes('not applicable')) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is '${smokingStatus}', then the '${$name}' field cannot be submitted as 'Not applicable'. Indicate type(s) of tobacco smoked or submit 'Unknown'.`};\n }\n else if (smokingStatus === 'smoking history not documented' && !(tobaccoType.includes('unknown'))) {\n result = {valid: false, message: `If the 'tobacco_smoking_status' field is submitted as '${smokingStatus}', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (smokingStatus === 'lifelong non-smoker (<100 cigarettes smoked in lifetime)' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor is a lifelong non-smoker, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n else if (smokingStatus === 'not applicable' && !(tobaccoType.includes('not applicable'))) {\n result = { valid: false, message: `If donor's smoking history is not applicable, then the '${$name}' field should be submitted as 'Not applicable'.`}\n }\n }\n }\n else {\n if ($row.tobacco_smoking_status != null && !(checkforEmpty($row.tobacco_smoking_status))) {\n if (smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase())) {\n result = { valid: false, message: `The '${$name}' field is required if donor is or was a smoker.`}\n }\n }\n }\n }\n else if ($name === 'pack_years_smoked' && $row.pack_years_smoked != null && !(checkforEmpty($row.pack_years_smoked))) {\n if ((!$row.tobacco_smoking_status || $row.tobacco_smoking_status === null || (!smokerCategories.includes($row.tobacco_smoking_status.trim().toLowerCase()))) && ($row.pack_years_smoked != null || !(checkforEmpty($row.pack_years_smoked)))) {\n result = {valid: false, message: `The '${$name}' field should not be submitted if donor does not have a history of smoking.`}\n }\n }\n return result;\n })"]}},"alcohol_history":{"changeType":"created","description":"Indicate if the donor has consumed at least 12 drinks of any alcoholic beverage in their lifetime. (Reference: caDSR CDE ID 2201918)","name":"alcohol_history","valueType":"string","meta":{"displayName":"Alcohol History"},"restrictions":{"codeList":["Yes","No","Not applicable","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const alcoholHistoryYes = [\"daily drinker\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n const exclusionCategories = [\"no\", \"not applicable\", \"unknown\"];\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholHistory = $field.trim().toLowerCase() \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n const alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if (exclusionCategories.includes(alcoholHistory) && alcoholHistoryYes.includes(alcoholConsumptionCategory)) {\n result = {valid:false, message: `The 'alcohol_history' field (submitted as '${alcoholHistory}') is inconsistent if the donor is a(n) '${alcoholConsumptionCategory}'. Confirm and correct the 'alcohol_history' and 'alcohol_consumption_category' fields.`};\n }\n else if (alcoholHistory === 'not applicable' && (alcoholConsumptionCategory === 'unknown' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is not applicable, then the 'alcohol_consumption_category' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholHistory === 'unknown' && (alcoholConsumptionCategory === 'not applicable' || alcoholConsumptionCategory === 'none' || alcoholConsumptionCategory === 'occasional drinker (< once a month)')) {\n result = {valid:false, message: `If the 'alcohol_history' field is unknown, then the 'alcohol_consumption_category' field must be submitted as 'Unknown'.`};\n }\n else if (alcoholHistory === 'no' && alcoholConsumptionCategory === 'unknown') {\n result = {valid:false, message: `If the 'alcohol_history' field is 'No', then the 'alcohol_consumption_category' field must be submitted as 'Not applicable' or 'None'.`};\n }\n }\n else if (alcoholHistory === 'unknown' || alcoholHistory === 'not applicable') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as '${$field}'.`};\n }\n else if (alcoholHistory === 'yes') {\n result = {valid: false, message: `If the 'alcohol_history' field is '${$field}', then the 'alcohol_consumption_category' field must be submitted as well.`};\n }\n }\n else if (alcoholHistoryYes.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the donor is a(n) '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as 'Yes'.`};\n }\n else if (exclusionCategories.includes($row.alcohol_consumption_category)) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' field is submitted as '${$row.alcohol_consumption_category}', then the 'alcohol_history' field must be submitted as '${$row.alcohol_consumption_category}'.`}\n }\n return result;\n })"]}},"alcohol_consumption_category":{"changeType":"created","description":"Describe the donor's current level of alcohol use as self-reported by the donor. (Reference: caDSR CDE ID 3457767)","name":"alcohol_consumption_category","valueType":"string","meta":{"displayName":"Alcohol Consumption Category","notes":""},"restrictions":{"codeList":["Daily Drinker","None","Not applicable","Occasional Drinker (< once a month)","Social Drinker (> once a month, < once a week)","Unknown","Weekly Drinker (>=1x a week)"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n \n const alcoholHistoryCategories = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if (!$field || $field === null || checkforEmpty($field)) {\n if ($row.alcohol_history && $row.alcohol_history != null && !(checkforEmpty($row.alcohol_history)) && $row.alcohol_history.trim().toLowerCase() === 'yes') {\n result = {valid:false, message: `The '${$name}' field must be submitted if donor has an alcohol history.`};\n }\n }\n else {\n const alcoholConsumptionCategory = $field.trim().toLowerCase();\n if (alcoholHistoryCategories.includes(alcoholConsumptionCategory) && (!$row.alcohol_history || $row.alcohol_history === null || checkforEmpty($row.alcohol_history))) {\n result = {valid:false, message: `The 'alcohol_history' field must be submitted if donor is a '${alcoholConsumptionCategory}'.`};\n }\n }\n return result;\n })"]}},"alcohol_type":{"changeType":"created","description":"Indicate the type(s) of alcohol the donor consumes. (Reference: NCIt CDE C173647)","name":"alcohol_type","valueType":"string","meta":{"displayName":"Alcohol Type","dependsOn":"exposure.alcohol_consumption_category","notes":"To include multiple values, separate values with a pipe delimiter '|' within your file."},"isArray":true,"restrictions":{"codeList":["Beer","Liquor","Not applicable","Other","Unknown","Wine"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const requiresAlcoholType = [\"daily drinker\", \"occasional drinker (< once a month)\", \"social drinker (> once a month, < once a week)\", \"weekly drinker (>=1x a week)\"];\n \n if ($row.alcohol_consumption_category && $row.alcohol_consumption_category != null && !(checkforEmpty($row.alcohol_consumption_category))) {\n alcoholConsumptionCategory = $row.alcohol_consumption_category.trim().toLowerCase();\n if ($field && $field != null && !(checkforEmpty($field))) {\n const alcoholType = ($field).map(value => value.toLowerCase());\n if (alcoholConsumptionCategory === 'none' && !(alcoholType.includes('unknown')) && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `The 'alcohol_consumption_category' field is submitted as 'None' and is inconsistent with the '${$name}' field which indicates the donor consumed '${alcoholType}'. If donor did not consume alcohol, then the '${$name}' field should be submitted as 'Not applicable'. Otherwise, please confirm the 'alcohol_consumption_category' field.`};\n }\n else if (alcoholConsumptionCategory === 'not applicable' && !(alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Not applicable', then the '${$name}' field must be submitted as 'Not applicable'.`};\n }\n else if (alcoholConsumptionCategory === 'unknown' && !(alcoholType.includes('unknown'))) {\n result = {valid:false, message: `If the 'alcohol_consumption_category' is submitted as 'Unknown', then the '${$name}' field must be submitted as 'Unknown'.`};\n }\n else if (requiresAlcoholType.includes(alcoholConsumptionCategory) && (alcoholType.includes('not applicable'))) {\n result = {valid:false, message: `If the donor consumes alcohol ('${alcoholConsumptionCategory}'), then the '${$name}' field cannot be 'Not applicable'. Indicate type(s) of alcohol consumed or submit 'Unknown'.`};\n }\n }\n else {\n if (requiresAlcoholType.includes(alcoholConsumptionCategory)) {\n result = {valid: false, message: `If the 'alcohol_consumption_category' field is '${alcoholConsumptionCategory}', then the 'alcohol_type' field must be submitted.`};\n }\n }\n }\n else {\n if ($field && $field != null && !(checkforEmpty($field)) && !(($field).map(value => value.toLowerCase())).includes('not applicable')) {\n result = {valid: false, message: `The 'alcohol_consumption_category' field is required if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]}},"opiate_use":{"changeType":"created","description":"Indicate if the donor has ever used opium or other opiates like opium juice, heroin, or Sukhteh regularly (at least weekly over a 6-month period).","name":"opiate_use","valueType":"string","meta":{"displayName":"Opiate Use"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"hot_drinks_consumption":{"changeType":"created","description":"Indicate if the donor regularly drinks tea, coffee, or other hot drinks.","name":"hot_drinks_consumption","valueType":"string","meta":{"displayName":"Hot Drink Consumption"},"restrictions":{"codeList":["Never","Not applicable","Unknown","Yes, currently","Yes, only in the past"]}},"red_meat_frequency":{"changeType":"created","description":"Indicate how frequently the donor eats red meat. Examples of red meat include beef, veal, pork, lamb, mutton, horse, or goat meat.","name":"red_meat_frequency","valueType":"string","meta":{"displayName":"Red Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"processed_meat_frequency":{"changeType":"created","description":"Indicate how frequently the patient eats processed meat. Examples of processed meat include hams, salamis, or sausages.","name":"processed_meat_frequency","valueType":"string","meta":{"displayName":"Processed Meat Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"soft_drinks_frequency":{"changeType":"created","description":"Indicate the frequency of soft drink consumption by the donor.","name":"soft_drinks_frequency","valueType":"string","meta":{"displayName":"Soft Drink Consumption Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_frequency":{"changeType":"created","description":"Indicate how many times per week the donor exercises for at least 30 minutes. (Reference: NCIt CDE C25367)","name":"exercise_frequency","valueType":"string","meta":{"displayName":"Exercise Frequency"},"restrictions":{"codeList":["Never","Less than once a month","1-3 times a month","Not applicable","Once or twice a week","Most days but not every day","Every day","Unknown"]}},"exercise_intensity":{"changeType":"created","description":"Indicate the intensity of exercise. (Reference: NCIt CDE C25539)","name":"exercise_intensity","valueType":"string","meta":{"displayName":"Exercise Intensity","dependsOn":"exposure.exercise_frequency"},"restrictions":{"codeList":["Low: No increase in the heart beat, and no perspiration","Moderate: Increase in the heart beat slightly with some light perspiration","Not applicable","Vigorous: Increase in the heart beat substantially with heavy perspiration","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n //const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n \n if ($field && $field != null && !(checkforEmpty($field))) {\n const exerciseIntensity = $field.trim().toLowerCase();\n if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n const exerciseFreq = $row.exercise_frequency.trim().toLowerCase();\n if (exerciseIntensity === 'not applicable' && exerciseFreq != 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Not applicable', then the 'exercise_frequency' field must be submitted as 'Not applicable' as well. Please correct your data submission.`};\n }\n else if (exerciseIntensity === 'unknown' && exerciseFreq === 'not applicable') {\n result = {valid: false, message: `If the 'exercise_intensity' field is submitted as 'Unknown', then the 'exercise_frequency' field must be submitted as 'Unknown' as well. Please correct your data submission.`};\n }\n else if ((exerciseIntensity != 'unknown' || exerciseIntensity != 'not applicable') && (exerciseFreq === 'never')) {\n result = {valid: false, message: `The 'exercise_intensity' field (submitted as '${$field}') is inconsistent with the 'exercise_frequency': 'Never'. Please correct your data submission.`};\n }\n }\n else { \n result = {valid: false, message: `If the '${$name}' field is submitted, then the 'exercise_frequency' field is required as well.`};\n }\n }\n else if ($row.exercise_frequency && $row.exercise_frequency != null && !(checkforEmpty($row.exercise_frequency))) {\n result = {valid:false, message: `If the 'exercise_frequency' field is submitted, then the '${$name}' field must be submitted as well.`}\n }\n return result;\n })"]}}},"deleted":{}},"biomarker":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","description":"Unique identifier of the donor, assigned by the data provider.","name":"submitter_donor_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"submitter_specimen_id":{"changeType":"created","name":"submitter_specimen_id","description":"Unique identifier of the specimen, assigned by the data provider.","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_specimen_id","displayName":"Submitter Specimen ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_primary_diagnosis_id":{"changeType":"created","name":"submitter_primary_diagnosis_id","valueType":"string","description":"If the biomarker test was done at the time of primary diagnosis, then indicate the associated submitter_primary_diagnosis_id here.","meta":{"validationDependency":true,"displayName":"Submitter Primary Diagnosis ID","foreignKey":"primary_diagnosis.submitter_primary_diagnosis_id","primaryId":true,"notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_treatment_id":{"changeType":"created","name":"submitter_treatment_id","valueType":"string","description":"If the biomarker test was done at the initiation of a specific treatment regimen, indicate the associated submitter_treatment_id here.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"treatment.submitter_treatment_id","displayName":"Submitter Treatment ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"submitter_follow_up_id":{"changeType":"created","description":"If the biomarker test was done during a follow-up event, then indicate the associated submitter_follow_up_id here.","name":"submitter_follow_up_id","valueType":"string","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"follow_up.submitter_follow_up_id","displayName":"Submitter Follow-Up ID","notes":"Only one of ['submitter_specimen_id', 'submitter_primary_diagnosis_id', 'submitter_treatment_id', 'submitter_follow_up_id'] is required. If the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow up event, then the 'test_interval' field will be required."},"restrictions":{"regex":"^[A-Za-z0-9\\-\\._]{1,64}$","script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]}},"test_interval":{"changeType":"created","description":"If the biomarker test was not associated with a specific specimen or follow-up, primary diagnosis or treatment event, then indicate the interval of time since primary diagnosis that the biomarker test was performed at, in days.","name":"test_interval","valueType":"integer","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n let missing = true;\n\n // checks for a string just consisting of whitespace\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n\n const identifierFields = ['submitter_specimen_id', 'submitter_treatment_id', 'submitter_primary_diagnosis_id', 'submitter_follow_up_id', 'test_interval'];\n \n if (!$field || checkforEmpty($field) || $field === null) { \n for (let idField of identifierFields) {\n if (!$row[idField] || checkforEmpty($row[idField]) || $row[idField] === null) {\n continue;\n }\n else {\n missing = false;\n }\n }\n if (missing === true && (!$row.test_interval || checkforEmpty($row.test_interval) || $row.test_interval === null)) {\n result = {\n valid: false,\n message: `The biomarker test must be associated with one clinical event or time interval. Please submit one of [submitter_specimen_id, submitter_primary_diagnosis_id, submitter_treatment_id, submitter_follow_up_id] OR the 'test_interval' field.`};\n }\n }\n else if ($field && !(checkforEmpty($field)) && $field != null) {\n for (let idField of identifierFields) {\n if (($name != idField) && ($row[idField] && $row[idField] != null && !(checkforEmpty($row[idField])))) {\n result = {\n valid: false,\n message: `Cannot submit both '${$name}' and '${idField}'. The biomarker test can only be associated with one event clinical identifier. If it is not associated with a clinical event, then the 'test_interval' field must be submitted. If the biomarker test was done during two clinical events, then submit biomarker test as new row in table.`};\n break;\n }\n }\n }\n return result;\n })"]},"meta":{"validationDependency":true,"primaryId":true,"units":"days","displayName":"Interval Of Test","notes":"This field is required if the biomarker test is not associated with a specimen or primary diagnosis, treatment or follow-up event. The associated primary diagnosis is used as the reference point for this interval. To calculate this, find the number of days since the date of primary diagnosis."}},"ca19-9_level":{"changeType":"created","description":"Indicate the level of carbohydrate antigen 19-9 (CA19-9). Carbohydrate antigen 19-9 testing is useful to monitor the response to treatment in pancreatic cancer patients. (Reference: LOINC: 24108-3)","name":"ca19-9_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"CA19-9 Level"}},"crp_levels":{"changeType":"created","description":"Indicate the quantitative measurement of the amount of CRP, an inflammatory marker, in the blood in mg/L. Used for screening and monitoring for inflammatory disease, infections, and for cardiovascular disease risk assessment. (Reference: NCIt C64548, LOINC 30522-7)","name":"crp_levels","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"C-reactive protein (CRP) Level"}},"ldh_level":{"changeType":"created","description":"Indicate the level of lactate dehydrogenase (LDH), in IU/L. An increased amount of LDH in the blood may be a sign of tissue damage and some types of cancer. (Reference: NCI)","name":"ldh_level","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Lactate Dehydrogenase (LDH) Level"}},"anc":{"changeType":"created","description":"Indicate the value for a hematology laboratory test for the absolute number of neutrophil cells present in a sample of peripheral blood from a donor, in cells/uL. The ANC may be used to check for infection, inflammation, leukemia and other conditions. Cancer treatment such as chemotherapy may reduce the ANC. (Reference: caDSR CDE ID: 2180198)","name":"anc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Neutrophil Count (ANC)"}},"alc":{"changeType":"created","description":"Indicate the absolute number of lymphocytes (ALC) found in a given volume of blood, as cells/uL. Lymphocytes help fight off infections and an altered cellular immune function has been demonstrated in patients with cancer. (Reference: NCIt: C113237)","name":"alc","valueType":"integer","restrictions":{"range":{"exclusiveMin":0}},"meta":{"displayName":"Absolute Lymphocyte Count (ALC)"}},"brca_carrier":{"changeType":"created","description":"Indicate whether donor is a carrier of a mutation in a BRCA gene. A mutation in this gene is associated with an increased risk of familial breast and ovarian cancer.","name":"brca_carrier","valueType":"string","restrictions":{"codeList":["BRCA1","BRCA2","Both BRCA1 and BRCA2","No","Not applicable","Unknown"]},"meta":{"displayName":"BRCA Carrier"}},"er_status":{"changeType":"created","description":"Indicate the expression of estrogen receptor (ER). (Reference: NAACCR 3827)","name":"er_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Estrogen Receptor Status"}},"er_allred_score":{"changeType":"created","description":"Indicate the Allred score for estrogen receptor. The Allred score is based on the percentage of cells that stain positive by immunohistochemistry (IHC) for estrogen receptor (ER) and the intensity of that staining. (Reference: NAACCR: 3828, caDSR CDE ID 2725288)","name":"er_allred_score","valueType":"string","restrictions":{"codeList":["Total ER Allred score of 1","Total ER Allred score of 2","Total ER Allred score of 3","Total ER Allred score of 4","Total ER Allred score of 5","Total ER Allred score of 6","Total ER Allred score of 7","Total ER Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Estrogen Receptor Allred Score"}},"er_percent_positive":{"changeType":"created","name":"er_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining estrogen receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Estrogen Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"her2_ihc_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by immunohistochemistry (IHC). (Reference: AJCC 8th Edition, Chapter 48)","name":"her2_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HER2 IHC Status","notes":"Negative: 0 or 1+ staining, Equivocal: 2+ staining, Positive: 3+ staining"}},"her2_ish_status":{"changeType":"created","description":"Indicate the expression of human epidermal growth factor receptor-2 (HER2) assessed by in situ hybridization (ISH). (Reference: NAACCR: 3854)","name":"her2_ish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Equivocal","Positive","Negative","Not applicable","Unknown"]},"meta":{"displayName":"HER2 ISH Status"}},"pr_status":{"changeType":"created","description":"Indicate the expression of progesterone receptor (PR). (Reference: NAACCR 3915)","name":"pr_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Progesterone Receptor Status"}},"pr_allred_score":{"changeType":"created","description":"Indicate the Allred score for progesterone receptor. The Allred score is based on the percentage of cells that stain positive by IHC for the progesterone receptor (PR) and the intensity of that staining. (Reference: NAACCR 3916)","name":"pr_allred_score","valueType":"string","restrictions":{"codeList":["Total PR Allred score of 1","Total PR Allred score of 2","Total PR Allred score of 3","Total PR Allred score of 4","Total PR Allred score of 5","Total PR Allred score of 6","Total PR Allred score of 7","Total PR Allred score of 8","Not applicable","Unknown"]},"meta":{"displayName":"Progesterone Receptor Allred Score"}},"pr_percent_positive":{"changeType":"created","name":"pr_percent_positive","description":"Indicate a value, in decimals, that represents the percent of cells staining progesterone receptor positive by immunohistochemistry (IHC).","valueType":"number","meta":{"displayName":"Progesterone Receptor Percent Positive"},"restrictions":{"range":{"min":0,"max":1}}},"pd-l1_status":{"changeType":"created","description":"Indicate the immunohistochemical test result that refers to the over-expression or lack of expression of programmed death ligand 1 (PD-L1) in a tissue sample of a primary or metastatic malignant neoplasm. (Reference NCIt: C122807)","name":"pd-l1_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"PD-L1 Status"}},"alk_ihc_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK IHC Status"}},"alk_ihc_intensity":{"changeType":"created","description":"Indicate the intensity of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by immunohistochemistry (IHC). Abnormalities of ALK can be present in lung cancers.","name":"alk_ihc_intensity","valueType":"string","restrictions":{"codeList":["0 (No stain)","+1","+2","+3"]},"meta":{"displayName":"ALK IHC Intensity"}},"alk_fish_status":{"changeType":"created","description":"Indicate the expression of anaplastic lymphoma receptor tyrosine kinase (ALK) as assessed by fluorescence in situ hybridization (FISH). Abnormalities of ALK can be present in lung cancers.","name":"alk_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ALK FISH Status"}},"ros1_ihc_status":{"changeType":"created","description":"Indicate the expression of receptor lymphoma kinase (ROS1) as assessed by immunohistochemistry (IHC). Gene fusions involving ROS1 can be present in lung cancers.","name":"ros1_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"ROS1 IHC Status"}},"pan-trk_ihc_status":{"changeType":"created","description":"Indicate the expression of Pan-TRK as assessed by immunohistochemistry (IHC). Pan-TRK IHC screens for neurotrophic tyrosine kinase receptor (NTRK) fusions which have been described in many cancers including lung, thyroid and colorectal cancers.","name":"pan-trk_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"Pan-TRK IHC Status"}},"ret_fish_status":{"changeType":"created","description":"Indicate the expression of gene arrangement involving the RET proto-oncogene (RET1) as assessed by fluorescence in situ hybridization (FISH). RET gene rearrangements are associated with several different neoplastic conditions. (Reference: NCIt C46005)","name":"ret_fish_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"RET1 FISH Status"}},"hpv_ihc_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) p16 as assessed by immunohistochemistry (IHC).","name":"hpv_ihc_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV IHC Status"}},"hpv_dna_status":{"changeType":"created","description":"Indicate the expression of Human papillomavirus (HPV) as assessed using a laboratory test in which cells are scraped from the cervix to look for DNA of HPV. (Reference: NCIt C93141)","name":"hpv_dna_status","valueType":"string","restrictions":{"codeList":["Cannot be determined","Negative","Not applicable","Positive","Unknown"]},"meta":{"displayName":"HPV DNA Status"}}},"deleted":{}},"comorbidity":{"updated":{},"created":{"program_id":{"changeType":"created","name":"program_id","valueType":"string","description":"Unique identifier of the ARGO program.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.program_id","displayName":"Program ID"},"restrictions":{"required":true}},"submitter_donor_id":{"changeType":"created","name":"submitter_donor_id","valueType":"string","description":"Unique identifier of the donor, assigned by the data provider.","meta":{"validationDependency":true,"primaryId":true,"foreignKey":"sample_registration.submitter_donor_id","displayName":"Submitter Donor ID"},"restrictions":{"required":true,"regex":"^[A-Za-z0-9\\-\\._]{1,64}$"}},"prior_malignancy":{"changeType":"created","name":"prior_malignancy","description":"Prior malignancy affecting donor.","restrictions":{"codeList":["Yes","No","Unknown"]},"valueType":"string","meta":{"displayName":"Prior Malignancy"}},"laterality_of_prior_malignancy":{"changeType":"created","name":"laterality_of_prior_malignancy","description":"If donor has history of prior malignancy, indicate laterality of previous diagnosis. (Reference: caDSR CDE ID 4122391)","valueType":"string","restrictions":{"codeList":["Bilateral","Left","Midline","Not applicable","Right","Unilateral, Side not specified","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n \n if ($name === \"laterality_of_prior_malignancy\" && $row.laterality_of_prior_malignancy && $row.laterality_of_prior_malignancy != null && !(checkforEmpty($row.laterality_of_prior_malignancy))) {\n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `The 'prior_malignancy' field should be submitted as 'Yes' if the '${$name}' field is submitted.`};\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.prior_malignancy","displayName":"Laterality at Prior Malignancy"}},"age_at_comorbidity_diagnosis":{"changeType":"created","name":"age_at_comorbidity_diagnosis","valueType":"integer","description":"Indicate the age of comorbidity diagnosis, in years.","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"],"range":{"exclusiveMin":0}},"meta":{"units":"years","dependsOn":"comorbidity.comorbidity_type_code","displayName":"Age at Comorbidity Diagnosis"}},"comorbidity_type_code":{"changeType":"created","name":"comorbidity_type_code","valueType":"string","description":"Indicate the code for the comorbidity using the WHO ICD-10 code classification (https://icd.who.int/browse10/2019/en).","restrictions":{"required":true,"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n /* check if ICD-10 code is for neoplasms */\n const neoplasmCode = (entry) => {return /^[C|D][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$/.test(decodeURI(entry))};\n\n \n if (neoplasmCode($row.comorbidity_type_code)) { \n if (!$row.prior_malignancy || $row.prior_malignancy === null || checkforEmpty($row.prior_malignancy) || invalidTypes.includes($row.prior_malignancy.trim().toLowerCase())) {\n result = {valid: false, message: `If an ICD-10 code for cancer is submitted in the '${$name}' field, then 'prior_malignancy' should be submitted as 'Yes'.`}\n }\n }\n else if ($row.prior_malignancy && $row.prior_malignancy != null && !(checkforEmpty($row.prior_malignancy)) && $row.prior_malignancy.trim().toLowerCase() === \"yes\" && (!(neoplasmCode($row.comorbidity_type_code)))) {\n result = {valid: false, message: `If the 'prior_malignancy' field is submitted as 'Yes', then an ICD-10 code for cancer is expected in the '${$name}' field.`}\n }\n return result;\n })"],"regex":"^[A-Z][0-9]{2}(.[0-9]{1,3}[A-Z]{0,1})?$"},"meta":{"primaryId":true,"dependsOn":"comorbidity.prior_malignancy","examples":"E10, C50.1, I11, M06","displayName":"Comorbidity Type Code","notes":"This field is required because it should have a cancer or non-cancer ICD-10 code. This field is marked 'Conditional' because it depends on the value of the `prior_malignancy` field. Both these fields will need to be consistent. If `prior_malignancy` is `Yes`, then an ICD-10 code related to cancer is expected in this field. If `prior_malignancy` is `No`, then an ICD-10 code related to a non-cancer condition is expected in this field."}},"comorbidity_treatment_status":{"changeType":"created","name":"comorbidity_treatment_status","valueType":"string","description":"Indicate if the patient is being treated for the comorbidity (this includes prior malignancies).","restrictions":{"codeList":["Yes","No","Unknown"],"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_type_code","displayName":"Comorbidity Treatment"}},"comorbidity_treatment":{"changeType":"created","name":"comorbidity_treatment","valueType":"string","description":"Indicate treatment details for the comorbidity (this includes prior malignancies).","restrictions":{"script":["(function validate(inputs) {\n const {$row, $name, $field} = inputs;\n let result = {valid: true, message: \"Ok\"};\n\n \n /* checks for a string just consisting of whitespace */\n const checkforEmpty = (entry) => {return /^\\s+$/g.test(decodeURI(entry).replace(/^\"(.*)\"$/, '$1'))};\n const invalidTypes = [\"no\", \"unknown\"]\n optionalFields = [\"age_at_comorbidity_diagnosis\", \"comorbidity_treatment_status\", \"comorbidity_treatment\"];\n \n if (optionalFields.includes($name) && ($field || (!(checkforEmpty($field))))) {\n if (($row.comorbidity_type_code === null || checkforEmpty($row.comorbidity_type_code))) {\n result = { valid: false, message: `The 'comorbidity_type_code' field is required if '${$name}' is submitted.`};\n }\n if ($name === \"comorbidity_treatment\" && $field && !(checkforEmpty($field))) {\n if (!$row.comorbidity_treatment_status || $row.comorbidity_treatment_status === null || checkforEmpty($row.comorbidity_treatment_status) || invalidTypes.includes($row.comorbidity_treatment_status.trim().toLowerCase())) {\n result = { valid: false, message: `The 'comorbidity_treatment_status' field should be submitted as 'Yes' if '${$name}' field is submitted.`};\n }\n }\n }\n return result;\n })"]},"meta":{"dependsOn":"comorbidity.comorbidity_treatment_status","displayName":"Comorbidity Treatment Type"}}},"deleted":{}}}} diff --git a/website/static/data/schemas/schema-versions.json b/website/static/data/schemas/schema-versions.json index 913d83bb..b2b78272 100644 --- a/website/static/data/schemas/schema-versions.json +++ b/website/static/data/schemas/schema-versions.json @@ -1,33 +1 @@ -[ - { "version": "1.23", "date": "2024-08-19T16:49:03.624Z" }, - { "version": "1.22", "date": "2024-04-18T15:20:13.668Z" }, - { "version": "1.21", "date": "2024-02-06T17:46:37.784Z" }, - { "version": "1.20", "date": "2023-10-27T20:06:58.227Z" }, - { "version": "1.19", "date": "2023-10-18T19:35:24.055Z" }, - { "version": "1.18", "date": "2023-08-25T15:45:15.320Z" }, - { "version": "1.17", "date": "2023-05-10T19:23:31.428Z" }, - { "version": "1.16", "date": "2022-12-22T21:34:51.645Z" }, - { "version": "1.15", "date": "2022-09-23T20:14:56.970Z" }, - { "version": "1.14", "date": "2022-06-16T19:14:29.303Z" }, - { "version": "1.13", "date": "2021-11-17T17:11:23.272Z" }, - { "version": "1.12", "date": "2021-09-02T15:22:35.426Z" }, - { "version": "1.11", "date": "2021-07-21T15:18:56.040Z" }, - { "version": "1.10", "date": "2021-06-08T15:08:16.060Z" }, - { "version": "1.9", "date": "2021-05-07T20:36:01.508Z" }, - { "version": "1.8", "date": "2021-04-27T20:55:03.034Z" }, - { "version": "1.7", "date": "2021-03-15T16:44:50.896Z" }, - { "version": "1.5", "date": "2020-12-11T19:45:31.441Z" }, - { "version": "1.4", "date": "2020-12-11T17:05:35.605Z" }, - { "version": "1.3", "date": "2020-11-24T17:53:13.272Z" }, - { "version": "1.2", "date": "2020-08-05T18:55:43.082Z" }, - { "version": "1.1", "date": "2020-07-16T20:03:43.021Z" }, - { "version": "1.0", "date": "2020-06-19T18:45:52.437Z" }, - { "version": "0.15", "date": "2020-06-17T17:26:07.747Z" }, - { "version": "0.14", "date": "2020-06-04T16:53:19.349Z" }, - { "version": "0.12", "date": "2020-05-28T19:50:37.756Z" }, - { "version": "0.11", "date": "2020-05-13T21:11:56.331Z" }, - { "version": "0.10", "date": "2020-04-13T16:37:27.645Z" }, - { "version": "0.7", "date": "2020-03-30T21:40:09.710Z" }, - { "version": "0.6", "date": "2020-03-27T20:53:14.913Z" }, - { "version": "0.5", "date": "2020-03-06T21:28:41.074Z" } -] +[{"version":"1.24","date":"2024-10-01T09:32:15.397Z"},{"version":"1.23","date":"2024-08-19T16:49:03.624Z"},{"version":"1.22","date":"2024-04-18T15:20:13.668Z"},{"version":"1.21","date":"2024-02-06T17:46:37.784Z"},{"version":"1.20","date":"2023-10-27T20:06:58.227Z"},{"version":"1.19","date":"2023-10-18T19:35:24.055Z"},{"version":"1.18","date":"2023-08-25T15:45:15.320Z"},{"version":"1.17","date":"2023-05-10T19:23:31.428Z"},{"version":"1.16","date":"2022-12-22T21:34:51.645Z"},{"version":"1.15","date":"2022-09-23T20:14:56.970Z"},{"version":"1.14","date":"2022-06-16T19:14:29.303Z"},{"version":"1.13","date":"2021-11-17T17:11:23.272Z"},{"version":"1.12","date":"2021-09-02T15:22:35.426Z"},{"version":"1.11","date":"2021-07-21T15:18:56.040Z"},{"version":"1.10","date":"2021-06-08T15:08:16.060Z"},{"version":"1.9","date":"2021-05-07T20:36:01.508Z"},{"version":"1.8","date":"2021-04-27T20:55:03.034Z"},{"version":"1.7","date":"2021-03-15T16:44:50.896Z"},{"version":"1.5","date":"2020-12-11T19:45:31.441Z"},{"version":"1.4","date":"2020-12-11T17:05:35.605Z"},{"version":"1.3","date":"2020-11-24T17:53:13.272Z"},{"version":"1.2","date":"2020-08-05T18:55:43.082Z"},{"version":"1.1","date":"2020-07-16T20:03:43.021Z"},{"version":"1.0","date":"2020-06-19T18:45:52.437Z"},{"version":"0.15","date":"2020-06-17T17:26:07.747Z"},{"version":"0.14","date":"2020-06-04T16:53:19.349Z"},{"version":"0.12","date":"2020-05-28T19:50:37.756Z"},{"version":"0.11","date":"2020-05-13T21:11:56.331Z"},{"version":"0.10","date":"2020-04-13T16:37:27.645Z"},{"version":"0.7","date":"2020-03-30T21:40:09.710Z"},{"version":"0.6","date":"2020-03-27T20:53:14.913Z"},{"version":"0.5","date":"2020-03-06T21:28:41.074Z"}] \ No newline at end of file